Real-Time Systems and RTOS

FreeRTOS vs Zephyr vs ThreadX: Choosing an RTOS

FreeRTOS, Zephyr, and Eclipse ThreadX compared: scope, footprint, licensing, middleware, safety certification, tooling, and which fits your microcontroller project.

On this page
  1. The short answer
  2. At a glance
  3. FreeRTOS
  4. Zephyr
  5. Eclipse ThreadX
  6. The same task in each API
  7. Which one for which project?
  8. An evaluation checklist
  9. Keeping your options open
  10. Other RTOSes worth knowing about
  11. Frequently asked questions

The short answer

All three are mature, open-source real-time operating systems that run on a wide range of microcontrollers. The kernels are all capable. The bigger differences are in scope, ecosystem, and support:

  • FreeRTOS is a small, simple kernel with the largest user base and very wide chip support. Pick it when you want a minimal, well-understood kernel, or when your vendor SDK already uses it, as ESP-IDF does.
  • Zephyr is a full OS platform: kernel, drivers, build system, device configuration, Bluetooth, networking, and more. Pick it for connected products with lots of protocols, or when your silicon vendor’s SDK is built on it, as Nordic’s nRF Connect SDK is.
  • Eclipse ThreadX is a small, fast kernel with a matching set of middleware (networking, file system, USB, GUI) and a history of safety certifications. Pick it when you want an integrated suite, or a certification path, from one open-source project.

Often the deciding factor isn’t the kernel itself but which RTOS your chip vendor supports best.

If you haven’t yet decided whether you need an RTOS, see RTOS vs super loop.

At a glance

FreeRTOS Zephyr Eclipse ThreadX
Stewardship Amazon Web Services Linux Foundation project, many member companies Eclipse Foundation
License MIT Apache 2.0 MIT
Scope Kernel, plus optional libraries (TCP/IP, MQTT, etc.) Full OS platform: kernel, drivers, stacks, build system Kernel plus middleware suite (NetX Duo, FileX, LevelX, USBX, GUIX)
Typical footprint Smallest; kernel can be a few KB of flash Larger, but highly configurable Small; comparable to FreeRTOS for the kernel
Configuration FreeRTOSConfig.h macros Kconfig and devicetree Header defines (e.g. tx_user.h)
Build system Whatever your project uses (vendor IDE, Make, CMake) CMake plus the west tool Whatever your project uses; CMake supported
Bluetooth / networking Via vendor stacks or FreeRTOS-Plus-TCP Bluetooth LE, IPv4/IPv6, Thread, and more included NetX Duo (TCP/IP); Bluetooth via third parties
Memory protection Optional MPU ports Userspace threads with MPU support Optional modules and MPU support on some ports
Safety certification Via SafeRTOS, a separate certified derivative Ongoing project effort; check current status Historically pre-certified; check status for your version
Learning curve Gentle Steeper (build system, devicetree, Kconfig) Gentle for the kernel

Footprint, feature lists, and certification status change between releases. Treat this table as a starting point and check the current documentation for the versions you plan to use.

FreeRTOS

FreeRTOS has been around since the early 2000s and came under Amazon Web Services’ stewardship in 2017. It’s probably the most widely taught and widely ported microcontroller RTOS.

Strengths

  • Small and simple. The core kernel is a handful of C files. You can read the source in an afternoon, and it’s easy to drop into an existing project.
  • Huge ecosystem. Ports exist for a very wide range of architectures and compilers. Most chip vendors ship FreeRTOS examples, and it’s the base of Espressif’s ESP-IDF. There’s a large body of tutorials, forum answers, and books, including the free “Mastering the FreeRTOS Real Time Kernel”.
  • Permissive license. MIT, with no requirement to release your application code.
  • Long-term support releases that bundle the kernel with selected libraries and receive security fixes for an extended period.
  • Good tooling support. Most RTOS-aware debuggers and trace tools, such as SEGGER SystemView and Percepio Tracealyzer, support it.
  • SMP support for multicore microcontrollers is available in recent kernel versions.

Weaknesses

  • It’s a kernel, not a platform. Drivers usually come from your chip vendor’s HAL, and you integrate networking, file systems, and other middleware yourself. Quality and consistency vary.
  • No memory isolation by default. A stray pointer in one task can corrupt another. MPU-enabled ports exist but take more effort to use.
  • Certification is separate. For safety-certified products, the usual route is SafeRTOS from WITTENSTEIN high integrity systems, a commercially licensed, certified kernel with a similar functional model, rather than FreeRTOS itself.

Best fit: small to medium microcontroller projects, ESP32 projects, teams that want a minimal kernel and are happy to choose their own middleware, and anyone learning RTOS concepts. Our FreeRTOS beginner tutorial is a hands-on starting point.

Zephyr

Zephyr is an open-source RTOS hosted by the Linux Foundation and developed by a large group of companies, including several major silicon vendors. It aims to be a complete, vendor-neutral platform for connected embedded devices.

