Zephyr RTOS

Zephyr is a small, scalable, open-source real-time operating system maintained by the Linux Foundation. It targets resource-constrained microcontrollers and SoCs where a full Linux kernel is too heavy, providing deterministic scheduling, a rich driver model, and a unified hardware abstraction across hundreds of supported boards.

Architecture

Zephyr follows a monolithic kernel design with optional subsystems compiled in at build time:

  • Scheduler — priority-based preemptive scheduler with optional cooperative threads; tick-based and tickless modes; supports FIFO, round-robin, EDF, and deadline scheduling policies
  • Memory model — static allocation by default; optional memory pools and heap; MPU-backed memory domains for isolation without an MMU
  • Device modelstruct device with DEVICE_DT_DEFINE macros; devicetree-driven configuration matching Linux DT semantics
  • Networking — full BSD socket API over LwIP or native stack; Wi-Fi, Bluetooth LE, IEEE 802.15.4, Ethernet, CAN bus, Modbus
  • Security — TF-M (Trusted Firmware-M) integration for Arm TrustZone; Mbed TLS for TLS 1.3; secure boot via MCUboot
  • Sensor / IO subsystems — unified sensor API, GPIO, SPI, I2C, UART, PWM, ADC, DAC, CAN FD
  • Shell and logging — built-in UART shell for runtime diagnostics; structured logging with multiple backends (UART, RTT, net, flash)

Embedded and Real-Time Use

  • PREEMPT-RT equivalent — Zephyr's scheduler meets hard real-time requirements on Cortex-M without external patches; worst-case ISR latency is measurable and bounded
  • MCUboot — bootloader for Zephyr images; supports A/B swap, rollback, and signed firmware updates; integrates with Zephyr's DFU subsystem for OTA
  • West — the Zephyr meta-tool for workspace management, flashing (west flash), debugging (west debug), and extension commands
  • Devicetree — hardware description compiled from .dts/.overlay files; shields and boards described in boards/ and dts/ trees
  • Kconfig — same Kconfig system as the Linux kernel; per-application prj.conf fragments; merges with board and SoC defaults
  • Cross-compilation — Zephyr SDK bundles GCC toolchains for Arm, RISC-V, x86, ARC, Xtensa, MIPS, and NIOS2; CMake-based build system

Key target classes:

Class Examples
Arm Cortex-M0/M0+ nRF51, STM32F0, SAMD21
Arm Cortex-M4/M33 nRF52840, STM32L4, LPC55
Arm Cortex-M55/M85 nRF9161, STM32H7, i.MX RT
RISC-V ESP32-C3, GD32VF103, SiFive FE310
Xtensa ESP32, ESP32-S3

Versioning and Long-Term Support

Zephyr follows a quarterly release cadence. LTS releases are maintained for two years with security back-ports.

Branch Status Notes
4.x (main) Current stable Active development
3.7 LTS LTS EOL Oct 2026
3.4 LTS Maintenance EOL Oct 2025

Upstream Contribution

Zephyr uses GitHub pull requests with DCO sign-off (git commit -s). Code owners are defined per subsystem in MAINTAINERS.yml. CI runs on GitHub Actions with QEMU and hardware-in-the-loop (HIL) targets. Key tools: west, twister (test runner), checkpatch.pl (ported from Linux).

Related Technologies

  • Linux Kernel — the standard OS for application-class processors; Zephyr fills the MCU tier where Linux is too heavy
  • FreeRTOS — the most widely deployed RTOS; less integrated but simpler and broadly supported by silicon vendors
  • MCUboot — the de-facto bootloader for Zephyr and other RTOS targets
  • libiot — 32bitmicro's IoT connectivity library; targets both Zephyr and embedded Linux
  • OpenThread — Thread/802.15.4 mesh stack; ships as a Zephyr module
Copyright © 32bitmicro, LLC 2024-2026