Keil Logo

ARM: STM32F7: hardfault caused by unaligned memory access

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Mark Byrnes
Posted
2-Nov-2016 16:25 GMT
Toolset
ARM
New! ARM: STM32F7: hardfault caused by unaligned memory access

I was having some issue executing from SDRAM (now working) and looked into this support document:

http://www.keil.com/support/docs/3777.htm

For part 2 of this note - should:

RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;

SYSCFG->MEMRMP |= SYSCFG_MEMRMP_SWP_FMC_1;

actually be:

RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;

SYSCFG->MEMRMP |= SYSCFG_MEMRMP_SWP_FMC_0;
// from "stm32f756xx.h" : #define SYSCFG_MEMRMP_SWP_FMC_0 0x00000400U
// from "stm32f756xx.h" : #define SYSCFG_MEMRMP_SWP_FMC_1 0x00000800U

From the Ref' Manual:
Bits 11:10 SWP_FMC[1:0]: FMC memory mapping swap
Set and cleared by software. These bits are used to swap the FMC SDRAM
banks and FMC NOR/PSRAM in order to enable the code execution from
SDRAM Banks without modifying the default MPU attribute
00: No FMC memory mapping swapping
SDRAM bank1 and Bank2 are mapped at 0xC000 0000 and 0xD000 0000
respectively (default mapping)
NOR/RAM is accessible @ 0x60000000 (default mapping)
01: NOR/RAM and SDRAM memory mapping swapped,
SDRAM bank1 and bank2 are mapped at 0x6000 0000 and 0x7000 0000,
respectively
NOR/PSRAM bank is mapped at 0xC000 0000
10: Reserved
11: Reserved

Read-Only
Author
R. Kopsch
Posted
7-Jan-2019 15:31 GMT
Toolset
ARM
New! RE: ARM: STM32F7: hardfault caused by unaligned memory access

It took a while, but I just spotted your note a moment ago.
Many thanks for the correction and reference, Mark!

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.