cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot use TouchGFX with STM32CubeIDE (undefined references)

cBarney_GEC
Associate II

I am new to the touchGFX ecosystem and I am trying to setup a touchGFX project to work with the STM32CubeIDE. I have looked at various other forum posts, youtube videos, and the touchGFX board bring up documentation to no avail. I can setup a basic project within the IDE but as soon as I add touchGFX I run into 182 undefined reference errors. I have tried starting the project in CubeMX with and without the generate under root box checked and I run into the same issues. I have noticed that by when I attempt to build the project many of my files are crossed out in the project explorer( see screenshot). I have attached a zip file of my attempt to create a blank project that just has touchGFX initialized and builds correctly.

 

Thanks in advance

project_explorer.png

1 ACCEPTED SOLUTION
8 REPLIES 8

Hello @cBarney_GEC,

The process of creating a custom project starts from STM32CubeMX. First, you set up your hardware (like enabling display, external RAM, etc.), then you need to enable the TouchGFX Generator under Middleware and Software Packs, and generate code. Now, you will open your TouchGFX project and develop your GUI. Then, you need to generate code from the TouchGFX designer. Finally, you should be able to open .cproject under the STM32CubeIDE directory.

I hope this helps you. Don't hesitate to ask more questions! 

Mohammad MORADI
ST Software Developer | TouchGFX
cBarney_GEC
Associate II

@Mohammad MORADI ESFAHANIASL Thank you for the reply. That is the exact process I have done and when attempting to compile in the STM32CubeIDE I receive almost 200 compilation errors. I am currently following the chain of forum posts that @Trampler provided but I am yet to reach a state that can actually compile. 

 

@Trampler Thank you! I was able to get my blank/basic project to compile by adding the touchGFX linker to my cubeIDE linker configuration. Shouldn't this be automatically done by touchGFX when the generate code button is clicked and it modifies the .cproject file?

This process is handled automatically, but apparently there is a bug that prevents the libraries from being added to the project. Which version of STM32CubeIDE are you using? 

I've tested with STM32CubeIDE 1.15.0, 1.11.2, and 1.16.0, and I faced the same issue with 1.16.0

Mohammad MORADI
ST Software Developer | TouchGFX

I am using STM32CubeIDE 1.16.0, and TouchGFX 4.24.0 

I see. I will coordinate with the STM32CubeIDE team. 

Thank you so much for your feedback and sorry for the inconvenience.

Best regards,

Mohammad MORADI
ST Software Developer | TouchGFX

Hello @cBarney_GEC and @Trampler,

We found out the root of the problem, and we will fix it as soon as possible.
Meanwhile, you can open your .cproject in a text editor, search for MCU/MPU G++ Linker and MCU/MPU G++ Compiler, and change them to MCU G++ Linker and MCU G++ Compiler. Then, you need to regenerate code from your TouchGFX project. Now, all the required libraries and settings should be added to your STM32CubeIDE project; therefore, the compilation should be successful.

I suggest using this solution rather than simply adding the TouchGFX library through the project properties because other settings rely on it as well. 

I hope this helps you!

Mohammad MORADI
ST Software Developer | TouchGFX