2024-09-26 03:55 PM
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?
Solved! Go to Solution.
2024-09-27 06:56 AM
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:
Please tell me if this works.
Regards,
2024-09-27 06:56 AM
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:
Please tell me if this works.
Regards,
2024-09-27 09:04 AM - edited 2024-09-27 09:17 AM
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.
2024-09-30 01:18 AM
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,