cancel
Showing results for 
Search instead for 
Did you mean: 

Compile error for TouchGFX project with No RTOS

WolfpackEE
Associate II

I have a STM32H750B-DK board that I'm trying to build a TouchGFX project on bare metal ( No OS). I've gone through the steps as indicated on this page

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

When I compile I get errors in the 

HardwareMJPEGDecoder.cpp

Such as

C:/Projects/artemis-r-and-d/NoOSTest/TouchGFX/target/generated/HardwareMJPEGDecoder.cpp:114:5: error: 'semDecodingDone' was not declared in this scope
114 | semDecodingDone = SEM_CREATE();
| ^~~~~~~~~~~~~~~
C:/Projects/artemis-r-and-d/NoOSTest/TouchGFX/target/generated/HardwareMJPEGDecoder.cpp:114:23: error: 'SEM_CREATE' was not declared in this scope
114 | semDecodingDone = SEM_CREATE();
| ^~~~~~~~~~
C:/Projects/artemis-r-and-d/NoOSTest/TouchGFX/target/generated/HardwareMJPEGDecoder.cpp: In member function 'void HardwareMJPEGDecoder::decodeMJPEGFrame(const uint8_t*, uint32_t, uint8_t*, uint16_t, uint16_t, uint32_t)':
C:/Projects/artemis-r-and-d/NoOSTest/TouchGFX/target/generated/HardwareMJPEGDecoder.cpp:438:26: error: 'semDecodingDone' was not declared in this scope
438 | SEM_WAIT(semDecodingDone);

 

It looks like the #defines for those statements is looking for FreeRTOS. How do I get around this?

 

 

5 REPLIES 5
JohanAstrup
ST Employee

Hello @WolfpackEE .

Which video strategy are you using?
As stated here, if you use a dedicated video buffer, a CMSIS compliant OS is required.

However, even if you use "Direct to Framebuffer", a semaphore is used to check when the hardware MJPEG decoder has finished decoding. It is not strictly necessary to use a semaphore for this, so you could manually edit HardwareMJPEGDecoder.cpp and implement a manual check instead. Please note, however, that this is not a tested scenario.

Are there any specific requirements in your project for running without an OS while still supporting video decoding? The easiest solution would certainly be to disable video decoding if it is not required.

Best regards,
Johan

WolfpackEE
Associate II

I've gone through these steps to disable video decoding (the project doesn't need video, not static jpeg display support)

 

Steps to remove hardware mjpeg decoding 

 

I've regenerated the code in MX and TouchGFX. The TouchGFX compilation now gives errors as project file is still looking for hardwaremjpegdecoder.cpp.

In file included from TouchGFX/target/generated/HardwareMJPEGDecoder.cpp:19:0:
TouchGFX/target/generated/HardwareMJPEGDecoder.hpp:21:10: fatal error: MJPEGDecoder.hpp: No such file or directory
#include <MJPEGDecoder.hpp>
^~~~~~~~~~~~~~~~~~

 

JohanAstrup
ST Employee

I can't see the result of the AI response you have linked to, but you should follow the process below when disabling video:

1. Disable Video Decoding in X-CUBE-TOUCHGFX within STM32CubeMX:

JohanAstrup_0-1745301777395.png

2. Delete the TouchGFX/target/generated folder to ensure that the generated files by TouchGFX Generator, which do not contain user code, are removed.

3. Generate code in STM32CubeMX.

4. Compile the project.

Please let me know if you still experience compile errors after following the steps above.


Best regards,
Johan

I appreciate your help. I deleted the generated folder and regenerated the code in CubeMX

I've also been using this article to step through getting a project up and running

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

After deleted the freertos folder in core/src, I now get a compile error in /TouchGFX/target/TouchGFXHAL.cpp as it's looking for freertos.h. Just removing that #include statement doesn't help because the code in that file is looking statements in freertos.h

So if there a way to generate TouchGFXHAL.cpp that is not looking for freeRTOS?

JohanAstrup
ST Employee

If you are using the TBS from TouchGFX Designer, you need to remove the 'portBASE_TYPE IdleTaskHook(void* p)' function from TouchGFXHAL, as it is a FreeRTOS function used to calculate MCU load.

All the FreeRTOS code in TouchGFXHAL is user code inserted after generation. Therefore, you can generate a new TouchGFXHAL.cpp by deleting the current one and regenerating code in STM32CubeMX.

Please note that the display, data, and backlight enable pins are currently set in TouchGFXHAL::taskEntry(). This setup will need to be relocated, but since you have followed the steps from the article, I assume you have already made these modifications.


Best regards,
Johan