2024-07-18 06:12 AM
Hello, I'm trying to setup a simple "Hello world" project for a custom board with an STM32H7A3IIT6.
I've successfully created the project from CubeMX (6.12) generated the code for Keil MDK and, starting from the application template of the TGFX designer (4.24), I managed to add the GUI to the project, compile and flash the board successfully.
As I wanted to start using CubeIDE (currently version 1.16) I tried the same approach, so:
- CubeMX ioc project (copy of the same file used before for the Keil code generation)
- Generate code for CubeIDE ("Generate under root" checked as with unchecked it gave me the following error (https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/touchgfx-designer-error-quot-unable-to-locate-c-lt-path-to/td-p/100242)
- Open the generated "ApplicationTemplate.touchgfx.part" file with TouchGFX Designer
- Import the Blank UI and put a coloured box on the main screen
- Generate code
- Open the project with CubeIDE and build the project
-> This leads to 174 errors, all of them referred to undefined reference to touchgfx::xyz (with xyz = AbstractPartition, Application, Container, etc)
So I tried on CubeIDE to select Project->Convert to C and tried to build again.
-> This leads to a couple of errors, the same case of:
with:
C:/TouchGFXProjects/STM32H7_DTouch1_TGFX/TouchGFX/App/app_touchgfx.c:68: undefined reference to `touchgfx_components_init'
C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/TouchGFXProjects/STM32H7_DTouch1_TGFX/TouchGFX/App/app_touchgfx.c:69: undefined reference to `touchgfx_init'
C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Application/User/TouchGFX/App/app_touchgfx.o: in function `TouchGFX_Task':
C:/TouchGFXProjects/STM32H7_DTouch1_TGFX/TouchGFX/App/app_touchgfx.c:87: undefined reference to `touchgfx_taskEntry'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:67: STM32H7_DTouch1_TGFX.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.
Build Failed. 4 errors, 0 warnings.
The solutions proposed in the other forum discussions didn't solve my case.
I hope I've been clear enough to explain my case and you can help me with this topic.
Thank you!
Solved! Go to Solution.
2024-07-22 11:28 PM - edited 2024-07-22 11:29 PM
I've managed to build the project comparing the CubeIDE setup with one generated from a ST demoboard.
CubeMX doesn't automatically include in the CubeIDE project the TouchGFX "Libraries" and the "Library Paths" that must be set manually.
These options can be found under (right click on the project)-> Properties ->C/C++ General -> Path and Symbols
2024-07-18 06:48 AM
Hello @MCA_Dev ,
Martin's answer wasn't helpful to solve the "generate under root" issue?
It is usually not recommended to generate under root.
To compile TouchGFX project, you shouldn't convert to C as TouchGFX is C++.
Maybe the 174 errors could be solves by including the different folder of your project, I expect the folders generated by TouchGFX Designer to maybe not be included in the STM32CubeIDE project.
Regards,
2024-07-19 12:10 AM
Hello @GaetanGodart , thank you for your support.
I've tried again generating a new project with "Generate under root" unckecked and managed to generate code successfully from the TouchGFX generator.
I've compared the folders included in the project with the ones of a working demoboard project and look fine to me.
Any other advice?
Probably it's something not very difficult to fix but given my little experience with both TouchGFX and CubeIDE I cannot manage to make it work properly.
Thank you
2024-07-19 12:41 AM
2024-07-19 01:44 AM
It is good that you were able to not generate under root.
Did you change back the project to C++ before building?
Did you try to include the different TouchGFX folders to your project?
Regards,
2024-07-19 06:22 AM
@GaetanGodart wrote:It is good that you were able to not generate under root.
Did you change back the project to C++ before building?
Did you try to include the different TouchGFX folders to your project?
Regards,
I started the project again from scratch using the same IOC file, the project has already been created in C++ as CubeMX says after generation:
What do you mean by "try to include the different TouchGFX folders to your project?" Isn't enough to set the "Includes" folders in the respective menu?
Sorry if those are basic requests but as I said I'm a newbie in terms of CubeIDE.
Thank you.
Regards
2024-07-19 06:53 AM
Ok good!
Also, once your STM32CubeMx project is created, you should open your .touchgfx.part file, select blank UI, then click on "Generate code" From within TouchGFX Designer.
Then you can open the project in STM32CubeIDE to build it. Tell me if you still get the 174 errors from there.
Another solution is to directly compile and flash from TouchGFX Designer by clicking the button on the bottom right.
Regards,
2024-07-22 11:28 PM - edited 2024-07-22 11:29 PM
I've managed to build the project comparing the CubeIDE setup with one generated from a ST demoboard.
CubeMX doesn't automatically include in the CubeIDE project the TouchGFX "Libraries" and the "Library Paths" that must be set manually.
These options can be found under (right click on the project)-> Properties ->C/C++ General -> Path and Symbols
2024-07-23 08:26 AM
I am glad that you found a solution!
2024-09-18 03:02 PM
Hello,
I'm facing the same issues and I'm a bit new to STM32.
Can you please help me to add library and library path? What should I add there?
Thank you in advance