If you are a regular reader of my articles, you probably know that I’m using FreeRTOS in most of my applications, for obvious reasons. But clearly this is not the only RTOS out there. After Microsoft had acquired Express Logic back in April 2019 things kept quite for a while. To me the crown jewel of Express Logic is the ThreadX RTOS. But recently Microsoft is pushing more and more the ‘Azure Sphere’ and trying to monetize the ‘IoT’ (I apologize for mentioning that overused acronym) application space and providing it now free for devices from selected partners which includes NXP now.
Outline
One thing Microsoft did in the past months is a rebranding from ‘ThreadX’ to ‘Azure RTOS’, but I still prefer to use ThreadX because using that name you will find much more material on the internet too. And I think that name will be continued to be used for a long time too, despite marketing re-naming. What can make ThreadX attractive for commercial products is its safety certification and usage in military and space projects. The other thing to mention is that Express Logic had a full ecosystem around the RTOS with communication stacks, file system and GUI library. For this article I will focus on the RTOS.
According to NXP it is currently supported for the i.MX RT1050 and i.MX RT1060. In this article I will use ThreadX with the i.MX RT1064 EVK board.
Microsoft does have a tutorial for this board here: https://github.com/azure-rtos/getting-started/tree/master/NXP/MIMXRT1060-EVK. I have found following that tutorial very challenging. As well it drives you immediately into the ‘Azure’ world requiring you to setup a Microsoft account, providing your credit card information and signing up for ‘free for the first 30 days’ services. I understand that Microsoft wants to make money, but too me this was a bit too much of a lock-in?
Instead I go here with the NXP MCUXpresso IDE V11.2.1 and SDK which only requires you to have a free account on nxp.com which you anyway should have if using any NXP products. Alternatively the source code of ThreadX is available on GitHub: https://github.com/azure-rtos/threadx/releases
Installation
The SDK with the Azure RTOS can be configured and downloaded from https://mcuxpresso.nxp.com:
The above web page only allows you to get FreeRTOS or ThreadX. Alternatively it can be downloaded directly from the IDE:
Here I can select both FreeRTOS and Azure RTOS if I want to use both.
With this I can import examples and use Azure RTOS (ThreadX):
After the usual build & debug, I’m running ThreadX on the board 🙂 :
There is currently does not have any dedicated ThreadX support. E.g. Segger does not have a ThreadX GDB awareness (maybe it will be coming soon), or any of the other cool FreeRTOS related views in the IDE. But I think this is only a matter of time.
Summary
It is now very easy to get up and running with ThreadX on the i.MX RT platform. I think there will be more targets supported very soon with new SDK releases. The NXP SDK integration saves a lot of work and works out of the box. Best of all: it don’t have to go through all the Microsoft registrations and extra tool installations including providing credit card information: all what I need to use the RTOS or middle-ware is to get the SDK, import it into the IDE and I’m up and running without the fear that my credit card gets charged. Of course if I want to use the Microsoft cloud services I have to turn back to Microsoft.
If ThreadX (or Microsoft Azure) is the right thing depends on many factors. To me ThreadX is more targeted to the higher end of processors while FreeRTOS is much more concise to me. If you want to get up to the cloud space: For FreeRTOS there is the Amazon cloud and for ThreadX the Azure one. Which one depends on your needs and how much data (and money) you have. From the licensing terms I still favor FreeRTOS with the permissible MIT license. And Amazon makes it easier to use the FreeRTOS RTOS without all the extra cloud stuff. But if your application needs certification or any of the otherwise cool ThreadX features, then ThreadX might be your choice.
I’m sure Microsoft with its resources and excellence with software development tools and software will drive Azure RTOS even more. At the end: it is great to have a choice!
Happy Azuring 🙂
Links
- Microsoft acquires Express Logic: https://blogs.microsoft.com/blog/2019/04/18/microsoft-acquires-express-logic-accelerating-iot-development-for-billions-of-devices-at-scale/
- MCUXpresso SDK now includes Azure RTOS support for i.MX RT105x/6x MCUs: https://community.nxp.com/t5/MCUXpresso-Community-Articles/MCUXpresso-SDK-now-includes-Azure-RTOS-support-for-i-MX-RT105x/ba-p/1178357
- NXP Azure RTOS: https://www.nxp.com/design/software/embedded-software/azure-rtos-for-nxp-microcontrollers:AZURE-RTOS
- Microsoft RT1064 tutorial: https://github.com/azure-rtos/getting-started/tree/master/NXP/MIMXRT1060-EVK
- NXP SDK Download site: https://mcuxpresso.nxp.com
- MCUXpresso IDE: MCUXpresso IDE V11.2.1
- Microsoft ThreadX GitHub releases: https://github.com/azure-rtos/threadx/releases
I’ve got ThreadX running in several products on a Renesas part and I like it well enough. The run time diagnostic tools for it aren’t all that great but one of the two trace debugging majors (Segger?) has a ThreadX port out. The best thing about that ecosystem is GUIX which allows you to build pretty nice GUI systems very easily (multi-lingual ones at that!). Segger has it’s stuff which I think you can use on NXP parts for free that are a reasonable alternative.
The libraries you can get with ThreadX are good but there is some discussion on the Renesas forum about extra licensing from MS on at least the file system bits (NRE + piece).
LikeLike
Hi Randy,
thanks, useful insights! I’m in the process or getting TraceX up and running. I agree that the Express Logic trace feature is not up to par with others in the market. I would love to see SEGGER having a GDB thread awareness, but it seems they only support FreeRTOS and their own embOS. You probably mean Percepio (https://percepio.com/tz/threadx/) and not Segger (Tracealyzer): Yes, I saw the Percepio port and if time permits I’ll have a look after I have TraceX running.
LikeLike
About the point on MS wanting extra licensing: that would be bad news, and things like that always have been my biggest fear using proprietary and not true open source libraries. My other fear is that with all the big companies buying all the smaller middle-ware companies this could be even worse in the future. It looks I should look at options like Zephyr again?
LikeLike
The extra licensing piece is for exFAT only … the other FAT options dont have that requirement.
Hope that helps!
Regards,
Brendon
LikeLike
Yes, it does! Thanks Brendon!
LikeLike
Great, Erich
is there a plug-in to support performance profiling when use threadx and/or netx duo?
LikeLike
Hi neo,
are you thinking about something like gprof? I do have that running for FreeRTOS or bare metal with MCUXpresso IDE (or Eclipse in general), see https://mcuoneclipse.com/2015/08/23/tutorial-using-gnu-profiling-gprof-with-arm-cortex-m/
That should run with ThreadX too (did not try it yet). I have not used NetX yet. Other than that there is TraceX (I’m looking at it right now) and Percepio Tracealyzer for ThreadX (just asked and received a 10 day evaluation license).
LikeLike
Pingback: RTOS Trace: TraceX with Microsoft Azure RTOS (aka ThreadX) | MCU on Eclipse
Hi, Erich,
Nice article. Do you know if Azure RTOS is compatible with Tiva C? I am taking an embedded systems class and I need to do a small demo with it. Any suggestion to a GitHub link would be appreciated.
Thank you.
LikeLike
Hi David,
I have not used it with Tiva-C, but according to https://docs.microsoft.com/en-us/azure/rtos/guix/overview-guix it is supported.
LikeLike