cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX: Error using FreeRTOS Events

berkerdemoglu
Associate

Task Description:

I'm trying to update a text on the screen when a button is pressed. I want to achieve this using the event functionality in FreeRTOS.

The control flow is more or less like this:
Button pressed -> External Interrupt -> Callback function sets event flag -> Task waiting on the event flag 'wakes up', sends a message to the GUI using a message queue. -> Model::tick() polls queue and sees message -> Model updates its state, notifies Listener -> Listener notifies view to update the text -> View prints new text, invalidates text area to be redrawn

Problem
TouchGFX/build/STM32H7B3I_DISCO/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.o: In function `osEventFlagsNew':
d:\tum\tufast\learning\FSMDemoNew/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c:1135: undefined reference to `xEventGroupCreateStatic'
d:\tum\tufast\learning\FSMDemoNew/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c:1141: undefined reference to `xEventGroupCreate'
TouchGFX/build/STM32H7B3I_DISCO/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.o: In function `osEventFlagsWait':
d:\tum\tufast\learning\FSMDemoNew/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c:1249: undefined reference to `xEventGroupWaitBits'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [TouchGFX/build/bin/target.elf] Error 1
gcc/Makefile:346: recipe for target 'TouchGFX/build/bin/target.elf' failed
gcc/Makefile:342: recipe for target 'generate_assets' failed
make[1]: *** [generate_assets] Error 2
../gcc/Makefile:52: recipe for target 'all' failed
make: *** [all] Error 2
Failed

My problem is the code generation and the includes. First of all, I get another error in the Stm32CubeIDE which may be relevant: Invalid project path:
Invalid project path: Include path not found (D:\tum\tufast\learning\FSMDemo\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS). FSMDemo pathentry Path Entry Problem
This path actually does not exist, so no wonder I get an error notification. This may be a migration error (from CMSIS V1 to CMSIS V2).
When I CTRL-click on the functions in STM32CubeIDE, I find the definitions for xEvent...() functions. This means that they should be in the include path, but I don't understand why the compiler cannot find them.

Board and Version Info:
I have STM32H7B3I-DK and I generated a TouchGFX project for this board using TouchGFXDesigner 4.24.2 (latest one). The STM32CubeIDE version is 1.17.0 (latest one). Stm32CubeMX downloaded on my PC (I think it's irrelevant?) is version 6.12.1

Possible Solution?
I actually saw another post on the forum from a few days ago that also had this problem, but the solution suggested there does not apply to mine (different boards could be the reason I believe).

Thanks in advance!

2 REPLIES 2
GaetanGodart
ST Employee

Hello @berkerdemoglu and welcome to the community!

 

It seems that you are using a TBS (TouchGFX Board Setup) that we made so you should not have any issue with using FreeRTOS.

I invite you to have a look at this video to see how to implement a FreeRTOS task to trigger an action on the GUI.

Please keep me informed if you manage to achieve the expected result or if you still encounter errors.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hey Gaetan,

 

this hardware button click is for now a sample task. I wanted to be able to use FreeRTOS and the CMSIS to program using events, but the compiler/linker has problems with finding the function definitions. The function definitions are definitely there, as I can find them in STM32CubeIDE.

This is important because it's not just going to be about hardware button clicks, but using different kinds of data reading and notifications. For example, we will read data from the ADC or from CAN. We need to be able to access this interface the operating system gives us. I need to be able to use events, message queues, threads etc. in my programs.

I have watched the video you have recommended, and sadly it does not address my issue. The workaround the video proposes is flag setting, which can lead to issues if multiple threads need to access/read/modify the said flag.

I thank you for the interest in solving my problem, however, I would appreciate a more direct answer that addresses the issue I'm having a.k.a fixing the compiling errors being able to use full functionality of FreeRTOS. To give more details, it seems that event_groups.c or event_groups.h are not being included in the build. These functions are defined and declared there. I believe an approach to solve that problem may be more helpful.