Skip to content
Build From Zero

Zephyr RTOS: Taking Your Embedded Projects to the Next Level

Embedded System, C, RTOS2 min read


what is Zephyr?

Zephyr RTOS is a game-changing technology developed by experts with decades of collective experience in the embedded world. Originally created as Rocket by Wind River Systems in 2015 and later rebranded as Zephyr, this open-source project has gained immense popularity since its inception. As an open-source project, anyone can access the source code and understand its internal workings.

Over the years, Zephyr has garnered a lot of attention from major tech giants like Google, Meta, Intel, and many more, resulting in significant investments in the project. The depth of contributions by multiple companies can be seen in the commits. Zephyr is not just an RTOS; it's an ecosystem of a fully-fledged open-source project with strong foundations.

The project is developed, managed, and maintained in a transperant manner. Zephyr is heavily inspired by the Linux kernel and makes use of many other popular technologies. In this blog post, we'll delve into the details of Zephyr RTOS, exploring its features, benefits, and potential applications.

Main features of Zephyr


  • Open source
  • Stable RTOS kernal with very low memmory footprint, suitable for both energy hungry and ultra lo power for IoT devices.
  • Wide range of support for different cpu arictectures and platforms
  • Stable releases and Long term support
  • Good documentation
  • Vibrant Community
  • Modular architecture
  • Test suit included
  • Built with safety and security in mind
  • Vendor Neutral, meaning it is not limited to any specific vendors or companies
  • 3rd party libraries



Getting started

Note: To build and flash the following sample, complete the installation instructions at

main.c for a simple blinky program.

1#include <zephyr/kernel.h>
2#include <zephyr/drivers/gpio.h>
4/* 1000 msec = 1 sec */
5#define SLEEP_TIME_MS 1000
7/* The devicetree node identifier for the "led0" alias. */
8#define LED0_NODE DT_ALIAS(led0)
11 * A build error on this line means your board is unsupported.
12 * See the sample documentation for information on how to fix this.
13 */
14static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
16void main(void)
18 int ret;
20 if (!gpio_is_ready_dt(&led)) {
21 return;
22 }
24 ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
25 if (ret < 0) {
26 return;
27 }
29 while (1) {
30 ret = gpio_pin_toggle_dt(&led);
31 if (ret < 0) {
32 return;
33 }
34 k_msleep(SLEEP_TIME_MS);
35 }

Zephyr use CMake for it build system, add following CMakeLists.txt file in your application root.

1cmake_minimum_required(VERSION 3.20.0)
2find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5target_sources(app PRIVATE src/main.c)

In Zephyr the application related configuration are defined inside simple yml file. In our blinky program we need to use the GPIO module. Inorder to enable the GPIO module we have to enable it as follows in the config file.


Build the project using the following command, replace it with your board of choice.

1cd app
2west build -p always -b <your-board-name> app

Once the build is successful, you can flasht the firmware using the following command.

1west flash


In summary, Zephyr RTOS is emerging as a top choice for many embedded solutions in the constantly evolving embedded space. Google recently announced that they plan to replace the legacy firmware of their Chromebook with Zephyr, highlighting its promising future. As more companies follow suit, the Zephyr ecosystem provides developers with flexibility, portability, and ease of use.

If you're an embedded developer, trying out Zephyr is a must. You can learn more about it on the official website and GitHub repository. With its open-source nature, comprehensive documentation, and extensive support, Zephyr is a powerful tool for developing embedded systems. In conclusion, Zephyr RTOS is definitely worth exploring for anyone interested in developing embedded solutions.

For more details please check the offical documentation at

© 2023 by Build From Zero. All rights reserved.
Theme by LekoArts