Strengths

  • Batteries included. Bluetooth LE (host and controller), IPv4/IPv6 networking, Thread, USB, file systems, a shell, logging, sensor and power management frameworks, and integration with the MCUboot bootloader are all part of one tree.
  • Consistent driver model. Hardware is described in devicetree and features are selected with Kconfig, much as in Linux. The same application can often move between boards with configuration changes rather than code changes.
  • Broad board support. Hundreds of boards are supported upstream, and several vendors build their SDKs on Zephyr, notably Nordic Semiconductor’s nRF Connect SDK.
  • Modern engineering process. Code review, continuous integration, a security response process, and regular long-term support (LTS) releases.
  • Memory protection. Userspace threads can be isolated using the MPU on supported hardware.

Weaknesses

  • Steeper learning curve. CMake, west, devicetree, and Kconfig are a lot to learn at once, and build errors can be hard to decode at first.
  • Larger and more complex. Zephyr can be configured down to small sizes, but a typical networked application uses noticeably more flash and RAM than an equivalent FreeRTOS build, and the codebase is much larger to understand.
  • Fast-moving. APIs and configuration options change between releases. Sticking to LTS releases helps.
  • Certification still maturing. The project has a safety effort working toward functional safety certification. Check the current state if you need it.

Best fit: connected products using Bluetooth, Thread, Matter, or IP networking; Nordic-based designs; products that will run on several boards or chip families; and teams comfortable with Linux-style tooling.

Eclipse ThreadX

ThreadX was created by Express Logic in the 1990s, acquired by Microsoft in 2019 and renamed Azure RTOS, and then contributed to the Eclipse Foundation, where it’s now developed as Eclipse ThreadX under the MIT license.

Strengths

  • Small, fast kernel with a clean, consistent API and some distinctive features, such as preemption-threshold, which lets you limit which tasks can preempt a given task without changing its priority.
  • Integrated middleware. NetX Duo (TCP/IP), FileX (FAT file system), LevelX (flash wear leveling), USBX (USB host and device), and GUIX (graphics) are designed to work together and share the same style.
  • Safety and security heritage. ThreadX has historically been available in pre-certified form for standards such as IEC 61508 and ISO 26262. Under the Eclipse Foundation, certification is handled through a member program. Confirm what’s available for the exact version you’d ship.
  • Vendor integrations. Several silicon vendors, including STMicroelectronics, NXP, and Renesas, have offered ThreadX in their SDKs for some product families.
  • Now permissively licensed. Earlier licensing tied production use to specific hardware. The move to MIT removed that restriction.

Weaknesses

  • Smaller community than FreeRTOS or Zephyr, with fewer forum answers and third-party examples.
  • Recent transitions. The move from Microsoft to Eclipse means some documentation, links, and vendor packages still refer to Azure RTOS, and the long-term community is still taking shape.
  • Fewer wireless stacks built in. Bluetooth and some IoT protocols come from vendors or third parties.

Best fit: projects that want a compact kernel plus networking, file system, and USB from one source; designs on chips whose vendor ships ThreadX support; and safety-related products where a pre-certified kernel matters.

The same task in each API

A blinking-LED thread looks like this in each kernel.

FreeRTOS

void blink_task(void *arg)
{
    for (;;) {
        led_toggle();
        vTaskDelay(pdMS_TO_TICKS(500));
    }
}

/* stack depth in words; higher number = higher priority */
xTaskCreate(blink_task, "blink", 256, NULL, 2, NULL);
vTaskStartScheduler();

Zephyr

void blink_thread(void *p1, void *p2, void *p3)
{
    while (1) {
        led_toggle();
        k_msleep(500);
    }
}

/* stack size in bytes; lower number = higher priority (negative = cooperative) */
K_THREAD_DEFINE(blink_tid, 1024, blink_thread, NULL, NULL, NULL, 5, 0, 0);

Eclipse ThreadX

static TX_THREAD blink;
static UCHAR blink_stack[1024];

void blink_entry(ULONG input)
{
    while (1) {
        led_toggle();
        tx_thread_sleep(50);              /* ticks; 500 ms at a 100 Hz tick */
    }
}

void tx_application_define(void *first_unused_memory)
{
    /* stack size in bytes; 0 = highest priority */
    tx_thread_create(&blink, "blink", blink_entry, 0,
                     blink_stack, sizeof(blink_stack),
                     10, 10, TX_NO_TIME_SLICE, TX_AUTO_START);
}

/* in main(): tx_kernel_enter(); */

Two differences cause real bugs when people switch kernels:

  • Priority numbering. In FreeRTOS, a bigger number is more urgent. In Zephyr and ThreadX, a smaller number is more urgent.
  • Stack units. Native FreeRTOS takes stack depth in words. Zephyr and ThreadX take bytes, as do CMSIS-RTOS v2 and ESP-IDF’s FreeRTOS. See how to size RTOS task stacks for more on getting this right.

