2024-08-08 08:38 AM
Hi All,
This is the first time I am posting on this forum. I am new to cubeIde/cubeMX world.
I have recently started integrating the touchGFX capability to my stm32 boards. I followed some online tutorials and youtube videos like these:
(https://www.youtube.com/watch?v=g1siKaPox88&list=PL6Fwy7aR3zSlZO3OBppHSzDacE4CGgRqO)
However I am having issues in compiling my code. The moment I compile my code I get like 200+ errors in middleware and touchgfx/generate folder. I have tried creating a project using different boards however I am keep getting these errors. I have tried configuring the board in cubeMx and then importing it in cubeIde, also tried creating a project in just cubeide as well but i am keep getting these issues.
My cubeMx version is: 6.12.0
CubeIde version: Version: 1.16.0
TouchGfx version: 4.23.2
I have B-l475e-iot01a2(discovery board) and STM32L073RZ board. Problem is not the board here I tried creating a project using different board but my program is not compiling hence flashing the code to the board is the next step.
Please let me know what I am doing wrong. Any help will be much appreciated. I have attached screenshots of the errors I am getting. Please let me know if you guys need any further information.
Zain
Solved! Go to Solution.
2024-08-09 02:20 AM
Those are linker errors.
They suggest that you are missing some source files and/or libraries.
2024-08-08 08:43 AM
@zain_stm32 wrote:The moment I compile my code I get like 200+ errors
2024-08-09 02:00 AM - edited 2024-08-09 02:07 AM
Thanks for your response, The link which you shared helped me to understand that the first error matters the most but I am not sure how to resolve the first error and what is causing this problem. please have a look on my first 5 errors:
C:/Users/username/STM32CubeIDE/workspace_1.16.0/Test_TouchGFX/Debug/../Middlewares/ST/touchgfx/framework/include/touchgfx/ConstFont.hpp:35: undefined reference to `vtable for touchgfx::ConstFont'
C:/Users/username/STM32CubeIDE/workspace_1.16.0/Test_TouchGFX/Debug/../TouchGFX/generated/fonts/src/GeneratedFont.cpp:14: undefined reference to `touchgfx::ConstFont::ConstFont(touchgfx::GlyphNode const*, unsigned short, unsigned short, unsigned short, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned short, unsigned short)'
C:/Program Files/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: ./TouchGFX/generated/fonts/src/GeneratedFont.o:(.rodata._ZTVN8touchgfx13GeneratedFontE+0x10): undefined reference to `touchgfx::ConstFont::getGlyph(unsigned short, unsigned char const*&, unsigned char&) const'
C:/Program Files/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: ./TouchGFX/generated/fonts/src/GeneratedFont.o:(.rodata._ZTVN8touchgfx13GeneratedFontE+0x28): undefined reference to `touchgfx::Font::getCharWidth(unsigned short) const'
2024-08-09 02:20 AM
Those are linker errors.
They suggest that you are missing some source files and/or libraries.
2024-08-09 04:41 AM
I created this project in stmcubeIde and then clicked on the part file to open touchgfx designer.
I used one of the touchButton example and then click generateCode on touchGFX designer to generate files on stmcubeIde.
Refreshing cubeIde generated the touchGFX files in my repo. I just imported driver files for ILI9341, the rest of the code is auto-generated so I am not sure which library or source files might be missing.
Can you provide some direction that which files or libraries I am missing here?
Any help would be much appreciated.
Thanks :)
2024-08-13 02:08 AM
Just to let you guys know I managed to resolve this issue.
For some reason cubeIde dint have the path to libtouchgfx.a file.
To include this file into your project goto C/C++ Build-->Setting. Under the tool setting goto:
MCU/MPU G++ Linker--->Libraries and then type touchgfx (instead of libtouchgfx.a) (omit lib prefix and .a suffix)under the "Libraries (-l)" option and under the "Library search path (-L)" give the path address.
After generating the code from touchgfx you have to search the right file for your mcu because there might be multiple files for each M cortex. I was using coretx M0+ and for me file was located under following path:
C:\Users\username\STM32CubeIDE\workspace_1.16.0\stm32L073xx_touchGfx\Middlewares\ST\touchgfx\lib\core\cortex_m0\gcc