Jump to content

SuperTinyKernel RTOS

From Wikipedia, the free encyclopedia
SuperTinyKernel RTOS
DeveloperNeutron Code Limited
Written inC++, C
OS familyReal-time operating systems
Working stateCurrent
Source modelOpen source
Latest release1.05.2[1] / March 2026; 1 month ago (2026-03)
Repositorygithub.com/SuperTinyKernel-RTOS/stk
Marketing targetEmbedded systems
Available inEnglish
Supported platformsARM Cortex-M (ARMv6-M through ARMv8.1-M); RISC-V (RV32I, RV32E)
Kernel typeMicrokernel
LicenseMIT
Official websitesupertinykernel.org

SuperTinyKernel RTOS (STK) is a lightweight, high-performance, deterministic real-time operating system (RTOS) for resource-constrained embedded systems.[2] It is implemented in C++ with a clean object-oriented design and released under the MIT License. Unlike many traditional RTOSes, STK concentrates solely on a preemptive, deterministic thread scheduler rather than providing peripheral abstraction, minimizing kernel size while prioritising timing accuracy and predictability.

STK imposes no dynamic memory allocation, has no dependency on the C++ Standard Library for templates, and provides a fully-featured C interface, making it suitable for safety-critical development. The absence of heap allocation satisfies MISRA C++:2008 Rule 18-4-1.

Scheduling

[edit]

STK operates in two fundamental modes. In soft real-time mode, tasks cooperate via Sleep() and Yield() calls, with the kernel applying preemptive scheduling to prevent any task from starving others. In hard real-time (HRT) mode, tasks are periodic with guaranteed execution windows and strict deadlines enforced by the kernel; any deadline violation triggers a deterministic failure callback.

Tasks may follow either a static model (created once at startup) or a dynamic model (created and exited at runtime).

STK supports all major scheduling strategies, including round-robin scheduling (RR), smooth weighted round robin (SWRR), fixed-priority round-robin (FPRR), rate-monotonic scheduling (RM), deadline-monotonic scheduling (DM), and earliest deadline first scheduling (EDF). Custom strategies can be provided by implementing the dedicated C++ interface.

STK also provides two proprietary Mixed criticality scheduling strategies available under a commercial license. The two-level Mixed-Criticality Adaptive Scheduler (MCAS) partitions tasks into low- and high-criticality groups, distributes CPU time between them at a configurable ratio using a token-bucket mechanism, and automatically suspends low-criticality tasks when a high-criticality task overruns its execution budget – resuming normal operation after a configurable cooldown period. The four-level variant (MCAS4) generalises this model to four independent criticality levels with cascade escalation and recovery, and adds an elastic CPU share adaptation mechanism driven by a per-group exponential moving average (EMA), also termed an exponentially weighted moving average (EWMA), execution-pressure estimator, allowing groups under sustained load to borrow CPU share from lower-criticality neighbours without altering worst-case response time guarantees.

Synchronization

[edit]

STK provides a rich synchronization API comprising mutexes (including a reader-writer variant), counting semaphores, condition variables, event flags, critical sections, spinlocks, and a thread-safe FIFO pipe for inter-task data passing. Synchronization support is optional and can be omitted at compile time to reduce flash and random-access memory (RAM) use.

Task privilege separation

[edit]

On ARM Cortex-M cores implementing the memory protection unit (MPU) – Cortex-M3 and newer – STK supports hardware-enforced privilege separation between tasks. Trusted driver tasks run in privileged thread mode with full peripheral access, while application or untrusted tasks run in unprivileged mode where any direct peripheral access triggers a hardware fault. This isolates potentially attacker-controlled code paths from safety-critical hardware state.

Multi-core support

[edit]

STK supports multicore embedded microcontrollers through an asymmetric multiprocessing (AMP) model, with one independent kernel instance per physical core. This design eliminates cross-core synchronization overhead inside the kernel and allows each core to operate with its own scheduling policy and timing domain.

Hardware support

[edit]

STK targets ARM Cortex-M processors spanning ARMv6-M through ARMv8.1-M (Cortex-M0 through M55) and RISC-V RV32I and RV32E cores. Both soft and hard floating-point are supported. The kernel has been validated on development boards including STM32F0DISCOVERY (Cortex-M0), NUCLEO-F103RB (Cortex-M3), STM32F4DISCOVERY (Cortex-M4F), NXP FRDM-K66F (Cortex-M4F), NXP MIMXRT1050 (Cortex-M7), and Raspberry Pi Pico 2 W (Cortex-M33 and RISC-V).

Development and testing

[edit]

STK includes an x86 scheduling emulator for Windows, allowing the same application code to be built, debugged, and unit-tested on a desktop PC without physical hardware. The scheduler logic carries 100% unit test coverage, and all commits are verified against QEMU targets for each supported architecture. Scheduling activity can be visualised with SEGGER SystemView.

Performance

[edit]

Benchmarks conducted on an STM32F407VG (Cortex-M4 at 168 MHz) in February 2026, comparing STK v1.04.2 against FreeRTOS V10.3.1, showed STK achieving up to 31% higher task throughput, 25–55% lower RAM use (~7 KB versus ~9–11 KB), and approximately 17% lower scheduling jitter in high-task-count scenarios. The trade-off is a larger flash size (~25 KB versus ~13 KB), a consequence of the C++ template architecture.[3]

License

[edit]

SuperTinyKernel is released under the MIT License, permitting free use in commercial, closed-source, open-source, and academic projects. Neutron Code Limited offers professional services including safety-certification assistance (IEC 61508, IEC 62304, ISO 26262, DO-178C) and SLA-backed commercial support.

See also

[edit]

References

[edit]
  1. ^ "SuperTinyKernel RTOS Github Releases". GitHub. 2026-03-09.
  2. ^ "SuperTinyKernel RTOS". supertinykernel.org. Retrieved 2026-02-22.
  3. ^ "SuperTinyKernel RTOS – Benchmark". github.com/SuperTinyKernel-RTOS/stk. Retrieved 2026-02-22.
[edit]