cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable FreeRTOS™ within a project for STM32U5 MCUs

Artur IWANICKI
ST Employee

Introduction

In this article, I briefly demonstrate how to enable FreeRTOS™ within a project for STM32U5 MCUs. As a toolchain I use STM32CubeMX in version 6.11.1 and STM32U5 cube library in version 1.5.0. Additionally, we use the X-CUBE-FreeRTOS library in version 1.2.0. No hardware is used within the process, but for the illustration STM32U599ZJT6 has been used.

1. Prerequisites

Software:

Hardware:

2. Creating the project

Start the new project for the selected STM32U5 MCU. On the example below, we use the project on STM32U599ZJT6 without TrustZone®.

ArturIWANICKI_0-1717507974845.png

ArturIWANICKI_1-1717507988055.png

 

2.1. Adding the X-CUBE-FreeRTOS library

Once the initial configuration is displayed, click [Select Components] under the [Software Packs] menu.

ArturIWANICKI_4-1717508262601.png

 

Scroll down the list and select [STMicroelectronics.X-CUBE-FREERTOS]. In case it is not installed or you would need to use a different version, install it first using the [Install] button within the [Selection] column.

The latest version of STM32CubeMX and STM32CubeIDE requires login to the myST account. To do this, select [myST] and log in to your myST account.

 

2.2. Selecting the FreeRTOS™ version and heap model

After installation of the desired X-CUBE-FREERTOS pack, click the drop-down menu, then click on the drop-down menu [CMSIS RTOS2] and finally [RTOS2]

There are two configuration fields here:

[Core]: Location of FreeRTOS™ within the generated code. In the current implementation, it is a NonSecure application. In this example, there is only one valid option [TZ_Non_Secure].

[Heap]: Memory allocation model, which is used by FreeRTOS™ to manage its components. More information on each of them you can find within our dedicated massive open online course (refer to the "Additional materials" section at the end of this article). In this example, I selected [Heap_4].

ArturIWANICKI_2-1717508124837.png

After this configuration, press [Ok]. Further configuration is performed from the [Middleware..] section from peripherals selection menu. 

2.3. Configuring FreeRTOS™ and its components

From [Middleware and Software Packages..] select X-CUBE-FREERTOS and enable [CMSIS RTOS2] within the mode window.

After that you should see the complete set of FreeRTOS™ configuration options below.

ArturIWANICKI_3-1717508179143.png

 

The [CMSIS_RTOS2] tab contains series of options to enable particular components of the FreeRTOS™.  The rest of the tabs within the [Configuration] window can be used to configure the operating system.

More information on that you can find in our video training mentioned within "Additional materials".

 

Conclusion

At the moment there are two ways of adding FreeRTOS™ into your application created within STM32CubeMX / STM32CubeIDE:

1. Directly from the middlewares section within the peripherals list

2. By adding the X-CUBE-FREERTOS library from Software Components

In both cases, the process of OS configuration and selection of the components looks the same. More information on the configuration and each component of FreeRTOS™ in practice you can find within our dedicated massive open online course. Refer to the "Additional materials" section below.

 

Additional materials

Version history
Last update:
‎2024-09-27 02:16 AM
Updated by: