Skip to main content
zaric
Associate II
September 10, 2020
Question

How to run touchGFX without RTOS?

  • September 10, 2020
  • 14 replies
  • 5544 views

​I would like to apply the touchGFX without RTOS .

RTOS is a quite complex way,and the products our company ever made never apply it.

That means we need a fast and simple way to use touchGFX,taking time on RTOS is not the first choice.

I also read the section <no RTOS> at https://support.touchgfx.com/docs/basic-concepts/operating-system,but useless.

This topic has been closed for replies.

14 replies

Alexandre RENOUX
Visitor II
September 10, 2020

Hello,

The only two things you should need to do is unselect FreeRTOS in CubeMX (and regenerate code) and call MX_TouchGFX_Process() in your while(1) loop in your main() function.

int main(void)
{
 /* USER CODE BEGIN 1 */
 
 /* USER CODE END 1 */
 
 /* MCU Configuration--------------------------------------------------------*/
 
 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();
 
 /* USER CODE BEGIN Init */
 
 /* USER CODE END Init */
 
 /* Configure the system clock */
 SystemClock_Config();
 
 /* USER CODE BEGIN SysInit */
 
 /* USER CODE END SysInit */
 
 /* Initialize all configured peripherals */
 // Peripherals Init functions
// ...
 MX_TouchGFX_Init();
 /* USER CODE BEGIN 2 */
 
 /* USER CODE END 2 */
 
 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 
 MX_TouchGFX_Process();
 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */
}

/Alexandre

zaric
zaricAuthor
Associate II
September 11, 2020

thanks for your answer.

And following it,I download an example for touchGFX designer, copy out the .ioc inside the project,

then unselect the freeRTOS and generate another code in cubeMX.

A question came out,as the pictures shown .

Hoping for your further advice.0693W000003RMPxQAO.png0693W000003RMPsQAO.png

Alexandre RENOUX
Visitor II
September 11, 2020

Hello,

You can delete the IdleTaskHook() function. This is used only when using FreeRTOS to know approximately the load (in percentage) of the MCU in real-time.

Therefore, you can also remove everything regarding MCUInstrumentation in TouchGFXHAL.cpp as well (usually at the beginning of the file).

For the GFXMMU issue, I need more info. What board are you using ? Do you have a round display ? What is written exactly for this error ?

/Alexandre

zaric
zaricAuthor
Associate II
September 14, 2020

now,seems that the GFXMMU not a issue.

​

Using stm32H750B-DK

​

there is a new problem: run the app in borad , I got a white blank screen. then I use the beyong compare to compare code of demo and my app, no differences in initialization\configuration.

CStir.1
Associate II
February 1, 2021

Hello, I have the same problem on stm32f429i-disco1. I started from scratch, I used cubeMX, I selected the board, I initialized with the default parameters, I delete the freeRTOS Middleware, after that I added TouchGFX and I use it with LTDC and ChromArt. After I configure my gui in TouchGFX designer, I generate the code, open it in STM32CubeIDE. I compile it and run it, but all I get is a blank screen. Any ideas?

Claoo

hwsw
Associate II
August 8, 2021

Hello, I was able to get touchgfx to work without an RTOS on the 32F429IDISCOVERY. I did it using the "TouchGFX Demo 3", the one with the bubbles. After removing the RTOS code the screen was coming up blank, but all the signals to the LCD (clk, vsync, hsync, de, pixel data) looked to be correct and should have been displaying something.

I noticed that in main.c, in MX_LTDC_Init() there was a call to "LcdDrv->DisplayOff();", but I didn't see any calls to "LcdDrv->DisplayOn();" in the project. So I added a call to it.

That code in MX_LTDC_Init() use to be just:

LcdDrv->DisplayOff();

And I changed it to:

LcdDrv->DisplayOff();

LcdDrv->DisplayOn();

The project then worked without an RTOS.

It appears that LCD needs some initialization and enabling through other pins. If you are starting from scratch, you may not have any of that code in your project. Try creating a project for the 32F429IDISCOVERY using touchgfx and look at the code in main.c in function MX_LTDC_Init().

JHeyd.1
Associate
March 8, 2021

Hello,

I have exactly the same problem on stm32f469i-disco. I created my gui with the help of the TouchGFX designer with the corresponding template for my discovery board. I'm using STMCubeIDE to compile and run the board. So everything is displayed fine while FreeRTOS is enabled. Then I used Cube MX to manipulate the corresponding *ioc file: I deactivated FreeRTOS by using the Interface "disabled" instead of "CMSIS_V2" and generated the code. I also generated the code inside the Designer and then I tried to compile with STM32CudeIDE. I had to remove the source (freertos.c) from the project and manipulate TouchGFXHAL.cpp (comment out "include "FreeRTOS.h" and "task.h" and functipon " portBASE_TYPE IdleTaskHook(void* p)"). Then it compiled successfully. When I downloaded my app then I get a blank screen.

So my questions are

1.How can I check that I receive correctly the tearing effect interrupt?

2.How can I check that I'm flushing the framebuffer correctly?

3.How can I check that it rendering the frame at all?

4. Do I have to add the line " touchgfx::HAL::getInstance()->taskEntry();" to my mainloop or is it already autogenerated by CubeMX-Generator through adding the line " MX_TouchGFX_Process();" I wonder a little bit because I thought when calling that function it should never return according to description but " MX_TouchGFX_Process();" seems to return?

5.Are there any other tips to get the code running without using RTOS

Jürgen

hwsw
Associate II
August 8, 2021

Hello, I got this to work, look at my response above.

JHeyd.1
Associate
January 27, 2022

No unfortunately not. I tried several things but it doesn't work reasonable.

Krautermann
Senior
April 27, 2023

Providing this info in case someone needs it:

A documentation is now available for using TouchGFX without RTOS:

https://support.touchgfx.com/4.17/docs/development/scenarios/running-without-rtos

Also the freeRTOS.c and CMSIS folder need to be deleted if they are in the project, then you can freely build it without errors.