AnsweredAssumed Answered

SDRAM and unaligned memcpy causes exception

Question asked by SurferDude on Aug 13, 2015
Latest reply on Aug 13, 2015 by Nesrine M
I am using the The STM32F7 discovery kit (32F746GDISCOVERY) kit and I have run into an issue with memcpy using IAR (which seems to do some clever internal aligning and then copying 4 byte words).
In short, the copy fails if the SDRAM address is unaligned.


I can also simulate this error using BSP_SDRAM_WriteData


The following works:
 BSP_SDRAM_WriteData(0xC0000008, (uint32_t*)0x0806EB57, 2048);


The following fails:
BSP_SDRAM_WriteData(0xC0000009, (uint32_t*)0x0806EB58, 2048);


Notice that in (1) above, the "to address" is aligned and in (2), the "to address" is unaligned.


We are using the provided code for SDRAM initialization.

Please advice

Outcomes