Skip to main content
N Sornakumar
Associate III
August 25, 2021
Solved

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> SDRAM

And 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 CopyDataSdram

Code 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 ???:\

This topic has been closed for replies.
Imen.DBest answer
ST Technical Moderator
September 2, 2021

Hello @N Sornakumar​ ,

What is the option byte boot address? It may be the cause of this problem is on the configuration.

Try to upgrade the STLink Firmware and make sure to use the latest Cubeprogammer release.

Check this post it may helps you.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks

1 reply

Imen.DBest answer
ST Technical Moderator
September 2, 2021

Hello @N Sornakumar​ ,

What is the option byte boot address? It may be the cause of this problem is on the configuration.

Try to upgrade the STLink Firmware and make sure to use the latest Cubeprogammer release.

Check this post it may helps you.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks