Getting Started with STM32 and Nucleo Part 3-How to Run Multiple Threads with CMSIS-RTOS Interface
2019-09-16 | By Maker.io Staff
On this STM32 video, we’re going to introduce FreeRTOS and show how to run multiple threads using the CMSIS-RTOS interface.
A real-time operating system (RTOS) is extremely useful for running concurrent tasks within the same program and offering a level of code portability. An RTOS differs from a general purpose operating system (e.g. Windows, macOS, Linux) by offering a guarantee to meet strict timing deadlines. As a result, you can find RTOSes used in many advanced microcontroller and embedded systems applications, such as cars, interplanetary rovers, rockets, and pacemakers.
In the video, we’ll demonstrate using FreeRTOS from the STM32CubeIDE. We’ll use the graphical interface to configure FreeRTOS and create 2 tasks (also known as “threads”). From there, we’ll write some simple code in those two different tasks to blink an LED. The catch is that they will try to blink the same LED! This should create some interesting effects on our STM32 Nucleo board.
The STM32 series is based on the ARM Cortex architectures. Specifically, we’ll be looking at the STM32 Arm Cortex-M microcontrollers. To make life easier, we’ll be using STMicroelectronics’ official Nucleo development boards (the Nucleo-L476RG in particular).
Related Items
Related Projects
- Getting Started with STM32 - Introduction to STM32CubeIDE
- Getting Started with STM32 - I2C Example
- Getting Started with STM32 - Introduction to FreeRTOS
Related Videos
Additional Resources
Download STM32CubeIDE: https://www.st.com/en/development-tools/stm32cubeide.html
STM32 HAL documentation (click on family from graphic and then Resources tab): https://www.st.com/en/embedded-software/stm32cube-mcu-mpu-packages.html
FreeRTOS documentation: https://www.freertos.org/
CMSIS-RTOS documentation: http://www.keil.com/pack/doc/CMSIS/RTOS2/html/index.html
Recommended Reading
- Getting Started with STM32 and Nucleo Part 1: Introduction to STM32CubeIDE and Blinky
- Getting Started with STM32 and Nucleo Part 2: How to Use I2C to Read Temperature Sensor TMP102
- Getting Started With STM32 & Nucleo Part 4: Working with ADC and DMA
- Getting Started with STM32 - How to Use SPI
- Getting Started with STM32 - Timers and Timer Interrupts
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum