Real-Time Systems
FreeRTOS, Zephyr, VxWorks
Mars Rover Curiosity has been running VxWorks since 2012 without a single reboot. Falcon 9 runs VxWorks from launch through first-stage landing. AirPods run FreeRTOS: IMU, audio, and BLE coexisting in 10 KB RAM. Smart locks and Matter devices are migrating to Zephyr. Every choice is a trade-off between license cost, memory, certification, and ecosystem. A VxWorks license costs from USD 12,000 per device. FreeRTOS: MIT, free. Zephyr: Apache 2.0, free. Price is not the deciding factor - Boeing 787 runs VxWorks because the certification package, not the license fee, is what matters.
- **NASA Curiosity Rover**: VxWorks on a RAD750 radiation-hardened processor - operating since 2012, software updates arrive via uplink with 20+ minute signal delay
- **AirPods Pro**: FreeRTOS on Apple H1/H2 chip - drives Active Noise Cancellation, Transparency mode, and Spatial Audio simultaneously within a ~10 KB RAM footprint
- **Nordic nRF5340 Matter devices**: Zephyr as the de-facto standard - BLE + Thread + Matter out of the box, PSA Certified Level 2 via TF-M
- **Siemens SIMATIC PLC**: VxWorks or Wind River Linux depending on safety level - IEC 62443 Industrial Security certification
FreeRTOS: the IoT standard
**FreeRTOS** is a monolithic kernel with preemptive scheduling and a minimum footprint of ~10 KB RAM. Created by Richard Barry in 2003, acquired by Amazon in 2017. Ships in over 40 billion devices. Architecture: single binary, all components statically linked. Memory management: five allocation strategies (heap_1 through heap_5). heap_4 is the most common - first-fit with block coalescing. No built-in POSIX, no networking stack in the kernel. The strength of FreeRTOS lies in API simplicity and a massive ecosystem of ports across 35+ architectures from AVR to RISC-V.
**AWS FreeRTOS (FreeRTOS LTS)**: Amazon added MQTT, TLS 1.3, OTA updates, and an HTTP client on top of the kernel. The kernel remains MIT licensed; AWS components carry MIT or the Amazon License. An ESP32 running FreeRTOS with AWS IoT Core is the canonical IoT sensor architecture for under USD 2 in BOM cost.
**heap_4 vs heap_5**: heap_4 uses a single memory pool; heap_5 allows multiple non-contiguous regions - useful when SRAM1 and SRAM2 are not adjacent in the address space (e.g., STM32H7). When heap fragmentation becomes a problem, switch to static allocation via xTaskCreateStatic() to eliminate runtime malloc entirely.
A FreeRTOS task calls xQueueSend() when the queue is full. The timeout is 0. What happens?
Zephyr: Linux Foundation RTOS
**Zephyr** is a Linux Foundation project (2015), Apache 2.0 licensed. Target audience: microcontrollers with < 256 KB RAM where Linux is too heavy and FreeRTOS lacks built-in connectivity. Key differentiators from FreeRTOS: devicetree for hardware description (borrowed from Linux), Kconfig for build configuration, a built-in networking stack (BLE, WiFi, LoRa, Thread, Ethernet), a POSIX API subset, and TF-M (Trusted Firmware-M) for PSA Certified security. Toolchain: west + CMake. Zephyr includes a native Bluetooth Host Stack - not just an HCI wrapper. Supports 500+ boards out of the box.
**ML on the Edge with Zephyr**: Arm Cortex-M55 and Ethos-U55 NPU are supported in Zephyr. TensorFlow Lite Micro runs as a Zephyr thread. Typical pipeline: IMU data via Zephyr sensor API -> inference thread -> BLE notify. Zephyr is the de-facto standard for ML at the Edge on ARM Cortex-M in 2024-2025.
**West workspace setup**: Zephyr requires the west meta-tool and a manifest file for dependency management. `west update` downloads dozens of repositories. Initial workspace initialization takes 15-30 minutes on a slow connection. Building Zephyr without west is not supported.
Devicetree in Zephyr (borrowed from Linux) solves which problem?
VxWorks: aerospace standard
**VxWorks** by Wind River Systems, 1987. Not open-source. License: from USD 12,000 per device for a DO-178C Level A certification package. The cost is justified: DO-178C certification alone runs into millions; VxWorks ships a ready-made certification kit (DAL A/B/C for aviation, ASIL-D for automotive ISO 26262, IEC 62443 for industrial security). Architecture: Wind microkernel with a POSIX-compatible API layer on top. Deterministic interrupt latency: < 1 us on modern silicon. Certified hypervisor support for mixed-criticality systems.
**Mixed-criticality with VxWorks Hypervisor**: the Boeing 787 runs a certifiable RTOS guest (flight controls) and a Linux guest (cabin entertainment) on the same multicore CPU. The hypervisor enforces spatial isolation (memory) and temporal isolation (CPU time). The DO-178C Level A certificate covers only the certifiable guest - Linux does not need certification.
**Why Curiosity and Falcon 9 run VxWorks**: not because it is the fastest, but because of heritage. JPL has used VxWorks since Spirit/Opportunity in 2004. Each mission involves decades of development and verification. Switching RTOS means restarting certification. Technical lock-in in aerospace is not a bug - it is deliberate risk management.
A team is developing a Class IIb medical device (IEC 62304 Software Safety Class C). Which RTOS selection criterion matters most?
Decision matrix: choosing an RTOS
RTOS selection is a systems question, not a technical one: what needs certification, how much memory is available, which ecosystem is required. **Footprint**: FreeRTOS 6-10 KB RAM (kernel only), Zephyr 8-30 KB (depends on enabled subsystems), VxWorks 200 KB+. **Certification**: FreeRTOS - none official, Zephyr - PSA Certified Level 1-3 via TF-M, VxWorks - DO-178C / ISO 26262 / IEC 62443. **Ecosystem**: FreeRTOS leads in port count and examples, Zephyr leads in modern protocols (Matter, Thread, Bluetooth LE Audio), VxWorks leads in aerospace heritage. ML at the edge: Zephyr + TFLite Micro for Cortex-M55 with NPU - the practical path in 2024-2025.
| Criterion | FreeRTOS | Zephyr | VxWorks |
|---|---|---|---|
| RAM minimum | 6-10 KB | 8-30 KB | 200 KB+ |
| License | MIT (free) | Apache 2.0 (free) | Commercial (from USD 12K) |
| Certification | None official | PSA Certified (TF-M) | DO-178C, ISO 26262, IEC 62443 |
| BLE/WiFi in kernel | No (via libraries) | Yes (Bluetooth Host Stack) | Partner stacks |
| POSIX API | None | Subset | Full |
| ML at the Edge | Limited | TFLite Micro + Ethos-U | Via SDK |
| Primary niche | IoT sensors, ESP32/STM32 | BLE devices, ML MCU | Aviation, space, automotive safety |
| Examples | AirPods, Amazon Echo | Nordic nRF52840 devices | Curiosity Rover, Boeing 787 |
**Zephyr is not a FreeRTOS replacement - it replaces Linux**: Zephyr targets devices with < 256 KB RAM where Linux was previously too heavy and FreeRTOS lacked a networking stack. If a project already runs FreeRTOS and does not need a BLE Host Stack or Matter, migrating to Zephyr provides no benefit and costs months of engineering work.
RTOS means FreeRTOS. Everything else is niche or overkill
FreeRTOS leads in deployment count, but Zephyr is rapidly taking over modern IoT with BLE/Matter/ML, and VxWorks is the only viable choice for DO-178C/ISO 26262 certification
In 2017 Amazon acquired FreeRTOS and invested heavily in AWS IoT integration. The Linux Foundation invested in Zephyr for modern connectivity (Matter, Bluetooth LE Audio, ML). Wind River updated VxWorks 23 with Cloud Native tools. The market is segmented by niche, not by quality: each RTOS dominates in specific domains for substantive reasons. Picking 'the best RTOS' without specifying the context is a category error.
Key ideas
- **FreeRTOS**: 6-10 KB RAM, MIT license, 40B+ deployments. Standard for IoT sensors and MCUs without a connectivity stack. Simple API, 35+ architectures
- **Zephyr**: Linux Foundation, Apache 2.0, devicetree + Kconfig, native BLE Host Stack and Matter. De-facto standard for modern IoT with BLE/ML at the Edge on Cortex-M55
- **VxWorks**: DO-178C/ISO 26262/IEC 62443 certification, < 1 us interrupt latency, hypervisor for mixed-criticality. Aerospace, automotive safety, industrial. From USD 12K/device
- **Decision matrix**: memory + certification + ecosystem determine the choice. Zephyr is not a FreeRTOS replacement - it replaces Linux on resource-constrained MCUs. Each RTOS has a distinct niche
Related topics
RTOS choice intersects with embedded architecture, OS primitives, and parallelism models:
- RTOS Architecture (rts-04) — Scheduler, IPC, MPU - the mechanisms inside each of the three RTOS
- Embedded Systems (emb-05) — RTOS choice determines the HAL and driver model for the embedded project
- OS Synchronization (os-05-sync) — RTOS mutex vs POSIX mutex: same concept, different real-time guarantees
- Parallel Computing (par-05) — Multi-core RTOS scheduling and AMP/SMP modes - parallelism in a real-time context
Вопросы для размышления
- A team is developing an autonomous underwater vehicle (AUV): Cortex-M7, 512 KB RAM, real-time motor control (< 5 ms deadline), sonar processing, Ethernet telemetry. No safety certification is required. Which RTOS is the right fit, and what specifically makes FreeRTOS or Zephyr better than VxWorks in this scenario?
- VxWorks costs 100x more than FreeRTOS but is used in the Boeing 787. A DO-178C certification package costs millions separately. Why do aerospace companies not migrate to open-source RTOS even with massive budgets - what exactly does a VxWorks certification evidence package provide that open-source cannot?
- Zephyr devicetree describes hardware at compile time. FreeRTOS works with any BSP through conditional compilation. Which approach scales better when developing a product line across five different MCUs with similar peripherals?