cancel
Showing results for 
Search instead for 
Did you mean: 

How to Cache Bitmaps Stored on an SD Card with TouchGFX

Leo_Berna99
Associate III

Hello, everyone,

I am following the following youtube video posted by ST: https://www.youtube.com/watch?v=jE_nL1GObmA.

My intention is to use an SD card to go and insert images due to a lack of space in flash or external ram.

I followed the video, creating a bitmap cache in a portion of external RAM away from frame buffers and other important resources.

In the LD file, I then added a virtual section called SDCARD into which I went to place all the contents of the ExtFlashSection.

Then following the video I am right at the point where from the .elf file I should have created the .bin file through the command arm-none-eabi-objcopy.exe --dump-section ExtFlashSection=images.bin STM32H7S78-DK_24bpp_Appli.elf.

However, I unfortunately get the following error: STM32H7S78-DK_24bpp_Appli.elf[ExtFlashSection]: can't dump section - it has no contents: File in wrong format
C:\TouchGFX\4.24.1\env\MinGW\msys\1.0\gnu-arm-gcc\bin\arm-none-eabi-objcopy.exe: unable to rename 'STM32H7S78-DK_24bpp_Appli.elf'; reason: File exists

Has anyone been through this before and has a possible solution to the problem?

31 REPLIES 31
mathiasmarkussen
ST Employee

You can keep noload, but then you will have to edit the linker file and build twice to be able to extract your assets .bin.

What I meant is removing noload from the linker script, creating the .bin and then setting extflashsection to noload or removing it altogether using objcopy as I described earlier. You can automate this via post-build commands in CubeIDE:

2024-12-18 12_54_06-workspace_1.17.0 - STM32H7S78-DK_Appli_STM32H7S7L8HXH_RAMxspi1_ROMxspi2_app.ld -.png

The command I have set is:

arm-none-eabi-objcopy.exe --dump-section ExtFlashSection=images.bin STM32H7S78-DK_Appli.elf&arm-none-eabi-objcopy.exe --set-section-flags ExtFlashSection=noload STM32H7S78-DK_Appli.elf

 which should mark the section as noload after dumping the images. Again, I have not tried to flash a board, but the .bin is created for me.

You may also be able to use the normal debug and load profiles, since the file is modified as part of the build step.

Finally I can say that this is now working. Thank you very much for the help.