Copy the Qspi data to SDRAM
- Board Name : STM32F746NG discovery board
- I have created the section for QUADSPI & SDRAM in linker file
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
QUADSPI (rx) : ORIGIN = 0x90000000, LENGTH = 16M
SDRAM (xrw) : ORIGIN = 0xC0000000, LENGTH = 16M
}
.sdram_section :
{
. = ALIGN(4);
*(.sdram_section)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
} >SDRAM
.qspi_section :
{
. = ALIGN(4);
_sqspi = .; /* create a global symbol at data start */
*(.qspi_section)
*(.image_section)
*(.font_section)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
_eqspi = .; /* define a global symbol at data end */
} >QUADSPI - To store the images & fonts in QUADSPI, use .qspisection attribute it's working fine
- I want copy the Qspi data to SDRAM
I am changed the my code like this:
.sdram_section :
{
. = ALIGN(4);
*(.sdram_section)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
} >SDRAM
_siqspi = LOADADDR(.qspi_section);
.qspi_section :
{
. = ALIGN(4);
_sqspi = .; /* create a global symbol at data start */
*(.qspi_section)
*(.image_section)
*(.font_section)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
_eqspi = .; /* define a global symbol at data end */
} >QUADSPI AT> SDRAMAnd add some lines in Startup file:
/* Copy the Qspi data to SDRAM*/
movs r1, #0
b LoopCopyDataSdram
CopyDataSdram:
ldr r3, =_siqspi
ldr r3, [r3, r1]
str r3, [r0, r1]
adds r1, r1, #4
LoopCopyDataSdram:
ldr r0, =_sqspi
ldr r3, =_eqspi
adds r2, r0, r1
cmp r2, r3
bcc CopyDataSdramCode build successfully but I have face this error:
10:42:31 : Read progress:
10:42:33 : Error: Data mismatch found at address 0xC0000000 (byte = 0x00 instead of 0xFF)
10:42:33 : Error: Download verification failed
How to solve this error ???:\
