Skip to main content
Jon Enz
Associate III
November 18, 2020
Question

How can I force TouchGFX Designer to generate texts?

  • November 18, 2020
  • 6 replies
  • 2974 views

After adding many text fields, resources, and typographies to a screen, I went to compile and was met with errors that generated base classes were using text IDs that did not exist. The text ID's had been added to the source files for the containers they were used in, but not to the header file or TEXTS enum.

In an attempt to "clean" the project I deleted the contents of the TouchGFX/generated folder. The designer regenerates source files, but generated/texts/include/texts is empty. I have tried to add/remove resources in the designer so it would detect changes in the spreadsheet without any luck. With an empty folder my compile errors are now:

../TouchGFX/target/generated/TouchGFXConfiguration.cpp:17:10: fatal error: texts/TypedTextDatabase.hpp: No such file or directory
 #include <texts/TypedTextDatabase.hpp>
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How can I force the designer to regenerate these files?

6 replies

Martin KJELDSEN
Principal III
November 18, 2020

When you "generate code" from the designer, you should get everything that's supposed to be in the "generated" folder back.

I've never seen this behavior before - can you share the project?

/Martin

Jon Enz
Jon EnzAuthor
Associate III
November 18, 2020

Unfortunately I'm not able to share the project in the forum.

After deleting the generated folder here is the output from the generator when run on the console.

C:\src\throttle_h7\mainapp\Debug>rmdir ..\TouchGFX\generated /s
..\TouchGFX\generated, Are you sure (Y/N)? Y
 
C:\src\throttle_h7\mainapp\Debug>C:\TouchGFX\4.15.0\designer\tgfx.exe generate --path=..\TouchGFX\throttle_mainapp.touchgfx -v
Generate Code
 
Wrote generated/gui_generated/include/gui_generated/betascreen_screen/BetaScreenViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/common/FrontendApplicationBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/common/FrontendHeapBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/common/SimConstants.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_BatterySummaryBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_CompassBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_GearSelectorBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_MotorSummaryBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/containers/Container_SpeedAndPowerBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/devscreen_screen/DevScreenViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/home_screen/HomeViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/motorcontrollerdebug_screen/MotorControllerDebugViewBase.hpp
 
Wrote generated/gui_generated/include/gui_generated/throttlescreen_screen/ThrottleScreenViewBase.hpp
 
Wrote generated/gui_generated/src/betascreen_screen/BetaScreenViewBase.cpp
 
Wrote generated/gui_generated/src/common/FrontendApplicationBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_BatterySummaryBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_CompassBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_GearSelectorBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_MotorSummaryBase.cpp
 
Wrote generated/gui_generated/src/containers/Container_SpeedAndPowerBase.cpp
 
Wrote generated/gui_generated/src/devscreen_screen/DevScreenViewBase.cpp
 
Wrote generated/gui_generated/src/home_screen/HomeViewBase.cpp
 
Wrote generated/gui_generated/src/motorcontrollerdebug_screen/MotorControllerDebugViewBase.cpp
 
Wrote generated/gui_generated/src/throttlescreen_screen/ThrottleScreenViewBase.cpp
 
Wrote generated/simulator/gcc/Makefile
 
Wrote generated/simulator/include/simulator/mainBase.hpp
 
Wrote generated/simulator/msvs/touchgfx.props
 
Wrote generated/simulator/msvs/touchgfx_prebuild.targets
 
Wrote generated/simulator/msvs/touchgfx_sdl2.props
 
Wrote generated/simulator/src/mainBase.cpp
 
Wrote generated/simulator/touchgfx.ico
 
Wrote generated/simulator/touchgfx.rc
 
Wrote generated/simulator/touchgfx.res
 
Done
 
Generate Assets
 
make -f simulator/gcc/Makefile assets -j8
 
Reading ./application.config
 
Generating generated/images/src/image_cropped-Pure-Watercraft-Logo_250.cpp
 
Generating generated/images/src/image_Icon_Battery_1x.cpp
 
Generating generated/images/src/image_Icon_Battery_4x.cpp
 
Generating generated/images/include/BitmapDatabase.hpp
 
Generating generated/images/src/BitmapDatabase.cpp
 
