freertos-patterns

Provides FreeRTOS task management and synchronization patterns for ESP32 and RP2040 embedded projects.

20|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/wedsamuel1230/arduino-skills --skill freertos-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: freertos-patterns
Source: https://github.com/wedsamuel1230/arduino-skills/tree/main/skills/freertos-patterns
Command: npx skills add https://github.com/wedsamuel1230/arduino-skills --skill freertos-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a library of FreeRTOS task management, synchronization, and inter-core patterns for ESP32 and RP2040 projects, enabling robust multitasking and reliable resource coordination out of the box. The patterns cover task creation, queues, semaphores, mutexes, event groups, software timers, and core pinning to simplify complex firmware.

Core Features & Use Cases

  • Task creation & lifecycle: Easily spawn and manage multiple tasks with proper stack sizing and priority handling.
  • Inter-task communication: Use queues, binary and counting semaphores, and task notifications to coordinate work across cores.
  • Synchronization primitives: Mutexes with priority inheritance, event groups for multi-condition waits, and software timers for predictable timing.
  • Dual-core coordination: Examples demonstrating ESP32 Core0/Core1 separation and RP2040’s two-core model.
  • Use case: Build a responsive IoT device that reads sensors, communicates over WiFi, and logs data without blocking.

Quick Start

To begin, review the references in the references directory, load the examples into your Arduino IDE, and flash them to your ESP32 or RP2040 board to observe multitasking in action.

Frequently Asked Questions about freertos-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I coordinate tasks across dual cores on an ESP32 using FreeRTOS?

FreeRTOS dual-core coordination on ESP32 uses core pinning to assign tasks to Core0 or Core1 and leverages queues or task notifications for safe inter-core communication. This separation prevents WiFi operations from blocking sensor reads.

What is the best way to handle inter-task communication in ESP32 FreeRTOS?

The best way to handle inter-task communication in ESP32 FreeRTOS is using queues for passing data payloads and semaphores for signaling. Binary and counting semaphores, along with task notifications, safely coordinate work without race conditions.

How do FreeRTOS mutexes with priority inheritance prevent task deadlocks?

FreeRTOS mutexes with priority inheritance prevent deadlocks by temporarily elevating a low-priority task holding a resource to match the priority of a high-priority task waiting for it. This synchronization mechanism ensures safe resource access without indefinite blocking.

Does this FreeRTOS multitasking pattern library support the RP2040 two-core model?

Yes, this FreeRTOS multitasking pattern library fully supports the RP2040 two-core model. It provides specific dual-core coordination examples demonstrating RP2040 setups alongside ESP32 Core0/Core1 separation for robust embedded firmware multitasking.

When should I use FreeRTOS event groups instead of queues for multitasking?

You should use FreeRTOS event groups instead of queues when multiple tasks must wait for multiple conditions simultaneously. Event groups facilitate multi-condition waits and broadcast signaling, whereas queues are designed for passing sequential data items between tasks.

Why do I need software timers in FreeRTOS and how do they affect multitasking?

You need software timers in FreeRTOS to execute periodic or predictable timing functions without blocking tasks with delay loops. They affect multitasking by offloading timed events to the timer service task, keeping main application threads responsive.