Skip to content

suwon-jang/FreeRTOS_Task_Queue_Mutex

Repository files navigation

FreeRTOS Task / Queue / Mutex Example

Overview / Übersicht

EN: This project demonstrates multitasking, inter-task communication, and resource protection using FreeRTOS (CMSIS-RTOS v2) on an STM32 microcontroller. The example includes tasks, queues and mutexes to simulate a simple embedded system workflow.

DE: Dieses Projekt demonstriert Multitasking, Kommunikation zwischen Tasks und Ressourcenschutz mit FreeRTOS (CMSIS-RTOS v2) auf einem STM32-Mikrocontroller. Das Beispiel umfasst Tasks, Queues und Mutexs zur Simulation eines einfachen Embedded-System-Workflows.


Project Structure / Projektstruktur

EN:

  • SensorTask: Generates sensor values and sends them via a Queue.
  • UartTask: Receives values from the Queue and outputs via UART, protected by a Mutex.
  • LedTask: Toggles an LED periodically.
  • Queue: Facilitates inter-task communication from SensorTask to UartTask.
  • Mutex: Protects UART access to avoid race conditions.

DE:

  • SensorTask: Generiert Sensorwerte und sendet sie über eine Queue.
  • UartTask: Empfängt Werte aus der Queue und gibt sie über UART aus, geschützt durch einen Mutex.
  • LedTask: Schaltet eine LED periodisch um.
  • Queue: Erleichtert die Kommunikation zwischen Tasks (SensorTask -> UartTask).
  • Mutex: Schützt den UART-Zugang, um Race Conditions zu vermeiden.

Tools and Technologies / Werkzeuge und Technologien

  • STM32CubeIDE
  • STM32 Nucleo Board
  • CMSIS-RTOS v2 (FreeRTOS)
  • UART debugging for real-time observation / UART-Debugging zur Echtzeitüberwachung
  • FreeRTOS Task List in CubeIDE for monitoring task states / FreeRTOS Task List in CubeIDE zur Überwachung des Task-Zustands

How to run / Ausführung

EN:

  1. Open the project in CubeIDE and build it.
  2. Connect the STM32 board and start a Debug session.
  3. Open a UART terminal ('screen' or similar) to view sensor values.
  4. Observe LED blinking to verify LedTask operation.
  5. Monitor the FreeRTOS Task List to check task states (RUNNING, READY, BLOCKED, DELAYED).

DE:

  1. Projekt in CubeIDE öffnen und bauen.
  2. STM32-Board verbinden und eine Debug-Session starten.
  3. Ein UART-Terminal öffnen ('screen' o.Ä.), um die Sensorwerte zu sehen.
  4. LED-Blinken beobachten, um die LedTask-Funktion zu überprüfen.
  5. FreeRTOS Task List überwachen, um Task-Zustände (RUNNING, READY, BLOCKED, DELAYED) zu kontrollieren.

Key Learning Points / Wichtigste Lerninhalte

EN:

  • Creation and scheduling of FreeRTOS tasks.
  • Inter-task communication via queues.
  • Resource protection using mutexes.
  • Real-time observation using UART.
  • Task monitoring via CubeIDE FreeRTOS Task List.

DE:

  • Erstellung und Plannung von FreeRTOS-Tasks.
  • Kommunikation zwischen Tasks über Queues.
  • Ressourcenschutz mit Mutexes.
  • Echtzeitüberwachung über UART.
  • Task-Überwachung über FreeRTOS Task List in CubeIDE.

Author / Autor

Suwon Jang, Embedded Systems Engineer

About

This project demonstrates multitasking, inter-task communication, and resource protection using FreeRTOS (CMSIS-RTOS v2) on an STM32 microcontroller. The example includes tasks, queues, and mutexes to simulate a simple embedded system workflow.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages