Free real-time operating system (RTOS) designed for deeply embedded applications logo

Free real-time operating system (RTOS) designed for deeply embedded applications

Free
FreeFree tier
Type
Open Source

About Free real-time operating system (RTOS) designed for deeply embedded applications

StateOS is a free, extremely simple, and very fast real-time operating system (RTOS) designed for deeply embedded applications, targeting ARM Cortex-M and STM8 microcontrollers. Inspired by state machine concepts, it supports both preemptive and cooperative scheduling modes. StateOS offers a rich set of features including tick-less operation for low power, MPU protection, various synchronization primitives (mutexes, semaphores, condition variables, barriers, etc.), message/mailbox/event/job queues, timers, and a hierarchical state machine. It provides a comprehensive C++ wrapper with support for standard C++ threading (std::thread, std::mutex, etc.) and also implements CMSIS-RTOS and CMSIS-RTOS2 APIs. The kernel can operate with 16, 32, or 64-bit timers. All documentation is contained within source files, and examples are available in separate repositories. Licensed under MIT.

Key Features

Preemptive and cooperative scheduling modes
Supports 16-, 32-, and 64-bit timer counters
Tick-less (tickless) operation for low-power applications
MPU (Memory Protection Unit) protection using nullptr and stack overflow detection
Asynchronous communication functions with unmasked interrupt handlers
Synchronization primitives: spin locks, once flags, events, signals with protection mask flags (any, all, new), barriers, binary/limited/counting semaphores, mutexes (configurable type, protocol, robustness), condition variables, read/write locks
Memory pools, raw buffers, message queues, mailbox queues, event queues, job queues
One-shot and periodic timers
Hierarchical state machine support
CMSIS-RTOS and CMSIS-RTOS2 API compatibility

Pros & Cons

Pros
  • Free and open-source under the permissive MIT license
  • Extremely simple and fast kernel design
  • Rich set of synchronization and communication primitives
  • Supports both preemptive and cooperative scheduling
  • Advanced C++ wrapper enabling use of std::thread, std::mutex, etc.
  • Tick-less operation for reduced power consumption
  • MPU protection for enhanced safety and security
  • Compatible with CMSIS-RTOS and CMSIS-RTOS2 APIs
Cons
  • Targets only ARM Cortex-M and STM8 architectures; not portable to other platforms
  • Documentation is primarily contained within source comments, which may be less accessible than a standalone manual
  • Relatively small community compared to larger RTOS projects (e.g., FreeRTOS)

Best For

Deeply embedded applications on ARM Cortex-M and STM8 microcontrollersIoT devices requiring a lightweight, deterministic RTOSReal-time control systems needing preemptive or cooperative multitaskingLow-power battery-operated devices benefiting from tick-less modeSafety-critical applications leveraging MPU protectionProjects that require standard C++ threading support in embedded environments

FAQ

What architectures does StateOS support?
StateOS targets ARM Cortex-M and STM8 microcontrollers.
Is StateOS free and what license does it use?
Yes, StateOS is free and released under the MIT license.
Does StateOS support C++ threading?
Yes, StateOS provides a comprehensive C++ wrapper that supports std::thread, std::mutex, std::semaphore, std::future, std::barrier, std::latch, std::chrono, thread_local storage, and more.
Where is the documentation for StateOS?
All documentation is contained within the source files, particularly in header files. Examples and templates are available in separate GitHub repositories.
Can StateOS run without a timer tick?
Yes, StateOS supports tick-less operation, which can be beneficial for low-power applications.