The underlying concepts are the same in all three: priority-based preemptive scheduling, plus queues, semaphores, mutexes with priority inheritance, event flags, and software timers. Our guides on real-time scheduling and task synchronization and communication apply to all of them.

Which one for which project?

Situation Usual choice Why
ESP32 project FreeRTOS ESP-IDF is built on it, so it’s already there
Nordic nRF52/nRF53/nRF54 with Bluetooth Zephyr nRF Connect SDK is built on Zephyr
General STM32 project FreeRTOS or ThreadX Both have STM32Cube integration for many families; Zephyr also supports many boards
Very small MCU, a few KB of RAM FreeRTOS or ThreadX Smallest kernels, least overhead
Many protocols: BLE, Thread, IP, USB, file system Zephyr Stacks are integrated and maintained together
Wants TCP/IP, file system, and USB from one source, without a large platform ThreadX Matching middleware suite
Safety-certified product ThreadX (check certification status) or SafeRTOS Pre-certified kernels reduce certification effort
AWS IoT-connected device FreeRTOS AWS libraries and reference integrations
Learning RTOS concepts FreeRTOS Simplest kernel, most learning material
Same firmware across several boards or vendors Zephyr Devicetree and a common driver model

An evaluation checklist

Before committing, check each candidate against your project:

  1. Silicon support. Is there a maintained port for your exact chip, and does your vendor’s SDK support this RTOS directly?
  2. Middleware. Which stacks do you need (Bluetooth, TCP/IP, TLS, USB, file system, graphics), and are they mature on this RTOS?
  3. Footprint. Build a representative test application and measure flash and RAM, rather than relying on published minimums.
  4. Certification. If you need IEC 61508, ISO 26262, IEC 62304, or similar, what certified version and evidence are available, and at what cost?
  5. Memory protection. Do you need tasks isolated from each other, and does the RTOS support the MPU on your part?
  6. Tooling. Does your debugger have an RTOS-aware view? Is there trace support?
  7. Team skills. Is your team comfortable with CMake, devicetree, and Kconfig, or would a simple kernel get you shipping sooner?
  8. Long-term maintenance. How are security fixes delivered? Is there an LTS release that matches your product’s lifetime?
  9. Licensing. Confirm the license of the kernel and every middleware component and vendor library you’ll use.

Keeping your options open

Switching RTOS later is easier if you plan for it:

  • Wrap kernel calls behind a thin layer of your own, such as os_queue_send() and os_delay_ms(), so most of your code doesn’t call the RTOS directly.
  • Consider CMSIS-RTOS v2 on Arm Cortex-M. It’s a standard API that several kernels, including FreeRTOS and Zephyr, can sit behind, though it doesn’t expose every feature.
  • Check compatibility layers. Zephyr offers POSIX and CMSIS-RTOS v2 APIs, and the ThreadX project includes compatibility layers for some other APIs, including FreeRTOS and POSIX. These help with porting, but test carefully, because behavior at the edges can differ.
  • Keep drivers separate from application logic so that a change of driver model doesn’t ripple through everything.

Other RTOSes worth knowing about

  • Apache NuttX: strong POSIX compatibility, feels like a small Unix; used in the PX4 drone autopilot.
  • RT-Thread: popular in China, with a large package ecosystem and good support for Chinese microcontrollers.
  • SEGGER embOS: commercial, compact, and well integrated with SEGGER’s debug tools, with safety-certified versions.
  • Keil RTX5: Arm’s open-source CMSIS-RTOS v2 reference implementation.
  • VxWorks, QNX, INTEGRITY, PikeOS: commercial RTOSes for larger processors and demanding safety or security markets such as aerospace, automotive, and medical.

Frequently asked questions

Industry surveys have generally put FreeRTOS at or near the top for microcontroller projects, with Zephyr growing quickly. Popularity varies a lot by industry and region, so it’s worth asking what’s common among chips and products like yours.

Which is easiest for a beginner?

FreeRTOS, for most people. The kernel is small, the API is simple, and there’s far more beginner material available. ThreadX’s kernel is similarly approachable. Zephyr asks you to learn its build and configuration system before you write much code.

Is Zephyr too big for small microcontrollers?

Not necessarily. Zephyr can be configured quite small, and it runs on many modest Cortex-M parts. On the smallest devices, though, FreeRTOS or ThreadX usually leave more room for your application. Measure a representative build before deciding.

Is ThreadX still maintained after leaving Microsoft?

Yes. It’s maintained as Eclipse ThreadX under the Eclipse Foundation, with releases on GitHub. As with any project that has changed hands, check recent release activity and vendor support for your chip before committing.

The complete guide to real-time systems and rtos

Real-Time Embedded Systems Explained
Read the guide

Keep exploring

Guides from other topics

All topics →