Skip to main content
Graduate
October 5, 2023
Question

FREERTOS OR THREADX : THIS IS THE PROBLEM

  • October 5, 2023
  • 3 replies
  • 14157 views

Hi community,

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

Thanks in advance for collaboration

    This topic has been closed for replies.

    3 replies

    ST Employee
    October 5, 2023

    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

     

     

    rdlAuthor
    Graduate
    October 5, 2023

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

    Regards

    Graduate
    October 5, 2023

    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.

    rdlAuthor
    Graduate
    October 5, 2023

    Thank you Harvey your answer was very comprehensive

    Best Regards

    ST Employee
    October 25, 2023

    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.

    Graduate
    October 25, 2023

    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.

     

    rdlAuthor
    Graduate
    October 26, 2023

    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