cancel
Showing results for 
Search instead for 
Did you mean: 

From CubeIDE, Project TouchGFX without FreeRTOS?

JDant.1
Associate

Starting from a CubeIDE project and adding TouchGFX, is it possible to integrate TouchGFX without FreeRTOS?

Note: I am using STM32F746-DISCO

7 REPLIES 7
Karan 123
Senior

Hi,

Yes, It's possible

1) Depends on your Project Complexity .

2) And So Obviously Not A good idea.

Please find below Thread for FreeRTOS Integration..

https://community.st.com/s/question/0D53W000005oui4SAA/touchgfx-freertos-queues-for-controlling-led-from-touchgfx-button-and-hardware-button-to-touchgfx-text-area-update

For STM32F746-DISCO

https://community.st.com/s/question/0D50X0000AU4zodSQB/interfacing-with-hardware-in-touchgfx-applications

STM32F769-DISCO

Hope this helps..

--

Karan

Martin KJELDSEN
Chief III

Hi @JDant.1​,

Simply choose "No OS" when selecting an operating system in TouchGFX Generator, and be sure to not enable FreeRTOS in CubeMX view of course.

0693W000000Wk9XQAS.png

And read this for tips on working with TouchGFX and no RTOS: https://support.touchgfx.com/docs/basic-concepts/operating-system

/Martin

Jagdish Bisawa
Associate III

Hi @JDant.1​ ,

Yes, you can use TouchGFX without FreeRTOS. But be aware of the restrictions that you will face.

The TouchGFX "superloop" never returns after the TouchGFX process task is called from your main function. The only place where you will get a chance to execute your code is in the Model::tick(0 function, which is called at the about 60 Hz typically. Of course you will also get to execute your ISRs. Note that any code after the TouchGFX process task is called is "not reachable".

Using an RTOS approach enables you to develop modular & maintainable code that can be easily scaled as well.

/Jagdish

Martin KJELDSEN
Chief III

The TouchGFX Engine main loop still uses the OSWrapper to "wait" for a sync signal from display or controller. That's when you can do some work, while you wait for the next signal. You can do more work, more effeciently if you have an RTOS scheduler.

/Martin

JDant.1
Associate

Thank you very much for your answers. It worked without RTOS correctly!

Considering your recommendations, can I use FreeRTOS for the "real world" ?, for industrial projects with a long life. I would like your comments. Thank you.

Sure! FreeRTOS/CMSIS OS is used by many amazing products - FreeRTOS is probably scheduling tasks on applications you own now 🙂

/Martin

AWrig
Associate

I have the same problem, trying to use TouchGFX with no RTOS on a STM32F429-DISCO board. I created a project called MyApplication in TouchGFX Designer 4.15.0 by selecting the board and a blank screen app, which used FreeRTOS. I couldn't find any examples that used no RTOS. I added a single button. The project simulated and ran OK in TouchGFX Designer.

When I opened the project in STM32CubeIDE, It has a strange structure, with what looks like a subproject called STM32F429I-DISCO on the folder list. The .ioc file following this is called STM32F429I-DISCO.ioc. When I try to open this file, the IDE tells me that it is not the application's active .ioc file, and that I should be using MyApplication.ioc, but there is no such file.

Then I opened the STM32F429I-DISCO.ioc file in standalone CubeMX, removed FreeRTOS support, defined a few GPIO's with an interrupt on one of them, and generated the code. When I reopened the project in CubeIDE, the changes were there. Then I followed the advice in the the TouchGFX online documentation where it says that when you don't use an RTOS, you must launch the graphics engine by calling "touchgfx::HAL::getInstance()->taskEntry();" in main.c. I tried this but the compiler failed with the error:

C:/TouchGFXProjects/MyApplication/Core/Src/main.c:183:12: error: expected expression before ':' token.

I found some places in the STM32F429I-DISCO subproject where this call is being used, and It looks like getInstance() may be in a header file called HAL.hpp that is included with:

#include <touchgfx/hal/HAL.hpp>

but I can't find this file anywhere in the project.

I could just leave FreeRTOS in the project and write the rest of my program around it since it is mostly interrupt-driven. To see if I could handle interrupts outside of FreeRTOS, I added a callback for the GPIO interrupt, but when I triggered it the program jumped into an infinite loop in the startup code that is designed to catch unhandled interrupts, so it looks like FreeRTOS is somehow messing up the callback.

Any help would be appreciated. Thanks in advance, Allan.