All projects

Professional embedded

Real-time multitasking (FreeRTOS)

Advanced80 min

Run several tasks on one board, with priorities, a message queue and a mutex.

What you get

Three tasks running without blocking each other, a queue absorbing bursts and a protected resource.

Parts (simulated)

  • ESP32 or Arduino board
  • LEDs and a button
  • Serial monitor

Nothing to buy: every component here is simulated in the browser.

Project steps

  1. 01Create two tasks and give them different priorities.
  2. 02Replace delay() with vTaskDelay() and understand the difference.
  3. 03Make a producer and consumer talk through a queue.
  4. 04Protect a shared resource with a mutex.
  5. 05Keep critical sections as short as possible.

What you learn

  • Scheduling and priorities
  • Message queues
  • Mutual exclusion
  • Critical sections

Other projects