CM4_LiteRTOS is a minimal, high-performance real-time operating system designed for ARM Cortex-M4 microcontrollers.
It provides essential multitasking features like thread scheduling, time delays, and context switching — implemented in clean, bare-metal C with a small footprint.
This project is entirely self-sufficient, utilizing only the files included in the repository, with no external dependencies needed.
Although the current example targets the STM32F446RE, the core OS is hardware-agnostic and can be adapted to any Cortex-M4 MCU with minimal changes.
- Preemptive scheduling with PendSV handler
- Round-robin task switching
- Configurable thread priorities
- Blocking delays with millisecond granularity
- Idle task with low-power hooks
- Compact footprint — minimal RAM/flash usage
- Easily portable to other Cortex-M4 MCUs
The provided App.c
demonstrates running two concurrent tasks:
- A blinking LED task
- A GPIO-PIN toggle task
- Tested on STM32F446RE
- Portable to any ARM Cortex-M4 with minimal adaptation
This project is dual-licensed under the MIT License and GPLv3. While most of the code is MIT-licensed,
the inclusion of stdatomic
requires adherence to GPLv3 terms as well.
For details, see LICENSE-MIT
and LICENSE-GPLv3
.