cancel
Showing results for 
Search instead for 
Did you mean: 

Image stored in a specific internal flash location

MCA_Dev
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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,

 

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

5 REPLIES 5
GaetanGodart
ST Employee

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,

Gaetan Godart
Software engineer at ST (TouchGFX)

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.

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,

 

Gaetan Godart
Software engineer at ST (TouchGFX)

Thank you @GaetanGodart.

I think the proposed solutions are what I was looking for!

So, if I want to follow the first proposal, I must create the External Bitmap directly in the user code (gui folder) using, for example, the main view function of an empty screen I previously set-up from the TGFX Designer, is it correct?

Thank you.

Regards,

M.

Hello @MCA_Dev ,

 

Instead of using an empty screen, you could use the frontendApplication that is always accessible. Also, screens gets "deleted" when you leave them.

Please have a look at :

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)