Introduction to Azure RTOS with STM32

Revision as of 19:36, 24 February 2021 by Registered User
Under construction.png Coming soon

1. What is STM32CoreMW ?

ST offers a complete, proven, and reliable MCU software solution for developers. It covers low layers, middleware, and applicative sides, as well as configuration, programming, monitoring and debugging tools.


Core Middleware Components

The basic Middleware stacks that are commonly needed for applications are: RTOS, File System, USB, TCP/IP, Bootloader, JPEG and TLS. ST offers a comprehensive set of stacks and applications covering these topics. This set of Middleware stacks is called STM32 Core Middleware (STM32CoreMW for short).

STM32CoreMW solution is constructed around Microsoft Azure RTOS Middleware and other in-house (ST USB, OpenBL) and open source stacks (FreeRTOS, FatFS, LwIP, mbedTLS, LibJPEG). All integrated and customized for STM32 MCU devices and enriched with corresponding application examples based on STM32 evaluation boards.

THREADX overviewUSBX overviewFILEX overviewNETXDUO overviewLEVELX overviewCore Middleware Components
About this image

ST USB, FreeRTOS, FatFS and LwIP are known as Legacy CoreMW.

2. Azure RTOS

Azure RTOS is a professional grade, highly reliable and market proven Middleware suite:

  • Integrated and full featured RTOS. Learn more about ThreadX.
  • Industrial grade networking stack: optimized for performance coming with many IoT protocols. Learn more about NetXDuo.
  • Advanced FS/FTL: fully featured to support NAND/NOR Flash memories. Learn more about FileX and LevelX
  • USB Host and Device stacks coming with many classes. Learn more about USBX.
  • Safety pre-certifications (from MSFT): IEC 61508 SIL4, IEC 62304 Class C and ISO 26262 ASIL D
  • Security pre-certifications (from MSFT): EAL4+ for TLS/DTLS, FIPS 140-2 for SW crypto lib
  • STM32 granted production license

With Azure RTOS complementing the extensive STM32Cube ecosystem providing free development tools, software bricks, and software expansion packages, STM32 users can also leverage the rich services of Azure RTOS, which meet the needs of tiny, smart, connected devices.

2.1. Azure RTOS Integration in STM32Cube Ecosystem

For currently public STM32 series (introduced up to 2020), Azure RTOS integration will be done as an STM32Cube expansion software package enhanced for STM32 Toolset (ex. X-CUBE-AZRTOS-H7, for STM32H7 Series). The expansion is built on STM32Cube software technology to ease portability across different STM32 microcontrollers and to allow the user to benefit from STM32CubeMX or STM32CubeIDE software tools native features alongside the Azure RTOS applications. New STM32 series introduced starting from 2021 will benefit from a direct integration of Azure RTOS embedded software components within the matching STM32Cube MCU package. For instance, for STM32U5 Series the matching STM32Cube MCU package named STM32CubeU5 will feature Azure RTOS directly STM32CubeU5 will feature Azure RTOS directly. Once integrated within STM32Cube, whatever in STM32Cube Expansion or MCU package, Azure RTOS will benefit from many additions done by ST:

  • Ability to use Azure RTOS middleware with some level of configurability directly within STM32CubeMX
  • Addition of many examples for standard evaluation boards from ST: STM32Nucleo, Discovery Kit and Eval boards. Thus, reducing the learning curve and ensuring a smooth application development experience with Azure RTOS and STM32 MCUs.
  • Addition of material helping with migration effort
  • Addition of training material
AzureRTOSOverview1.png


ThreadX is required to implement FileX, LevelX, NetXDuo or USBX, a “bare-metal” implementation is planned in the future for USBX and FileX.

Azure RTOS MW stacks are also interdependent. In fact, some USBX Host classes are using the FileX APIs, while other USBX device classes require the NetX Duo APIs. LevelX is used by FileX to support file system on NAND and NOR memories.

Azure RTOS Interdependencies


The Azure RTOS APIs are HW agnostic, they run seamlessly on all supported HW and IPs. Each MW has its own low-level driver to support a specific HW IPs. These drivers are implemented using the HAL and BSP drivers to ensure portability among different STM32 Series and boards.

Azure RTOS Interactions


