LAB4_RTOSforSTM32 (1)
LAB4_RTOSforSTM32 (1)
Purpose
Create Tasks using the CMSIS-RTOS layer for the STM32 devices.
Hardware
● Nucleo-F103RB
○ 1 Nucleo-F103RB development board
○ 1 USB-miniUSB cable for connecting Nucleo kit to your PC
Software
● STM32CubeIDE
Procedure
Setting Up your project for CMSIS-RTOS.
1. Create a New Project from an existing ‘.ioc’ configuration.
○ File → New → STM32 Project
2. Select the NUCLEO-F103RB as the Board.
3. Change the Project Name, select the Location, select STM32Cube as the Project
Type and click the Finish button.
○ If an ‘Initialize all peripherals with their default Mode?’ message
appears after clicking the Finish button, click on the Yes button.
School of Engineering and Sciences
Robotics and Digital Systems Engineering
TE2003B. System Design on Chip
Module 3 Real Time Operating Systems
5. Save (Ctrl+S) the configurations and generate the code, click on Yes.
6. Setup the printf( ) function:
○ Include the <stdio.h> library:
/* Private includes
------------------------------------------------ */
/* USER CODE BEGIN Includes */
#include <stdio.h>
/* USER CODE END Includes */
School of Engineering and Sciences
Robotics and Digital Systems Engineering
TE2003B. System Design on Chip
Module 3 Real Time Operating Systems
○ Rewrite the _write() function:
7. Compile and Run you project. You should see the “Hello from RTOS World!!”
message in a serial terminal.