STM32F750Z Unaligned memory access when executing from external RAM.
Hallo everyone,
I have set up Segger Ozone with a Segger J-Trace to initialize the uC. When connecting to the debuggee the clock configuration, the gpio config as well as the FMC configuration is done. After that OZone loads the programm to the external RAM, sets up SP an PC and the MPU for the region to allow code execution and then jumps to the Reset Handler.
All this is working with a bare programm toggleing a pin in the while(1).
When I try to integrate FreeRTOS I can do the basic init.
But in the SVHandler (vPortSVCHandler) I get an Unaligned memory access at the following position:
" ldmia r0!, {r4-r11, r14} \n" /* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */I striped this down to:
"ldr r0, [r4] \n"
"ldr r0, [r5] \n"
"ldr r0, [r6] \n"
"ldr r0, [r7] \n"
"ldr r0, [r8] \n"
"ldr r0, [r9] \n"
"ldr r0, [r10] \n"
"ldr r0, [r11] \n"
"ldr r0, [r14] \n"The error occures on r14 (LR).
What I did so far was :
- setting up an mpu region for the entire external RAM
- resetting UNALIGN_TRP in the ccr register
- swwapped memory mapping in fmc (SYSCFG->SWP_FMC)
- added compiler flag -mno-unaligned-access
If I set the linker script to internal Flash the programm runs just fine.
The FreeRTOS code/port is generated with STM32CubeMX 5.6.0.
I appreciate any help, thank you.
Best regards
