cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to add source files to TouchGFX generated project

DWahl.1
Associate II

I'm using a STM32F769I-DISCO (with the display) and generated the STM32CubeIDE project using TouchGFX designer 4.18.0. Opened it in CubeIDE and everything compiles without warning or error, flashes to the board, and looks like I'd expect. I configured USART1 as serial port and can send status messages to a serial terminal. All good so I committed to github (private) sto I have a known working starting point.

I've been unable to add any source files, even empty ones without any content without a "fatal error: test.h: No such file or directory" error. I added the empty header file by right clicking on the project name and selecting New-> Header file. I've done this in other projects without issue so why this is happening is driving me nuts. The test header is in the same folder as main.c, so why it can't see it is beyond me.

Suggestions or more info needed?

My eventual goal is to include a set of headers and source files from another project (also in CubeIDE). I've been searching the last few days and none of the solutions I've found on forums or elsewhere have solved the issue. This is the first time I've tried including files in a TouchGFX project that weren't automatically generated by it, so I suspect that's part of the issue.

4 REPLIES 4
MM..1
Chief II

Project is setup to search header files in header folders , not c. Place it right and refresh project.

DWahl.1
Associate II

Is it set up differently from other CubeMX generated projects (it appears to be)? I've tried manually putting the header files in the /Core/Inc folder and the .cpp file in the /Core/Src folder (relative to project root), refresh, compile, and I get a "undefined reference to <blah blah>" error. Shouldn't I be able to add a folder to the predefined "Drivers" folder linked to my source files and have them included? It's exactly how I've done it in non-TouchGFX projects, I just confirmed by creating a new project from CubeIDE and including the same exact files as I'm trying with the touchgfx project and it compiles without error.

MM..1
Chief II

Some yes some no. If you use makefile project , then yes you have trouble and need edit makefile.

DWahl.1
Associate II

It's not a makefile project, I did check the makefile generated by cubeide and the folder containing my source and header files is there. Further, I made sure that they are included in the build path (https://pcbartists.com/firmware/stm32-firmware/undefined-reference-to-function-stm32-cubeide-solution/). It seems like the error is occurring during linking... I can add a nonsense line into the source files and it will throw up a compile error, so it seems like it's at least finding and compiling them.