2022-04-11 06:18 AM
I would like to use queues without sacrificing the simulator.
I know how to use queues with the extern keyword, but it disables the simulator because TouchGFX doesn't see header and source files. I have edited the Makefile to include the headers, but I am left with two issues.
First issue is including reent.h:
If I don't include the FreeRTOS.h I get this error:
This is what I modified in the Makefile thus far:
project_path := $(call qs,$(abspath $(call sq,$(makefile_path)../../..)))
ADDITIONAL_SOURCES :=
ADDITIONAL_INCLUDE_PATHS := $(project_path)/Core/Inc \
$(project_path)/STM32CubeIDE/Application/User \
$(project_path)/Middlewares/Third_Party/FreeRTOS/Source/include \
$(project_path)/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F \
$(project_path)/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 \
ADDITIONAL_LIBRARY_PATHS :=
ADDITIONAL_LIBRARIES :=
Also including the cmsis_os2.c file which contains the definitions for the structures and functions I'm using in the ADDITIONAL_SOURCES didn't help.
So, to put it shortly, is there a way to use queues inside TouchGFX in order to not disable the simulator? The code works if compiled from CubeIDE, but compiling from TouchGFX doesn't work. If possible, I would like to enable all FreeRTOS functionality inside TouchGFX to not have another issues later.
Edit:
This is lazy but since I already made this thread I might aswell ask it.
Since I don't need FreeRTOS in simulator, I only need the queues to send some data to other tasks and I want the simulator to just easily debug the GUI, is there some TouchGFX #define I can use to exclude the FreeRTOS code from compilation when compiling from TouchGFX, but include it when compiling from CubeIDE?
Solved! Go to Solution.
2022-04-12 04:50 AM
To answer your lazy question, there's an automatically defined SIMULATOR symbol that you can use to control what is included in CubeIDE but not simulator code (#iifndef SIMULATOR). I use it to include hardware-related code when not in the simulator and have fake data when simulating.
2022-04-12 04:50 AM
To answer your lazy question, there's an automatically defined SIMULATOR symbol that you can use to control what is included in CubeIDE but not simulator code (#iifndef SIMULATOR). I use it to include hardware-related code when not in the simulator and have fake data when simulating.
2022-04-12 02:30 PM
This basically solves the issue, thank you.