Generate Under Root: code gen overwrites lib location in IDE
- February 24, 2026
- 4 replies
- 531 views
TouchGFX version 4.25.0 CubeMX version 6.17.4* STMCubeIDE version 2.0.0
*edited version
I created a development environment starting with TouchGFX and used Generate Under Root in CubeMX. This did a great job of setting up the directory structure without links so that it is easier to navigate in the STM32CubeIDE application.
Part of this process automagically moves the middleware and driver directories from the STM32CubeIDE directory to the root directory.
When the .project file is created by the TouchGFX code generation it handles the movement of all these files and include directories like a champ, except the Properties=>C/C++ Build=>Settings=>MCU/MPU G++ Linker=>Libraries=>Library search path for the libtouchgfx-float-abi-hard.a library.
It sets the path to "${workspace_loc:/STMCubeIDE/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc}" instead of "${workspace_loc:/${ProjName}/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc}"
It's a quick fix to edit it to the correct value. Unfortunately every time you Generate Code in TouchGFX and do a refresh of the project in the STM32CubeIDE application it changes it back.
My question is: Can this be fixed by the developers in a future release?
I've attached a word document with instructions on how to set up the environment. I apologize for the overuse of screenshots. I tried to make it so that the instructions could be followed by myself in six months. The document was also written with the intention of combining what the IDE gives for a new project on the STM32F769I-DISCO board with what TouchGFX gives for a new project. The IDE gives no display, and TouchGFX gives no GPIOs besides the display.
Tony



