StateOS
Free real-time operating system (RTOS) for microcontrollers with advanced c++ wrapper and support for std::thread
Install / Use
/learn @stateos/StateOSREADME
StateOS
StateOS is free, extremely simple and very fast real-time operating system (RTOS) designed for deeply embedded applications.
Targets
ARM Cortex-M, STM8.
Inspiration
StateOS was inspired by the concept of a state machine. Procedure executed by the task (task state) doesn't have to be noreturn-type. It will be executed into an infinite loop. There's a dedicated function for immediate change the task state (task function).
Documentation
All documentation is contained within source files, in particular header files.
Gettin started
Building an application for a specific compiler is realised using the appropriate makefile script.
Features
- kernel can operate in preemptive or cooperative mode
- kernel can operate with 16, 32 or 64-bit timer counter
- kernel can operate in tick-less mode
- implemented basic protection using MPU (use nullptr, stack overflow)
- implemented functions for asynchronous communication with unmasked interrupt handlers
- spin locks
- once flags
- events
- signals with protection mask
- flags (any, all, new)
- barriers
- semaphores (binary, limited, counting)
- mutexes with configurable type, protocol and robustness
- condition variables
- read/write locks
- memory pools
- raw buffers
- message queues
- mailbox queues
- event queues
- job queues
- timers (one-shot, periodic)
- hierarchical state machine
- cmsis-rtos api
- cmsis-rtos2 api
- c++ wrapper
- support for std::thread
- all documentation is contained within source files, in particular header files
- examples and templates are in separate repositories on GitHub
- archival releases on sourceforge
Supported stdc++ features
- std::thread, std::jthread, std::stop_callback, std::this_thread, ...
- std::mutex, std::shared_mutex, std::condition_variable, ...
- std::binary_semaphore, std::counting_semaphore, ...
- std::lock_guard, std::unique_lock, std::shared_lock, ...
- std::future, std::promise, std::assync, ...
- std::barrier, std::latch, ...
- std::chrono, ...
- thread local storage (thread_local)
- and more ...
License
This project is licensed under the terms of the MIT License (MIT).
Related Skills
openhue
327.7kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
327.7kElevenLabs text-to-speech with mac-style say UX.
weather
327.7kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.4kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
