Getting Started with Microsoft Azure RTOS (aka ThreadX)

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.

Debugging with ThreadX in MCUXpresso IDE

Debugging with ThreadX in MCUXpresso IDE

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.

Debugging i.MX RT1064 Board with LPCLink2

Debugging i.MX RT1064 Board with LPCLink2

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:

Azure RTOS from mcuxpresso.nxp.com

Azure RTOS from mcuxpresso.nxp.com

The above web page only allows you to get FreeRTOS or ThreadX. Alternatively it can be downloaded directly from the IDE:

Azure RTOS SDK download with MCUXpresso IDE

Azure RTOS SDK download with MCUXpresso IDE

Here I can select both FreeRTOS and Azure RTOS if I want to use both.

Both FreeRTOS and Azure RTOS selected

Both FreeRTOS and Azure RTOS selected

With this I can import examples and use Azure RTOS (ThreadX):

Creating ThreadX Example

Creating ThreadX Example

After the usual build & debug, I’m running ThreadX on the board 🙂 :

Debugging with ThreadX in MCUXpresso IDE

Debugging with ThreadX in MCUXpresso IDE

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.

MIMXRT1064-EVK running ThreadX

MIMXRT1064-EVK running ThreadX

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

8 thoughts on “Getting Started with Microsoft Azure RTOS (aka ThreadX)

  1. 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).

    Like

    • 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.

      Like

    • 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?

      Like

  2. Pingback: RTOS Trace: TraceX with Microsoft Azure RTOS (aka ThreadX) | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.