2015-08-12 03:29 PM
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_WriteDataThe 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 advice2015-08-13 06:02 AM
Hi,
Any unaligned access to Device or Strongly-ordered memory generates alignment UsageFault and therefore does not cause any AXI transfer. So to resolve problem you can modify the default MPU attribute (Configure the MPU attributes as Write Through for SDRAM) or remap SDRAM at 0x60000000.Have a look tohttp://infocenter.arm.com/help/topic/com.arm.doc.ddi0489b/DDI0489B_cortex_m7_trm.pdf
it may be very helpful.Also I suggest you to try the example: STM32Cube_FW_F7_V1.1.0\Projects\STM32756G_EVAL\Examples\FMC\FMC_SDRAM_DataMemory-Syrine-