cancel
Showing results for 
Search instead for 
Did you mean: 

Code for TouchGFX demo STM32U5G9?

Southbranch
Senior II

Hi!

Is there download link for the code in this demo. ?

More specifically, I am interested in the code that generates the FPS and MCU load.

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Hello @Southbranch ,

 

At the moment the only way you can get the source code of this demo is by creating a project in TouchGFX Designer.

First, if it is not done yet, download TouchGFX.

Open TouchGFX Designer, click on Demos, then select "Demo 7".

Finally, "Select board setup" at the top and select a board with 800x480 resolution such as the STM32U5G9 and then you can create the project.

GaetanGodart_1-1715954353942.png

You can now click on "Generate code" a the bottom right, then open the file location and here you can find all the c++ and c files.

 

If this answers your question, I invite you to select this comment as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

9 REPLIES 9
GaetanGodart
ST Employee

Hello @Southbranch ,

 

At the moment the only way you can get the source code of this demo is by creating a project in TouchGFX Designer.

First, if it is not done yet, download TouchGFX.

Open TouchGFX Designer, click on Demos, then select "Demo 7".

Finally, "Select board setup" at the top and select a board with 800x480 resolution such as the STM32U5G9 and then you can create the project.

GaetanGodart_1-1715954353942.png

You can now click on "Generate code" a the bottom right, then open the file location and here you can find all the c++ and c files.

 

If this answers your question, I invite you to select this comment as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi @GaetanGodart 

The YT video below shows Demo 7 with 'Font' example at 2m27s.

https://www.youtube.com/watch?v=MqBqnPLM-wM&t=147s

 

ferro_0-1744644931641.png

 

 

However the Font example is missing in  Demo 7 in  GfxDesigner 4.25.

Where can I find Font example please ?

Thank you

 

Hello @ferro ,

 

It is likely that we shared an alpha version for the video but ultimately decided to remove the text example from that demo, perhaps it wasn't displaying all the capabilities of the board.

There are a few text examples available on TouchGFX Designer 4.25.0 :

GaetanGodart_0-1744646862715.png

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi @GaetanGodart 

"There are a few text examples available on TouchGFX Designer 4.25.0"

Thanks for pointing that out, I searched 'vector' word as I would like to see how that effect of scalable text size in Font  example was achieved.

I thought there is possibility to change vector font size at run time but I cant find API to do that. How else would that font size change be achieved ?

Thanks.

Hello @ferro ,

 

Then you can look at the E-bike demo for flash saving.

There we have vector font to save flash and we have the ability to change the font size.
However, to change the font size, there is no functions to scale a vector font, instead we have to create multiple textArea with the various sizes we want.
So for instance creating 2 typographies that uses font X in vector, one in size 10 and the other in size 20 plus 2 textArea, one with the typography where the font is in size 10 and the other where the font is in size 20.
Then you set one visible while the others are invisible.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Thank you.

However, in [Demo 7 : Font] example, some other technique must be clearly used. What is it ? If you could please watch it again.

https://www.youtube.com/watch?v=MqBqnPLM-wM&t=147s

 

I studied vector font and What I do not understand why is API not provided to scale the vector font scale at run time. When I change scaling factor in generated code it scales

\generated\fonts\src\Vector_Table_FontX.cpp 

touchgfx::GeneratedVectorFont & getFont_vector_FontX ()
{
    static touchgfx::GeneratedVectorFont vector_FontX ( 85, 0.085f, ... )
    return vector_FontX;
}

I tried to change 0.085f and font scales. So why not to provide API to do that - the font is described by equations.

 

Hello @ferro ,

 

The implementation of the current textArea is a bit restrictive and we cannot simple enable font rescaling even if it is easy to set a size.
This has been discussed internally and this is not a priority right now but it is most likely coming if you are patient enough.

As for the demo, it can be scalable images, single character textArea inside a texture mapper for each letter or even a video.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

"This has been discussed internally"

Crystal clear. Thanks for explanation.

"it can be

1. scalable images

2. single character textArea inside a texture mapper for each letter

3. or a video."

Interesting. I need to explore texture mapper, no idea what it can do. Thanks again !

Hello @ferro ,

 

texture-mapper  basically allows you to modify the view of an element, it can be zoomed in or out, rotated and even have a virtual camera.

Note that it is very heavy to draw.

 

Regards,

 

Gaetan Godart
Software engineer at ST (TouchGFX)