cancel
Showing results for 
Search instead for 
Did you mean: 

How to Load QSPI Assests into SDRAM Once and Use Them Repeatedly in TouchGFX?

jumman_JHINGA
Senior II

Hello ST Community,

I'm working on a project using STM32H7 (Waveshare OpenH7XXI-C board) with TouchGFX 4.25.

My hardware setup:

  • 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.


My goal:

I want TouchGFX to:

  1. Load image/bitmap assets (stored in QSPI) only once at startup

  2. Copy them into SDRAM

  3. Reuse from SDRAM on future redraws — avoiding repeated QSPI reads


My Questions:

  1. What is the recommended method to configure TouchGFX for caching QSPI images into SDRAM once?

  2. How should I modify the linker script (.ld) to reserve a section in SDRAM for bitmap cache without conflicting with the framebuffer?

  3. Is there a way to verify whether an image was successfully cached?

  4. What happens if the cache size is exceeded?


️ Current Setup:

  • 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!

14 REPLIES 14

hii @MM..1  thanks a lot for your response!

Yes, I’m currently using a double frame buffer strategy, with dynamic memory allocation. So I’ve assigned the framebuffer addresses in the linker script.
The SDRAM is configured in 16-bit mode, and for rendering, I’m using DMA2D in Memory-to-Memory mode with blending.

Regarding your question:


@MM..1 wrote:
Is DMA2D used? All limits vs LTDC clock is in appnote AN4861.

 


Yes, I’ve already gone through AN4861, and I’ve configured the LTDC parameters as per my display's datasheet.

As for RGB888, I don’t specifically need it at the moment, but I wanted to test how my current system performs under the highest configuration. This way, I can better identify the limitations of my existing setup, which will help during the design phase of the next hardware revision.

Flickering issue details:

I’m updating 5 text areas in real time via Ethernet. When I use a background image and font size larger than 40px, the display starts flickering. Interestingly, after 2–3 resets, the flickering stops — but it reappears again on subsequent resets. (for Font Size less than 35px every thing work normally)

However, if I replace the background image with a simple Box widget filled with a plain color, there is no flickering at all, even when increasing the font size up to 100px. The display remains stable in that case.

So, it seems the flickering is somehow tied to the combination of background image and larger fonts during high-frequency updates.

urbito
Senior II

Flickering is more related to unoptimal configuration on FMC/SDRAM than the speed between QSPI and DMA/SDRAM.

I had kind of flickering or wrong resolution/definitions in fonts and figures/images that got solved once the FMC/SDRAM got fixed.

hope it helps.

Issue solved, thanks for reporting ;)

Osman SOYKURT
ST Software Developer | TouchGFX

Hii @Osman SOYKURT 

Thank you so much for sharing this article—it was incredibly helpful!
With the guidance provided, I successfully implemented the Bitmap Caching mechanism, and it's working flawlessly. Even after multiple controller resets, there's no flickering at all now.

Osman SOYKURT
ST Employee

Hello @jumman_JHINGA ,

Glad to hear it solved your issue! :)

Osman SOYKURT
ST Software Developer | TouchGFX