
FreeRTOS is a lightweight, deterministic real-time operating system (RTOS) designed for microcontrollers and small embedded processors where timing, reliability, and resource efficiency are critical. Unlike general-purpose operating systems, FreeRTOS provides a minimal kernel focused on predictable task scheduling, fast interrupt response, and low memory footprint, making it well suited for motor control, robotics, automotive, and IoT devices. It enables developers to structure firmware as multiple concurrent tasks instead of a single super-loop, improving modularity and maintainability while still meeting strict real-time deadlines. The kernel offers essential synchronization and communication mechanisms such as queues, semaphores, mutexes, software timers, and event groups, allowing safe data exchange between tasks and interrupt service routines. Because it is portable across many architectures and integrates easily with vendor SDKs, FreeRTOS has become one of the most widely adopted foundations for modern embedded real-time software.
Scheduling & Execution Model
- Supports preemptive, cooperative, and time-slice scheduling
- Supports real-time tasks and co-routines
- Unlimited number of tasks
- Unlimited priority levels
Memory & Footprint
- Very small kernel footprint (typically 4–9 KB RAM)
- Components can use static or dynamic memory allocation
- Written mainly in C language for portability
- Portable across 40+ CPU architectures
Power & Efficiency
- Provides Tickless mode for low-power applications
- Efficient software timers
- Optimized for small microcontrollers
Inter-Task Communication & Synchronization
- Task notifications
- Message queues
- Binary semaphores
- Counting semaphores
- Recursive mutexes
- Mutexes with priority inheritance
- Event groups (event flags)
Safety & Reliability
- Stack overflow detection
- Strong execution tracing capability
- MPU support on Cortex-M (e.g., STM32F429, STM32F407)
- SafeRTOS derived version available for higher code integrity

| File | Function |
|---|---|
| croutine.h/.c | Source files that implement co-routine functionality. Co-routines are mainly used for very small MCUs and are now rarely used |
| event_groups.h/.c | Source files that implement event group functionality |
| list.h/.c | Source files that implement linked list functionality. The FreeRTOS task scheduler uses linked lists |
| queue.h/.c | Source files that implement queue functionality |
| semphr. | Header file that implements semaphore functionality. Semaphores are based on queues, and the semaphore operation functions are macro-defined functions whose implementations ultimately call queue-handling functions |
| task.h/.c | Source files that implement task management functionality |
| timers.h/.c | Source files that implement software timer functionality |
| stream_buffer.h/.c | Source files that implement stream buffer functionality. A stream buffer is an optimized inter-process/inter-task communication mechanism used to transfer continuous stream data between tasks, or between tasks and interrupt service routines. Stream buffer functionality was introduced in FreeRTOS Version 10 |
| message_buffer.h | In FreeRTOS Version 10, an innovative message buffer mechanism was introduced. Its functionality is encapsulated through carefully written macro functions, which integrate stream buffer operations to achieve efficient message buffering and management. This feature marked another important advance for FreeRTOS in the real-time operating system field, providing developers with more powerful and flexible message processing capabilities |
| mpu_prototypes.h/mpu_wrappers.h | Header files for MPU functionality. The functions defined in these files are standard functions with the prefix MPU_ added. When an application uses MPU functionality, these functions are given priority execution by the FreeRTOS kernel. MPU functionality was introduced in FreeRTOS Version 10 |
| Macro Definition | Value | Function |
|---|---|---|
| pdFALSE | 0 | Represents the logical value false |
| pdTRUE | 1 | Represents the logical value true |
| pdFAIL | 0 | Represents the logical value false |
| pdPASS | 1 | Represents the logical value true |
| pdMS_TO_TICKS(xTimeInMs) | - | A macro function that converts the number of milliseconds represented by xTimeInMs into tick counts |
[1]
FreeRTOS
[2]
FreeRTOS LTS Libraries
[3]
Beginner’s guides to FreeRTOS
[4]
FreeRTOS Documentation
[5]
FreeRTOS Book Examples
[6]
FreeRTOS Kernel Developer Docs
Back to top of the page