cancel
Showing results for 
Search instead for 
Did you mean: 

Import correctly Touch GFX project to Cube IDE

Enekkk
Associate II

Hi there,

I am doing a DIY project based on an STM32F469 disco board. I am using Touch GFX Designer v4.24 and generating the code with it. 

 

The thing is that when I import the project to CubeIDE software, it does not take it as a cproject because it does not show Core files.

Enekkk_0-1739800619668.png

If I import all the folder (as it can be seen in previous image) I can modify .h files but cannot compile because it counts it as an undefined reference, apart from the fact that you cannot compile 2_SPI_TEST file directly, because it does not take into account that it is a project file. 

 

Could anyone help me and explain how to do this properly? I know main.c is in DISCO file but the .h are inexistent. Do not know how to manage this, I've tried to add path system to compiler but does not fix anything...

6 REPLIES 6
GaetanGodart
ST Employee

Hello @Enekkk ,

 

When you say DIY, do you mean that you do not create the project directly from TouchGFX Designer but instead you do everything by hand by following this guide ?

Instead of "If I import all the folder", could you open the STM32CubeIDE project (the .project file) ?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Enekkk
Associate II

Hi Gaetan,

 

Thank you for your fast reply.

 

What I mean is that I start designing the GUI part in Touch GFX and then I open the project with Cube.

Enekkk_0-1739801711891.png

As this image represents.

But when I create my own files in Core/Src and Inc folders, I include the files correctly, it does not compile this files as the ones already are in those folders. Another thing is that when I create a .c or .h file in another project it appears already with a defined format and in this project I get a blank file, as if it does not recognize it as a project file.

The project show this error when tryig to compile:

"/TouchGFXProjects/SPI_disco/Core/Src/main.c:819: undefined reference to spi_init_stm32f4"

when you ctrl click on this file in main.c and it shows you the function defined in .c but does not go into the .c to execute the function.

What can it be?

 

Regards,

when you ctrl click on this file in main.c and it shows you the function defined in .h but does not go into the .c to execute the function. sorry, corrected

To open your project in STM32CubeIde, can't you just open the .project file in your STM32CubeIDE folder like the picture below shows?

GaetanGodart_1-1739808096196.png

 

"But when I create my own files in Core/Src and Inc folders"
When you create a file, do you do it like the picture below shows?

GaetanGodart_0-1739807923359.png

 

I assume that you created the function "spi_init_stm32f4".
"undefined reference" error in C typically occurs during the linking stage of the compilation process, it error means that the linker is unable to find the definition of a function so the c file.
Would it be possible that the project is unaware of the c file?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Enekkk
Associate II

I did it as you showed. I am uploading images for you to see.

 

Enekkk_0-1739865891178.pngEnekkk_1-1739865952202.png

"Opened SPI Disco folder"

Enekkk_2-1739866030760.png

Enekkk_3-1739866088359.png

Enekkk_4-1739866140655.png

In STM Disco project file yes but I have not Core Folder nor .h files. It mixes the files and I do not understand why.

 

Hello @Enekkk ,

 

If you double click on the .project file, it directly opens the STM32CubeIDE project, you do not end up on the second screenshot that you share.
To get to the second screenshot, you have to do "Open project from file system" and then you have to select the whole folder created by TouchGFX Designer but you should only select the STM32CubeIDE folder created by TouchGFX Designer which is the same as double clicking on the .project file.

Once you have opened the STM32CubeIDE project, you can create c and h files in the different folders.

However, you cannot create h and c files in the folders that are outside of the STM32CubeIDE project / folder such as the Core folder.

You can add files that are outside of the STM32CubeIDE folder by doing right click, "import", "file system".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)