As all STM32Cube software packages, BSP configuration in STM32CubeMX is not supported for STM32 Azure RTOS.


2.2. Azure RTOS License

Azure RTOS is distributed by Microsoft under their own GitHub (https://github.com/azure-rtos). ST will include Azure RTOS in some STM32Cube software packages. Whether delivered by Microsoft under GitHub, or by ST through STM32Cube packages on st.com or GitHub, proprietary license terms will be the same between Microsoft and User:

  • Source code is available
  • User is granted modification
  • User is granted redistribution of source (modified or not) and/or binary, provided he develops on an MCU/MPU that is listed officially by Microsoft
  • User is granted production, provided he develops on an MCU that is listed officially by Microsoft
  • User is forbidden to reuse provided software to create a competing offer


2.3. Where to get Azure RTOS ?

Azure RTOS for STM32 is distributed by ST on different channels to adapt to the different needs and profiles of STM32 customers. The figure below shows the different ways to start with X-CUBE-AZRTOS-H7 (STM32H7 used as example for illustration).

Where to get it overview.png



2.3.1. Start from www.st.com

This is the standard way to get the package: user downloads a self-contained package containing the STM32 drivers, Azure RTOS MW & STM32CubeMX configuration files and ready to use applications. Different usage approaches are possible:

  • User can start directly from the provided applications, open the IDE of his choice, build and debug the code.
  • Open the ioc file with STM32CubeMX, modify the STM32 peripherals and/or Azure RTOS MW configuration and generate the code.
  • User can also install the package manually in STM32CubeMX or STM32CubeIDE. The usage is then the same as described in next section.
2.3.2. Start from STM32CubeMX or STM32CubeIDE

Azure RTOS is delivered as an STM32Cube expansion software package enhanced for STM32 Toolset, to allow users benefit from STM32CubeMX or STM32CubeIDE software tools native features alongside the Azure RTOS applications.

  • There is one package per currently public STM32 Series (delivered as X-CUBE-AZRTOS-XX package, “XX” refer to the supported STM32 Series)
  • Each package contains all the supported MW stacks and all required resources (HAL, BSP, Utilities, ...)
  • Azure RTOS MW stacks are described as CMSIS pack components to facilitate their usage and to manage interdependencies between them.
  • Azure RTOS MW are configurable through STM32CubeMx interface and initialization code can be generated.
  • Each package provides a set of full functional applications described by PDSC file
Pack Install STM32CubeMX



Once the package is installed in STM32CubeMX/STM32CubeIDE, it can typically be found on this location: "C:\Users\"UserName"\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AZRTOS-XX" A package for a specific Series is not visible or usable on other series. Each package has its own version, that is not correlated with Azure RTOS MW versions. Two different Azure RTOS packages, for different series, may contain different Azure RTOS MW versions.

Once the package is installed, user can have two possibilities to use Azure RTOS

  • Browse the Azure RTOS applications provided within the installed Pack, then start from the application of his choice
  • Select Azure RTOS MW, configure them then generate the initialization code


2.3.3. Start from GitHub

STM32 Azure RTOS publication on ST GitHub repository targets STM32 community user, to get a configuration management-based delivery (Git) and have engineer to engineer technical communication, thanks to the Issues features. Package in GitHub repository does not contain Azure RTOS STM32CubeMX configuration files, thus Azure RTOS MW configuration and code generation in STM32CubeMX/STM32CubeIDE are not available.

Depending on the STM32 Series used:

  • For currently public STM32 series (introduced up to 2020), you can find the link to the matching X-CUBE-AZRTOS-XX within this section.
  • For new STM32 series introduced starting from 2021, you can find the link to the matching STM32CubeXX repository within this section .

2.4. How to use Azure RTOS package

A training video will be available on www.st.com that shows in details how to setup and use the Azure RTOS STM32Cube packages. Link


2.5. Azure RTOS Applications

Multiple functional applications are provided in STM32Cube package for Azure RTOS stacks. Please visit the page dedicated for each Azure RTOS stack for more details about available applications.

3. STM32 Legacy CoreMW

Along with the Azure RTOS Middleware solution, STM32 support other CoreMW stacks based on ST development:

and Third Parties open source development:

  • FreeRTOS (Wiki page link will be available soon)
  • FatFS (Wiki page link will be available soon)
  • LwIP (Wiki page link will be available soon)
  • LibJPEG (Wiki page link will be available soon)
  • OpenAMP (Wiki page link will be available soon)
  • embTLS (Wiki page link will be available soon)

These stacks are provided in the STM32Cube packages (except when delivered natively with Azure RTOS Middleware) and in ST GitHub repository. For each stack, multiple combinations of examples and demos are provided in order to help building your own application. Besides, USB, FreeRTOS, FatFS and LwIP stacks are supported by STM32CubeMX code generation and customization.

For each leagacy Middleware , please refer to the relative ST Wiki page to get more information.

3.1. License

Component License Copyright
ST USB Device SLA0044 STMicroelectronics
ST USB Host SLA0044 STMicroelectronics
OpenBL SLA0044 STMicroelectronics
FreeRTOS MIT FreeRTOS - STMicroelectronics
FatFS BSD-3-Clause FatFS - STMicroelectronics
LwIP BSD-3-Clause Savannah - STMicroelectronics
LibJPEG Independent JPEG Group License Independent JPEG Group - STMicroelectronics
mbedTLS Apache License 2.0 ARM Limited - STMicroelectronics
OpenAMP BSD-3-Clause OpenAMP - STMicroelectronics

4. FAQ

  • Q: What are the STM32 Series covered by Azure RTOS Middleware ?
  • A: All new Series that are released in 2021 and later are covered by default by Azure RTOS Middleware within the matching STM32Cube MCU packages. Other STM32 Series (H7, F4, F7, G4, L4, G4, G0, WB and WL) are covered through STM32Cube expansion packages. Older STM32 Series will not be updated with Azure RTOS support.


  • Q: Will I be able to use Azure RTOS for my commercial applications for free?
  • A:Yes, in compliance with the corresponding license terms.


  • Q: Will I be able to make modifications to Azure RTOS to tailor my STM32 application to my needs or fix bugs myself?
  • A: Yes, in compliance with the corresponding license terms.


  • Q: Is there any difference between getting the Azure RTOS for STM32 from www.st.com, from STM32CubeMX/STM32CubeIDE or from STMicroelectronics GitHub ?
  • A: The only difference is that packages on GitHub does not contain STM32CubeMX configuration files, and thus it’s not possible to use this package to configure Azure RTOS Middleware components and generate code using STM32CubeMX.


  • Q: What will happen to the current STM32Cube middleware offer, such as FreeRTOS or ST USB library?
  • A: For currently public STM32 series (introduced up to 2020), there will be no change on current STM32Cube middleware offer. Azure RTOS middleware will be made available as an additional option.
  • A: For new STM32 series starting from 2021, Azure RTOS middleware components will be preferred middleware components. Legacy middleware will be exposed through GitHub only for community handling


  • Q: Is Azure RTOS usable with STM32CubeMX configuration and generation tool?
  • A: Yes, once the Azure RTOS package(s) are picked by the user, the middleware will be available under STM32CubeMX, with some basic possibilities of configuration.


  • Q: Does Azure RTOS have the same STM32CubeMX configuration level as for the legacy CoreMW?
  • A: No, Azure RTOS MW configuration in STM32CubeMX offers less features than Legacy CoreMW native support in STM32CubeMX (less configuration possibilities, limited code generation).


  • Q: I am using current STM32Cube middleware (non Azure RTOS), what is the impact for me?
  • A: None for currently public STM32 series (introduced up to 2020).
  • A: For new coming STM32 series starting from 2021, you will have to migrate to the usage of Azure RTOS middleware, or consider community job being done on older middleware


  • Q: I would like to migrate my application to Azure RTOS from the current STM32Cube middleware offer. How to do it in the easiest way?
  • A: Azure RTOS middleware and current STM32Cube middleware differ by their respective features, performance and footprint figures. Migration effort will depend on the middleware you were using:
  • FreeRTOS: migration will be made easy via a FreeRTOS API layer built on top of ThreadX, and provided by Microsoft, or by using ThreadX CMSIS-RTOS wrapper provided by STMicroelectronics.
  • NetXDuo: migration will be easier if you used Socket API, both available on the two stacks
  • USBX and FileX: switch to new APIs will have to be implemented

ST will provide some documentation highlighting differences and features comparison with possible correspondence between current middleware and Azure RTOS

  • Q: Is ST or Microsoft be legally liable for the Azure RTOS code distributed in STM32Cube?
  • A: Same as for current STM32Cube offer, software is provided as-is


  • Q: What is the technical support scheme of Azure RTOS for ST customers?
  • A: ST ensure first level of support on Azure RTOS middleware components, as provided within STM32Cube software packages. Customers may also enter licensing arrangements directly with Microsoft, including, but not limited to, certifications and standards (e.g., SIL 4, IEC 61508) and dedicated support.


  • Q: For my STM32-based IoT application, am I forced to use Azure Cloud services, or could I still connect to AWS or Aliyun?
  • A: There is no such enforcement, and an STM32 customer remains completely free to choose his favorite cloud provider.


  • Q: Is CMSIS-RTOS wrapper supported by ThreadX ?
  • A: Yes, CMSIS-RTOS v2 wrapper is supported and allows easier applications migration to ThreadX from other RTOS. Please note that CMSIS-RTOS v2 is the default option in STM32CubeMX.


  • Q: How many STM32 Azure RTOS applications are using CMSIS-RTOS V2 wrapper ?
  • A: One ThreadX application is provided with CMSIS-RTOS v2 layer to show how to use it.


  • Q: What are other options available to migrate from FreeRTOS ?
  • A: There is one option of using CMSIS-RTOS v2 layer and one other option of using Azure RTOS FreeRTOS wrapper layer provided by Microsoft.


  • Q: Will existing STM32 expansion packages be migrated to use Azure RTOS Middleware ?
  • A: Some packages will be migrated to Azure RTOS Middleware. New packages developed during second half of 2021 will be based only on Azure RTOS Middleware.


  • Q: When I download/use the STM32 Azure RTOS package provided on GitHub, does it contain the STM32CubeMX generation projects ?
  • A: No, STM32CubeMX generation projects are available only when package is downloaded from www.st.com or on STM32CubeMX interface.


  • Q: Which boards are supported by the Azure RTOS package provided by ST ?
  • A: Specific boards are supported for each application (typically one Nucleo or one Discovery board supported for each application) due to project configuration constraints. In order to support custom boards, modifications have to be done on the project source files.


  • Q: Does STM32CubeMX allow configuration of threads in ThreadX ?
  • A: No, it is not possible to do so. Threads configuration shall be done manually after generation of the project.


  • Q: Is TraceX supported ?
  • A: TraceX is not included in the STM32 Azure RTOS package. But users can download it from Microsoft GitHub repository and integrate it in their projects.


  • Q: Is GUIX supported ?
  • A: GUIX is not included in the STM32 Azure RTOS package. But users can download it from Microsoft GitHub repository and integrate it in their projects.


  • Q: Is USB-PD supported in Azure RTOS Middleware ?
  • A: USB-PD is supported by ST USBPD library and applications provided in eSTM32Cube MCU packages. But it is not yet integrated with STM32 Azure RTOS Middleware solution.


  • Q: I want to use USB or File System but I don't want to use an RTOS, what can I do with Azure RTOS solution ?
  • A: USBX and FileX will soon support "bare metal" option allowing to run them without the need for ThreadX. This feature will be integrated in STM32 packages as soon as it is available.


  • Q: I have a question or support request relative to Legacy CoreMW stacks (ST USB Device, ST USB Host, FreeRTOS, FatFS, LwIP), what can I do ? Will fixes be released on STM32Cube ?
  • A: Support of Legacy CoreMW continues through the standard channels. But no updates will be done on STM32Cube MCU packages or STM32CubeMX. Only GitHub repositories will continue to be updated for major fixes when needed or to support new STM32 Series released starting from 2021.


  • Q: How can I find online trainings to help me use Azure RTOS Middleware ?
  • A: ST provides online training sessions and videos, please visit www.st.com for more details.


  • Q: Where can I find performance and footprint information relative to Azure RTOS Middleware ?
  • A: Performance and footprint data are published on this wiki page periodically. If you don't find it here, it is in the process of being published soon.