2025-05-12 5:22 AM - edited 2025-05-15 3:41 AM
I'm working on a project using STM32H7 (Waveshare OpenH7XXI-C board) with TouchGFX 4.25.
External QSPI flash (W25Q128) for storing bitmap/image assets
External SDRAM (IS42S16400J - 16MB) for framebuffer and runtime buffers
Display resolution: 1024×600, color format: RGB888
Due to hardware design limitations, I'm unable to increase the QuadSPI speed (track length and plug-n-play module constraints).
I’ve observed that during frequent screen updates, some parts of the background image get re-read from QSPI, resulting in flickering.
This becomes more noticeable when using large fonts, wildcard text updates, or redrawing images.
I want TouchGFX to:
Load image/bitmap assets (stored in QSPI) only once at startup
Copy them into SDRAM
Reuse from SDRAM on future redraws — avoiding repeated QSPI reads
What is the recommended method to configure TouchGFX for caching QSPI images into SDRAM once?
How should I modify the linker script (.ld) to reserve a section in SDRAM for bitmap cache without conflicting with the framebuffer?
Is there a way to verify whether an image was successfully cached?
What happens if the cache size is exceeded?
Framebuffer is mapped at 0xD0000000 in SDRAM (TouchGFX_Framebuffer)
Planning to reserve from 0xD0400000 onwards for cached bitmaps via a .BitmapCacheSection in the linker
If needed, I’m happy to share my .ld file or SDRAM init code.
Thanks in advance for your guidance and suggestions!
Solved! Go to Solution.
2025-05-14 8:07 AM - edited 2025-05-15 5:20 AM
Hello @jumman_JHINGA ,
I invite you to look at this article which explains exactly what you need. Caching Bitmaps is what I would go for if I had to copy what I have from flash to RAM. If you have enough space in RAM, I suggest to cache all the assets at the beginning of your application then you would not need to uncache assets in case of multiple screens using other assets.
2025-05-13 5:48 AM
is any one has idea about this?
2025-05-14 8:07 AM - edited 2025-05-15 5:20 AM
Hello @jumman_JHINGA ,
I invite you to look at this article which explains exactly what you need. Caching Bitmaps is what I would go for if I had to copy what I have from flash to RAM. If you have enough space in RAM, I suggest to cache all the assets at the beginning of your application then you would not need to uncache assets in case of multiple screens using other assets.
2025-05-14 8:21 AM
Use the linker script to describe these areas in SDRAM, but to store in QSPI, add symbols at the head, and tail, and location in QSPI, add code in startup.s to move the area after bringing up.
Have code in SystemInit(), or your loader, bring up the SDRAM and QSPI interfaces properly per ARM CMSIS expectations, prior to main()
/* used by the startup to initialize SDRAM data */
_sisdramdata = LOADADDR(.sdramdata);
/* Initialized data sections goes into SDRAM, load LMA copy after code */
.sdramdata :
{
. = ALIGN(4);
_ssdramdata = .; /* create a global symbol at SDRAM data start */
*(.sdramdata) /* .sdramdata sections */
*(.sdramdata*) /* .sdarmdata* sections */
/* plus fonts, data, etc that you'd previous have in QSPI */
. = ALIGN(4);
_esdramdata = .; /* define a global symbol at SDRAM data end */
} >SDRAM AT> QSPI /* linker allocates in SDRAM, but stows in non-volatile QSPI */
2025-05-14 11:15 PM
Hii @Osman SOYKURT when im clicking on the article link, its going to microsoft Teams website.. when im login to team its not showing anything. could you provide procedure to access that article?
2025-05-15 12:37 AM
@jumman_JHINGA wrote:
Display resolution: 1024×600, color format: RGB888
in single buffer mode is little on edge and flicker is normal on some situations. For double buffer in SDRAM bus is more loaded , but less flicckers possible, but next images placed in cache here add next bus overload...
Is your SDRAM 32bit ? Is DMA2D used? All limits vs LTDC clock is in appnote AN4861.
If your board have STM32H743II then try place critical images into internal flash instead QSPI. You real need RGB888?
2025-05-15 12:37 AM
hii @Tesla DeLorean please tell me if im wrong, what i understood:
In my .ld file, ihave to add a new section to copy image/font data from QSPI to SDRAM:
/* Pointer to data in QSPI (load location) */
_sisdramdata = LOADADDR(.sdramdata);
/* Actual section in SDRAM (execution location) */
.sdramdata :
{
. = ALIGN(4);
_ssdramdata = .; /* Start of SDRAM data */
*(.sdramdata) /* All asset variables with __attribute__((section(".sdramdata"))) */
. = ALIGN(4);
_esdramdata = .; /* End of SDRAM data */
} >SDRAM AT>QSPI
Copy .sdramdata from QSPI to SDRAM at startup:
/* Copy sdramdata section from QSPI to SDRAM */
ldr r0, =_ssdramdata
ldr r1, =_esdramdata
ldr r2, =_sisdramdata
movs r3, #0
b LoopCopySDRAM
CopySDRAM:
ldr r4, [r2, r3]
str r4, [r0, r3]
adds r3, r3, #4
LoopCopySDRAM:
adds r4, r0, r3
cmp r4, r1
bcc CopySDRAM
till now Im i going in correct way?
After this, dose i need to do other procedure to load images and fonts into SDRAM ? or it is going to work automatically?
2025-05-15 12:40 AM
You miss SDRAM not work at this time. Simply copy in main code after init sdram...
2025-05-15 1:08 AM
ok copying in SDRAM in main.c is straitforward and easy, but my doubt is how touchGFX will accesses assets from SDRAM like QuadSPI.
2025-05-15 2:35 AM
Try read this and maybe see https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/using-fontflashsection-in-qspi-flash-memory/m-p/670999?search-action-id=54626606299&search-result-uid=670999
Simple way is create memory area SDRAMQ and set fixed addressing then use SDRAMQ AT QSPI and this is for linker info place in build code addr in SDRAMQ...