resources-banner-image
Don't want to miss a thing?Subscribe to get expert insights, in-depth research, and the latest updates from our team.
Subscribe
by  SoftServe Team

Zephyr RTOS Explained

clock-icon-white  4 min read

There are already more than a hundred operating systems (OS) for embedded devices. So why create another one? This post explains why Zephyr was developed and highlights the features that set it apart from other embedded operating systems.

The internet of things (IoT) industry is growing rapidly. Countless boards are used as hardware for IoT devices, and in some cases, several boards must be used within a single application. In others, developers may need to quickly switch from one board to another. To make this process easier and faster, a unified platform was needed. This idea became the driving force behind Zephyr RTOS.

The Zephyr operating system is intended to be an open and collaborative environment that helps deliver an open-source Real-Time Operating System (RTOS), applicable in a wide diversity of use cases, and supporting as many hardware devices as possible, while providing possibilities for upstreaming code and participating in the future roadmap.
*Source: zephyrproject.org

There are several strong options in the embedded OS market, including FreeRTOS, Mbed, and Apache Mynewt. No single OS can be recommended for every use case — the right choice always depends on the project. Still, Zephyr offers a set of features that make it stand out:

  • Secure bootloader (MCUboot)
  • Kernel
  • Network stacks
  • File systems (NFFS, LittleFS, NVS)
  • Middleware (including OTA updates and LwM2M client functionality)
  • Device drivers
  • Sensor drivers

What Makes Zephyr Unique?

1. Supported boards

In 2020, Zephyr supported around 170 boards — far more than any other embedded operating system at the time. If developers need to switch to a different hardware platform, they simply inform the compiler which board the code should be built for. This flexibility saves significant time and effort when moving between boards.

zephyr application
Figure 1. The Zephyr system architecture (Source: Zephyr.org)

2. Scalability

Zephyr is highly modular and configurable. It provides memory protection even on platforms without a Memory Management Unit (MMU) or Memory Protection Unit (MPU). Hardware descriptions are managed with Device Tree Support (DTS) during compilation.

Developers can include only the features required for a given application, keeping builds lean. The memory footprint can be as small as 8K. Another notable feature: Zephyr uses a single address space, meaning the kernel and application code are compiled together into one binary.

3. Build toolchain

Zephyr is a cross-platform project and uses the CMake build system. It also introduces a command-line tool called West, used for building, flashing, and debugging applications, as well as managing Zephyr repositories.

4. Sensor support

Sensor integration in Zephyr is designed with a high level of abstraction, making it straightforward to enable already-supported sensors. However, adding a new sensor on a custom board is more complex and may require extra work.

5. Support and updates.

Zephyr offers a user-friendly software development kit (SDK) that is relatively easy to adapt to. The SDK evolves quickly with frequent releases. While this keeps the project up to date, it can also cause challenges for developers.

Here’s a personal example:

At some point, I started seeing unexpected device resets. I spent many hours debugging and first assumed the problem was in my application code. After weeks of investigation, I traced the issue to the Bluetooth controller. Updating Zephyr to the latest version instantly solved the problem — the resets disappeared.

This experience shows both the challenge of tracking frequent updates and the value of staying current with them.

Conclusion

Zephyr RTOS is a powerful and convenient tool for embedded development. It provides flexibility, broad hardware support, and an active update cycle. While not without its challenges, it is a strong choice for many embedded applications.

If you're exploring Zephyr RTOS for your projects or need expert guidance on IoT development, SoftServe can help you design, deploy, and manage your devices efficiently. Contact us to discuss how we can support your technology initiatives.

Start a conversation with us