Skip to main content
Associate II
June 20, 2025
Solved

Image stored in a specific internal flash location

  • June 20, 2025
  • 1 reply
  • 514 views

Hello,

I've just started working with TouchGFX and I would like to know if there is a possibility of showing an image (for example a .bmp) given the starting memory address where this asset is stored in the internal flash memory.

The idea is to have a custom image stored in a specific location that the customer can edit from the bootloader when switching on the machine (let's say the new customized image will take the place iin the flash memory of the old standard one). 

Is it possible to do something like that? Can anybody give me some advice? 

The microcontroller is quite limited in both flash and RAM (STM32G0B0RET6)

Thank you!

M.

Best answer by GaetanGodart

Hello @MCA_Dev ,

 

There seems to be 2 ways of doing what you want :

  1. Dynamic bitmap create external (you don't care about the image in TouchGFX, you cerate it after)
  2. Use a specific memory region (use a default image as a place holder and overwrite it)

 

1) Dynamic bitmap create external

https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_bitmap#function-dynamicbitmapcreateexternal

Usually, you will add a widget, set the image related to this image and then TouchGFX will convert it, and make sure it is aware of its existence, size and address. But dynamic bitmap create external allows to bypass that behavior and to make sure TouchGFX is aware of the existence of a new image.

Please refer to the documentation website to see how to use it.

 

2) Use a specific memory region

If the image that the user changes is always the same size, you can simply add that image widget with a placeholder/default image and then use your bootloader to overwrite it.
To do so you will have to make sure you know the address of the image so you must create a specific memory region / section for it.
If you open your .touchgfx file with a text editor you will see the available sections :

GaetanGodart_0-1750850684764.png
You can add your own custom ;section here that will contain the single image you want to overwrite, then add that section in the linker script either at the beginning of an existing memory region or in a specific memory region that you must specify first.

 

Regards,

 

1 reply

GaetanGodart
Technical Moderator
June 20, 2025

Hello @MCA_Dev ,

 

If you want the user to be able to select among various already known images, then you can just use an image widget as explained in this thread .

If you want to display a completely new image, you need to use a dynamic bitmap .

 

If my answer doesn´t help you, could you please explain what you want to do with the bootloader?

 

Regards,

MCA_DevAuthor
Associate II
June 23, 2025

Hello Gaetan, thank you for your reply.

What I meant is that I want to show an image that I know that will be stored starting from a certain internal flash memory location. The content of the image can be changed but not dinamically (only the image pixels will be changed).

Is there any specification on how the images (bmps which are the simplest will be fine for me) treated by TouchGFX are saved into the internal flash memory?

Thank you.

M.

GaetanGodart
GaetanGodartBest answer
Technical Moderator
June 25, 2025

Hello @MCA_Dev ,

 

There seems to be 2 ways of doing what you want :

  1. Dynamic bitmap create external (you don't care about the image in TouchGFX, you cerate it after)
  2. Use a specific memory region (use a default image as a place holder and overwrite it)

 

1) Dynamic bitmap create external

https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_bitmap#function-dynamicbitmapcreateexternal

Usually, you will add a widget, set the image related to this image and then TouchGFX will convert it, and make sure it is aware of its existence, size and address. But dynamic bitmap create external allows to bypass that behavior and to make sure TouchGFX is aware of the existence of a new image.

Please refer to the documentation website to see how to use it.

 

2) Use a specific memory region

If the image that the user changes is always the same size, you can simply add that image widget with a placeholder/default image and then use your bootloader to overwrite it.
To do so you will have to make sure you know the address of the image so you must create a specific memory region / section for it.
If you open your .touchgfx file with a text editor you will see the available sections :

GaetanGodart_0-1750850684764.png
You can add your own custom ;section here that will contain the single image you want to overwrite, then add that section in the linker script either at the beginning of an existing memory region or in a specific memory region that you must specify first.

 

Regards,