cancel
Showing results for 
Search instead for 
Did you mean: 

FREERTOS OR THREADX : THIS IS THE PROBLEM

rdl
Associate III

Hi community,

 My question is : what is the best between FreeRTOS and ThreadX?What is more supported?

Thanks in advance for collaboration

11 REPLIES 11
MikaelM
ST Employee

Hello @rdl ,

I would say that the best one is the one you are mastering the better and fit you needs.

It depends also of the application you want to develop and beside services that exists for them.
Regarding the more supported, look at ST website STM32 series to know if both are supported for your device.

Best regards

Mikael

 

 

If you feel a post has answered your question, please click Accept as Solution.
Harvey White
Senior III

If you are to go by the introduction software, i.e. which OS is available for new products first, then the answer that ST presents is AZURE. 

However, it may not be that simple.

If you ever do C++ projects (and there are some applications which make much sense in C++), neither OS is perfect.  However, I have had more difficulties with AZURE unable to deal with elements part of a C++ class than FreeRTOS.

The two OS systems are not fully interchangeable, however.  Specifically, the queue system in FreeRTOS allows for unlimited (reasonably so), queue entries, while the queue system in AZURE is limited to 64 bytes(or 32 bit words, forget which).  AZURE wants to have queue entries passed by reference, which can make life difficult.  Larger entries need a separate mechanism to handle them, and you have to consider storage and for how long that storage will be valid.

I also had a lot of difficulty working with some AZURE members from inside a C++ class.

FreeRTOS doesn't like having task code owned by a class, therefore the FreeRTOS tasks have to have workarounds to access class variables.  They deal with classes well enough, but the task has to be a separate piece of C++ code and not in a class.

 

If you don't want to, or never will, use C++, then it's going to be easier. 

If all your queues can be short, then AZURE may work better. 

You can always bolt on FreeRTOS even if it's not directly supported, but that tends to be fussy. 

I tried taking an entire (large) project from FreeRTOS to AZURE, using #ifdef and rewriting code where needed.  It did not work well for me because of the items above.  AZURE has better graphics diagnostic tools included, although you could possibly buy or write something to do tracing and task monitoring.  That depends on whether or not you're working with a company ($$$) or not (no $$$). 

Another possibility might be embOS, which is available as a package for ST Micro chips.  I've looked at it, but not explored it thoroughly.  It may have the same problem with C++ and scope of class variables, but I don't know.

So which?  I'm back to FreeRTOS which matches my needs more closely.  I've learned to work around some limitations in FreeRTOS, where AZURE did not work well with my code.

Hope it helps.

rdl
Associate III

thanks Mikael I use stm32u575ziq now but in the future I will use STM32U5A5 

Regards

Thank you Harvey your answer was very comprehensive

Best Regards

Haithem Rahmani
ST Employee

Hi @rdl , @Harvey White , @MikaelM 

Thanks indeed for this interesting exchange. I confirm that we support both of RTOS on our STM32 ecosystem.

As mentioned above, the selection of the RTOS depends on your application use case, below links to apps running on the stm32U575:
FreeRTOS: https://github.com/STMicroelectronics/x-cube-freertos/tree/main/Projects/NUCLEO-U575ZI-Q/Applications
ThreadX: https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U575ZI-Q/Applications/ThreadX
Hope it helps you decide ;)

regards

haithem.

Part of the problem is that the user doesn't know if AZURE will support their designs, nor do they know if FreeRTOS will.  AZURE support is announced first, and for the U5 series, FreeRTOS took a good 6 months or so to be implemented, if I remember the dates right.

Yes, FreeRTOS and AZURE can be used to make projects, but are they sufficient to make *your* project?  Can't find out until you start coding.  Neither OS deals well with C++, as I mentioned above. 

Do you have any examples of AZURE or FreeRTOS used with C++?  If not, I think you're going to need them.

 

Hi Haithem Rahmani and thank you for your suggests. I've already tried some of those examples of both systems.

Regards

Hi Harvey,I use the C language and have tried several examples of both operating systems and at first impression I preferred to use FreeRTOS but my company has taken information and it would seem that ST fully supports THreadx so when they asked me what I preferred, I told them that as a beginner in embedded programming on these OSs I would probably have more or less the same difficulties and so I agreed to choose Threadx.

Best Regards

 

rdl
Associate III

Hi Haithem do you know if I can download an example of threadx from STM32CUBEMX or STM32CUBEIDE, change the name and begin my project from that?Or I have to pay some fee?

regards