Skip to main content
Zbobo.1
Associate III
November 2, 2021
Question

How to link touchgfx source(images, fonts...) in extern sdram?

  • November 2, 2021
  • 2 replies
  • 1420 views

environment:keil

link file code:​

LR_SDRAM 0xC1A00000 0x00600000 {   ; load region size_region

  ER_SDRAM 0xC1A00000 0x00600000 { ; load address = execution address

   *.o (TextFlashSection)

   *.o (FontFlashSection)

   *.o (ExtFlashSection)

  }

}

​

blockcopy:

if (dataOffset >= 0xC1A00000 && dataOffset < 0xC2000000) 

 {

  dataOffset = dataOffset - 0xC0000000;

  BSP_SDRAM_ReadData8(dataOffset, (uint8_t *)dest, numBytes);  

  return true;

 }

​

​

Hi, ST engineer. When my mcu is power up, copy the touchgfx source from qspiflash to sdram, and touchgfx task link source in sdram. I had changed the code as details above.Compare data in sdram and qspiflash of touchgfx source is same , but jump to hardfault when it power up.

How can I link my source in extern sdram? Is that any demo code?

hardfault detail:

0693W00000GW9CxQAL.jpg

This topic has been closed for replies.

2 replies

MM..1
Super User
November 2, 2021

Try study cached image, but maybe bus access is better optimized in matrix for only framebuffer in sdram.

Tesla DeLorean
Guru
November 2, 2021

>.. but jump to hardfault when it power up.

It should be pretty easy to point point exactly what the MCU objects too with a reasonable Hard Fault Handler. Most likely you haven't initialized the memories into mapped space, or you're touching things in the wrong order / places.

Normally in Keil, you'd bring up your QSPI memory, and SDRAM memory in the SystemInit() code, and then let Keil's scatterloader unpack the assorted loader regions, where you describe the SDRAM content you want copied from within a region describing the QSPI

With Scatter File regions along the lines of

...
LR_QSPI1 0x90000000 0x01000000 { ; load region size_region
 ER_QSPI1 0x90000000 0x01000000 { ; load address = execution address
 *.o (QSPIRO, QSPIXO)
 .ANY (+RO)
 .ANY (+XO)
 }
 RW_SDRAM1 0xC0000000 0x800000 { ; RW data
 *.o (SDRAMRW)
 .ANY (+RW +ZI)
 }
}

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..