Introduction to Azure RTOS with STM32

Revision as of 16:54, 15 February 2021 by Registered User



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, embTLS, LibJPEG). All integrated and customized for STM32 MCU devices and enriched with corresponding application examples based on STM32 evaluation boards.

Core Middleware Components

2. STM32 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

In order to implement FileX, LevelX, NetXDuo or USBX, an integrated RTOS is required (ThreadX). A “bare-metal” implementation is planned in the future for USBX.

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

Azure RTOS Interdependencies

2.1. Azure RTOS Integration

ST offers integrated and ready to use environment to allow effortless implementation of user projects based on Azure RTOS and other CoreMW stacks.

  • Ability to use Azure RTOS and other CoreMW stacks with a level of configurability directly from STM32CubeMX
  • Addition of multiple application examples for standard ST evaluation boards: STM32Nucleo, Discovery Kits and Eval boards.
  • Addition of material helping with migration efforts
  • Addition of training material and documentation

The AzureRTOS API 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/BSP drivers to ensure portability among different STM32 MCU and boards.

Azure RTOS Interactions

2.2. Where to get Azure RTOS ?

2.2.1. www.st.com

Packages are available in www.st.com using a simple search querry.

2.2.2. STM32CubeMx

Azure RTOS is delivered as a STM32CubeMx pack, to allow users benefit from STM32CubeMx native features alongside the Azure RTOS applications.

  • There is one pack per STM32 Series (STMicroelectronics.X-Cube-AZRTOS-NN.X.Y.Z.pack)
  • Each pack contains all the supported MW stacks and all required resources (HAL, BSP, Utilities, ...)
  • All packs are compliant with STM32Cube and STM32CubeExpansion rules
  • The MW stacks are described as CMSIS pack components to facilitate their usage and to manage interdependencies between them.
  • The Middlewares are configurable through STM32CubeMx interface and code can be generated.
  • Each pack provides a set of full functional applications described by PDSC file

An X-Cube Package for a specific Series is not visible or usable on other series. The X-Cube package has its own version, that is not correlated with Azure RTOS MW versions. Two different X-Cube AZRTOS packs, for different series, may contain different Azure RTOS MW versions.

2.2.3. GitHub

ST GitHub repository contains all Azure RTOS packages separately and/or inside STM32 CubeFW packages. (ie. X-CUBE-AZRTOS-H7 ) Github host the source code of the different AzureRTOS MW stacks as well as all required drivers, utilities, and projects so that user can download different components and construct his own package. The Git repository is based on the git submodules features fully supported by GitHub. The git repository consists of the following repos:

  • STM32CubeExpansion_AZRTOS_NN: the central repo referencing all the sub-repos
  • MW_AZRTOS_<MW_NAME>: Each AzureRTOS MW repo has its own git repo that tracks the reference repo from Microsoft and adds specific STM32 source codes (template files, drivers…). For example. MW_AZRTOS_ThreadX
  • Projects_azrtos_NN: Each STM32 series has a dedicated “projects” repo that contains the applications for the supported boards using AzureRTOS MW.
  • CMSIS-Core, HAL, BSP, Utilities: these are the reference repos from the STM32CubeFW official releases

The Git repository structure is aligned with STM32CubeExpansion package structure.


2.3. Azure RTOS Applications

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

2.4. Azure RTOS License

Component License Copyright
CMSIS Apache License 2.0 Copyright (c) 2009-2017 ARM Limited. All rights reserved.
CMSIS Device Apache License 2.0 ARM Limited - STMicroelectronics
STM32H7 HAL BSD-3-Clause STMicroelectronics
BSP STM32H7xx_Nucleo BSD-3-Clause STMicroelectronics
BSP STM32H735G-DK BSD-3-Clause STMicroelectronics
BSP Components BSD-3-Clause STMicroelectronics
Application Projects ST SLA0044 STMicroelectronics
STM32 Utilities BSD-3-Clause STMicroelectronics
Azure RTOS ThreadX Microsoft Software License for Azure RTOS Microsoft
Azure RTOS NetXDuo Microsoft Software License for Azure RTOS Microsoft
Azure RTOS FileX Microsoft Software License for Azure RTOS Microsoft
Azure RTOS LevelX Microsoft Software License for Azure RTOS Microsoft
Azure RTOS USBX Microsoft Software License for Azure RTOS Microsoft


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
  • FatFS
  • LwIP
  • LibJPEG
  • OpenAMP
  • embTLS

These stacks are provided in the STM32CubeFW 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: ST is currently considering the existing STM32 series on which to propose Azure RTOS. The older STM32 series won’t benefit from it.
  • Q: Will I be able to use AzureRTOS for my commercial applications for free?
  • A:Yes, in compliance with the corresponding license terms.
  • Q: Will I be able to make modifications to AzureRTOS to tailor my STM32 application to my needs or fix bugs myself?
  • A: Yes, in compliance with the corresponding license terms.
  • Q: What will happen to the current STM32Cube middleware offer, such as FreeRTOS or ST USB library?
  • A: For currently public STM32 series and Series to be introduced in 2020, there will be no change on current
STM32Cube middleware offer. AzureRTOS middleware will be made available as an additional option. 
  • A: For new coming STM32 series starting from 2021, AzureRTOS middleware components will be preferred middleware components. Legacy middleware will be exposed through GitHub for community handling
  • Q: Is AzureRTOS usable with STM32CubeMX configuration and generation tool?
  • A: Yes, once the AzureRTOS package(s) are picked by the user, the middleware will be available under STM32CubeMX, with some basic possibilities of configuration.
  • Q: I am using current STM32Cube middleware (non Azure RTOS), what is the impact for me?
  • A: None for currently public STM32 series and Series to be introduced in 2020.
  • A: For new coming STM32 series starting from 2021, you will have to migrate to the usage of AzureRTOS middleware, or consider community job being done on older middleware
  • Q: I would like to migrate my application to AzureRTOS from the current STM32Cube middleware offer. How to do it in the easiest way?
  • A: AzureRTOS 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
    • 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 AzureRTOS

  • Q: Is ST or Microsoft be legally liable for the AzureRTOS code distributed in STM32Cube?
  • A: Same as for current STM32Cube offer, software is provided as-is
  • Q: What is the technical support scheme of AzureRTOS for ST customers?
  • A: ST ensure first level of support on AzureRTOS 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:
  • A:
  • Q:
  • A:
  • Q:
  • A:
  • Q:
  • A:
  • Q:
  • A:
  • Q:
  • A:
  • Q:
  • A:
  • Q:
  • A: