2023-12-27 03:44 AM - edited 2023-12-27 03:45 AM
In my project I use TouchGFX for an STM32 microcontroller.
After visually changing the view, I need to generate the updated viewBase classes in the TouchGFX Designer.
Now I want to automate this process on my build-server. I am able to generate the files for the assets, but so far I am unable to generate these ..viewBase classes from the command line.
So I saw an old question https://community.st.com/t5/stm32-mcus-touch-gfx-and-gui/how-to-generate-source-code-cpp-hpp-for-touchgfx-on-linux/td-p/315134 which is no longer relevant as tgfx.exe does no longer exist.
With the current version there is a touchgfx executable which can be called with update:
touchgfx update
If I call this from the main directory of my project, nothing really seems to happen?
For now added all the generated (viewbase classes) code to git, but this is really undesirable.
Can someone explain to me how I can generate the updated files from a project.touchgfx file from the command line?
@Martin KJELDSEN do you know the updated command that should be use?
Solved! Go to Solution.
2023-12-28 01:50 AM
Hello @EmbDev ,
You can regenerate code from your command-line using this command:
C:/TouchGFX/4.23.0/designer/tgfx.exe generate -p [path to your project]/YourProject.touchgfx
You can also compile the application and flash the board using TouchGFX Environment. There are more information about the process here, and about the first command here.
I hope this helps you
2023-12-28 01:50 AM
Hello @EmbDev ,
You can regenerate code from your command-line using this command:
C:/TouchGFX/4.23.0/designer/tgfx.exe generate -p [path to your project]/YourProject.touchgfx
You can also compile the application and flash the board using TouchGFX Environment. There are more information about the process here, and about the first command here.
I hope this helps you
2023-12-28 05:54 AM - edited 2023-12-28 06:03 AM
Thanks a lot @Mohammad MORADI ESFAHANIASL so the tgfx executable is still there after all! Somehow I missed it. With this executable I am indeed able to generate the *viewBase sources :beaming_face_with_smiling_eyes:.
However I noticed that the generation is quite slow, and saw that everytime I run the tgfx generate command the TouchGfx sources of the middleware are updated/regenerated and a touchgfx_backup folder appears. This does not happen when I generate the sources from the designer.
When I add the flags --no-designer -v to the command, the *viewBase files are no longer updated. I don't really see any other options with this command that could solve this.
What is the trigger of this Middleware sources regeneration? Or how can I stop this from happening?
2024-01-02 01:10 AM
Hello again,
Yes, I can see that this folder is getting created. This should only happen when you change the TouchGFX version of your project. Sorry for this issue, we will try to fix it as soon as possible.
2024-01-02 08:04 AM
Thanks for the quick response, will wait for the next release.
2024-01-09 02:29 AM
You are very welcome