cancel
Showing results for 
Search instead for 
Did you mean: 

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

Zbobo.1
Associate III

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

2 REPLIES 2
MM..1
Chief II

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

>.. 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
Up vote any posts that you find helpful, it shows what's working..