on
2024-09-27
01:03 AM
- edited on
2024-09-27
02:16 AM
by
Laurids_PETERSE
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.
Software:
Hardware:
Start the new project for the selected STM32U5 MCU. On the example below, we use the project on STM32U599ZJT6 without TrustZone®.
Once the initial configuration is displayed, click [Select Components] under the [Software Packs] menu.
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.
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].
After this configuration, press [Ok]. Further configuration is performed from the [Middleware..] section from peripherals selection menu.
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.
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".
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.