cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h533re execute code in sram1

jhoerd
Associate II

Hello members,

Until recently, I was using a G473. There, I ran code from the ccmram. That worked without any problems. Now I have switched to the H533. For performance reasons, I want to run the code in SRAM1 0x20000000 - 0x2001FFF. I want to keep the data in SRAM2.
MEMORY
{
RAM (xrw) : ORIGIN = 0x20020000, LENGTH = 80K /*Ram placed SRAM2 with ECC-Check*/
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K
CCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /*SRAM1 for code */

For example, the function:
__attribute__((section(“.ccmram”))) void EXTI0_IRQHandler();
is located in the map file at the correct address:

.text.EXTI0_IRQHandler
0x0000000020000300 0x28 ./Hal/Interface/Interrupts.o
0x0000000020000300 EXTI0_IRQHandler

The code is copied to SRAM1 in the startup file.

However, when I call the function, a hard fault is generated.
The PC points to the address: 0x20000302
The CFSR register contains: 0x01000000, which
corresponds to UFSR[8] and means unaligned access. This would match the pc address: 0x20000302.

Now my question: Is there an easy way to allow unaligned access in SRAM1? For example, by configuring the MPU or by remapping SRAM1 to 0x10000000, for example. In my research so far, I have not found a solution that works for me.
(I am using CubeIde with gcc)

Thanks in advance

jhoerd

 

0 REPLIES 0