cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx Designer Adding Outside Source and Header Files

EthanMankins
Senior

I Started my project with touchgfx designer and have added in many hardware files. After adding the files to c and c++ compiler paths in CubeIDE they project works fine. However, when I Program and Run Target from ToughGfX Designer, none of the files are found ie.
"c:\TouchGFXProjects\CustomWheel/Core/Src/main.c:1094: undefined reference to <everything not in main.cpp>"

I have tried changing $projectName/TouchGFX/simulator/gcc/Makefile to the following but it does not work. 

 

ADDITIONAL_SOURCES := ../STM32CubeIDE/Application/User/Encoder.c ../STM32CubeIDE/Application/User/CarrierFuncs.c
ADDITIONAL_INCLUDE_PATHS := ../STM32CubeIDE/Application/User

 

 

I have gotten it to work after modifying $projectName\gcc\Makefile and adding the c files individually to the list of 
"board_c_files". However, I have many .c and .cpp files and it is unrealistic to add each individual one.

Where is the indended location to add these files so that touchgfx designer can see them?

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Hello @EthanMankins ,

 

Yes, you have to add them in the Makefile ($projectName\gcc\Makefile if you want to flash the board and $projectName/TouchGFX/simulator/gcc/Makefile if you want to run 

Can't you just add the folder in both cases :

ADDITIONAL_SOURCES := ../STM32CubeIDE/Application/User/
ADDITIONAL_INCLUDE_PATHS := ../STM32CubeIDE/Application/User

It seems we do that in one of out Makefile:

GaetanGodart_1-1727445347692.png

GaetanGodart_0-1727445336290.png

 

Please tell me if this works.

 

Regards,

 

 

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

3 REPLIES 3
GaetanGodart
ST Employee

Hello @EthanMankins ,

 

Yes, you have to add them in the Makefile ($projectName\gcc\Makefile if you want to flash the board and $projectName/TouchGFX/simulator/gcc/Makefile if you want to run 

Can't you just add the folder in both cases :

ADDITIONAL_SOURCES := ../STM32CubeIDE/Application/User/
ADDITIONAL_INCLUDE_PATHS := ../STM32CubeIDE/Application/User

It seems we do that in one of out Makefile:

GaetanGodart_1-1727445347692.png

GaetanGodart_0-1727445336290.png

 

Please tell me if this works.

 

Regards,

 

 

Gaetan Godart
Software engineer at ST (TouchGFX)

Thank you,
This at least got my files recognized by the compiler; however, now many "errors" are show to be within those files, "errors" that are not an issue to the cubeIDE Program and Run. Some of these are with files that were generated by Cube, such as sysmem.c. I'm not understanding why the compilation is so different for the same project between touchGFX and CubeIde.

example error:

 

STM32CubeIDE/Application/User/sysmem.c:57:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'
         register char * stack_ptr asm("sp");

 

EDIT:
The errors in sysmem.c and syscall.c just required changing "asm" to "__asm". The other error just required adding in some more libraries.

I still am confused why CubeIDE generated and worked without me having to make these additions. 

 

Hello @EthanMankins ,

 

From you "Edit" part, I assume you manage to fix all the errors and are able to run your program now right?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)