Follow the FreeRTOS tutorial for STM32 microcontrollers where you will learn creating multiple tasks, sending messages between tasks and setting semaphores.
A Rust embedded-hal HAL impl for the STM32F1 family based on japarics stm32f103xx-hal - stm32-rs