cancel
Showing results for 
Search instead for 
Did you mean: 

How to include paths for FreeRTOS in TouchGFX Designer 4.16.x

AJach.1
Associate II

Windows 10, CubeIDE1.6.1, TouchGFX4.16.1,FreeRTOS

Trying to... (in Model.cpp)

#include "FreeRTOS.h"

#include "queue.h"

#include "task.h"

FreeRTOS.h: No such file or directory

the "TouchGFX/simulator/gcc/Makefile" is (I guess) probably where I need to add the

"Core/Inc" and "Middlewares/Third_Party/FreeRTOS/Source/include" paths

I tried in the Makefile adding:

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_INCLUDE_PATHS := $(core_path)

ADDITIONAL_INCLUDE_PATHS += $(freeRtos_path)

ADDITIONAL_SOURCES :=

ADDITIONAL_LIBRARY_PATHS :=

ADDITIONAL_LIBRARIES :=

export ADDITIONAL_SOURCES ADDITIONAL_INCLUDE_PATHS ADDITIONAL_LIBRARY_PATHS ADDITIONAL_LIBRARIES

but somehow I create more problems for myself where the compiler lost the orginal source path for the compile.

Compiling gui/src/model/Model.cpp

g++.exe: fatal error: no input files

There was some suggestions on the community forum 2 years ago but it was incomplete for the curent version of tool.

Anyone have a correct way to do this?

4 REPLIES 4
Romain DIELEMAN
ST Employee

Hi,

Are you working on a custom project or did you start from an application template available in TouchGFX Designer ? Most of the ATs for STMicroelectronic development boards use FreeRTOS so when you create a project the Makefile generated under the <project directory>/gcc should be a good source of inspiration on how to set the path.

/Romain

VLau
Associate III

Not sure if it's your issue, but in .cpp files, .h files are wrapped like this:

extern "C"
{
    #include "FreeRTOS.h"
}

Romain,

Hmm... Can you provide an example of how a hardware sensor from a task in main sends data up the GUI (with RTOS)? Maybe something like this but for RTOS: https://www.youtube.com/watch?v=4-fyx4e96jk

I am prototyping on an STM32H735 Discovery board with multiple I2C/UART sensors and have done a custom GUI screen interface working on the device, but want to try out the overall design with an RTOS implementation. I thought the general way to implement hardware sensors in RTOS was to generate a task per sensor in main with the polling functions inside the infinite loop (after being initialized), have the sensor polling function then dump the data to a queue. On the GUI side in Model.cpp, pop off the queue data, assign that to model listener and proceed with the rest. --Maybe I shouldn't even bother with a queue and just send the data over with a function to the GUI?

I guess a hardware sensor example in RTOS for the GUI would help.

maplestream
Associate II

Hi.

The build environment of TouchGFX Designer's 'Run Simulator' and 'Run Target' are different.
The condition you want to use Queue is the 'Run Target' condition that gets data from main.c.
So use preprocessor like below to add relevant header files only in 'Run Target'.

 

#ifndef SIMULATOR
    #include "FreeRTOS.h"
    #include "queue.h"
    #include "task.h"
#endif

 

Looking forward to good results.