cancel
Showing results for 
Search instead for 
Did you mean: 

How to manually add include path to touchgfx designer(Windows)?

Xu
Associate II

log:​

Converting images

Compiling gui/src/demo2_screen/demo2View.cpp

gui/src/demo2_screen/demo2View.cpp:6:17: fatal error: rtc.h: No such file or directory

 #include "rtc.h"

         ^

compilation terminated.

simulator/gcc/Makefile:220: recipe for target 'build/MINGW32_NT-6.2/gui/src/demo2_screen/demo2View.o' failed

make[2]: *** [build/MINGW32_NT-6.2/gui/src/demo2_screen/demo2View.o] Error 1

simulator/gcc/Makefile:182: recipe for target 'generate_assets' failed

make[1]: *** [generate_assets] Error 2

simulator/gcc/Makefile:40: recipe for target 'all' failed

make: *** [all] Error 2

rtc.h is the header file for a hardware peripheral.

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III
include_paths := $(library_includes) $(foreach comp, $(all_components), $(comp)/include) $(framework_includes) myIncludePath
source_paths = $(foreach comp, $(all_components), $(comp)/src) $(framework_source) simulator

simulator/gcc/Makefile. Add your includepath to include_paths. It's relative to the application. You can also add source files to source_paths.

/Martin

View solution in original post

6 REPLIES 6
Martin KJELDSEN
Chief III
include_paths := $(library_includes) $(foreach comp, $(all_components), $(comp)/include) $(framework_includes) myIncludePath
source_paths = $(foreach comp, $(all_components), $(comp)/src) $(framework_source) simulator

simulator/gcc/Makefile. Add your includepath to include_paths. It's relative to the application. You can also add source files to source_paths.

/Martin

OK, thanks!

scottSD
Lead

@Martin KJELDSEN​ 

I notice with the latest version of TouchGFX (maybe it's always been that way), this is in the "generated" section and is written over when running a simulation.

I need to add these paths to have access to my message queue and freeRTOS.

I see that there is now an export in the non-generated TouchGFX\simulator\gcc\Makefile:

ADDITIONAL_SOURCES := 
ADDITIONAL_INCLUDE_PATHS := 
ADDITIONAL_LIBRARY_PATHS := 
ADDITIONAL_LIBRARIES :=
export ADDITIONAL_SOURCES ADDITIONAL_INCLUDE_PATHS ADDITIONAL_LIBRARY_PATHS ADDITIONAL_LIBRARIES

I understand why you went this way and I think its a good idea for portability. However, I am having issues adding multiple paths. When I add one path, it works:

project_path := $(call qs,$(abspath $(call sq,$(makefile_path)../../..)))
core_path := $(call qs,$(abspath $(call sq,$(project_path)/Core/Inc)))
freeRtos_path := $(call qs,$(abspath $(call sq,$(project_path)/Middlewares/Third_Party/FreeRTOS/Source/include)))
 
ADDITIONAL_SOURCES := 
ADDITIONAL_INCLUDE_PATHS := $(core_path)
ADDITIONAL_LIBRARIES :=
export ADDITIONAL_SOURCES ADDITIONAL_INCLUDE_PATHS ADDITIONAL_LIBRARY_PATHS ADDITIONAL_LIBRARIES

But adding another one does not:

project_path := $(call qs,$(abspath $(call sq,$(makefile_path)../../..)))
core_path := $(call qs,$(abspath $(call sq,$(project_path)/Core/Inc)))
freeRtos_path := $(call qs,$(abspath $(call sq,$(project_path)/Middlewares/Third_Party/FreeRTOS/Source/include)))
 
ADDITIONAL_SOURCES := 
ADDITIONAL_INCLUDE_PATHS := $(core_path) $(freeRtos_path)
ADDITIONAL_LIBRARIES :=
export ADDITIONAL_SOURCES ADDITIONAL_INCLUDE_PATHS ADDITIONAL_LIBRARY_PATHS ADDITIONAL_LIBRARIES

I am sure I have some syntax issue, but any help you could offer would be appreciated.

Did you ever get this to work? I am currently trying (and failing) to include `Core/Inc` for the simulator build but later on I would like to be able to link include more than one additional path. I am on 4.19.1 if that matters.

Sorry, I have not pursued this further. We are using our own hardware and I no longer use the Simulator.

Hopefully you'll get an answer to your question.

Sorry that this is presumably coming way too late for the folks in this thread, but the new format (at least for 4.24 for me) for adding include paths to your TouchGFX Makefile (i.e. if your simulator returns the dreaded "No such file or directory" when your code normally compiles for the actual processor), is as follows:

The paths are relative to the TouchGFX directory, and only require a space between values. For example, this will add most of the FreeRTOS middleware to your simulator's search path:

ADDITIONAL_INCLUDE_PATHS := ../Middlewares/Third_Party/FreeRTOS/Source/include ../Core/Inc

It would be helpful to have the option to have the Makefile read from the higher level project file, though not everyone is going to be using STM32CubeIDE as their development environment.