The fallback character differs for typography "Speed_Units" and typography "Battery_Percentage_Symbol"
 
 
Cleaning generated files from generated/texts and generated/fonts.
Generating generated/fonts/include/fonts/GeneratedFont.hpp
Generating generated/fonts/src/GeneratedFont.cpp
Generating generated/fonts/include/fonts/UnmappedDataFont.hpp
Generating generated/fonts/src/UnmappedDataFont.cpp
Generating generated/fonts/include/fonts/CachedFont.hpp
Generating generated/fonts/src/CachedFont.cpp
Generating generated/fonts/include/fonts/FontCache.hpp
Generating generated/fonts/src/FontCache.cpp
 
Done
 
Post Generate
 
touchgfx update_project --project-file=simulator/msvs/Application.vcxproj
 
Done
 
Post Generate Target
 
touchgfx update_project --project-file=../h7_mainapp.ioc --platform=m7
 
Done
 
Generation & Update complete

This still leaves me with generated/texts folder that only contains options.cache and an empty include/texts folder.

0693W000005BsNWQA0.png 

I also tried re-cloneing the project from a clean state and only copying over the .touchgfx and texts.xlsx files, but that produced the same result.

Martin KJELDSEN
Principal III
November 19, 2020

​Odd, i just created a blank project, generated from the designer and have two files "TextKeysAndLanguages.hpp" and "TypedTextDatabase.hpp". Can you try from the designer? If that works, then maybe it's an issue with tgfx.exe.

/Martin

HTD
Senior II
June 12, 2022

I had the same problem just an hour ago. It costed me like 4 hours of work I deleted just trying to get it work.

Here's why: I had an "unexpected character" in a wildcard range. TouchGFX allows you enter a character it cannot process. And it's practically any character that is not alphanumeric. For those use hex codes, so to select range of all printable ASCII use 0x20-0x7e.

Anyways, I changed the offending wildcard range and it started to generate texts correctly. It's clearly TouchGFX bug and a big one.

We could avoid loss of data / work if we read the console messages on generate code.

dkkif.1
Visitor II
June 21, 2022

I think I discovered my problem: a Zigbee-type wi-fi hub become nearby. After transferring that, my problems to get service from wetwash went away! (At least so far. Never realize with intermittent issues!)

Associate
June 5, 2024

The same thing was happening to me. I could not generate new texts after adding them to an old project, or even change the justification/font size of text IDs that were already generated. After I updated to 4.24, I can now delete the generated folder and it will generate the new texts I have added. It will not generate them if I add any more after I have generated the files once, i have to delete the whole folder again. Make sure you delete the generated folder, and not just its contents.

HTD is right, it is to do with the ranges used in wildcard buffers. I get the below error when I generate for the first time.

WARNING - Char 0xC0 is used but does not exist in the font!

WARNING - A total of 64 Unicode characters did not exist in the font!

 

It would be nice if the code generator could ignore this error instead of failing to generate new files.

Nathan_Xi
Associate III
May 16, 2025

Hello @Jon Enz 

Perhaps you got that wrong.

Check this out:

#include <texts/TextKeysAndLanguages.hpp>

Maybe you can solve your bug.

Please inform me if you have any more questions.

Good luck.

GS1
Senior III
September 22, 2025

Hi all,

now that version 4.26.0. is out, I retried the migration of my huge project to this new release, but still can not get texts being generated.

What I have done:

I used the latest STM32CubeMX version (6.15.0) and regenerated code with TouchGFX Version 4.26.0 selected. Then I opened TouchGFX Designer 4.26.0, migrated my project and generated code too.

There were several warnings concerning the Unicode characters as previously mentioned by someone:

WARNING - Char 0xC0 is used but does not exist in the font!
WARNING - A total of 64 Unicode characters did not exist in the font!

Then I tried several proposals:

- Change all wildcard character sets to 0x20...0x7E instead of 0x20 ... 0xFF. Did not help!

- Generate a blank (Simulator) app and import the GUI: Text generation then works! But I need the design im my project folder.

- I then tried to import this GUI into my original project: But text generation doesn't work then!

- I tried to generate a new (simulator) design in my current project folder and import from the working inported project: Text generation still doesn't work.


I am out of ideas, how to fix this issue!

Can anyone tell, what is wrong and how I can fix this?

 

Thanks for help.

BR GS