Zephyr's growing hardware support includes popular microcontroller boards for makers
Zephyr, an open-source real-time operating system (RTOS) launched by the Linux Foundation in 2016, has made lots of progress seven years after its announcement, and it now has an active ecosystem surrounding it. It's used in Internet of Things (IoT) sensors, Bluetooth trackers, heart rate monitors, smartwatches, and embedded controllers. A few months ago I wrote an overview article for LWN.net about the project, Zephyr: a modular OS for resource-constrained devices.
The Zephyr RTOS is used in a lot of commercial products as well as some open-source projects. Developers are also continuously adding support for new development boards. Currently, Zephyr supports more than 450 boards from various architectures.
While most of these boards are the typical developer boards used by professional developers, recent years have seen an uptick in support for more boards popular with hobbyists. Here's a list of some supported boards that will surely ring a bell if you're active in the maker community:
So what can you do with Zephyr? An interesting use case for the operating system is developing Bluetooth Low Energy applications running on one of the above boards. A previous blog article explaining Zephyr's iBeacon example code gives you an idea about how such code looks like. If this piques your curiosity, consider delving deeper into the subject by reading my book Develop your own Bluetooth Low Energy Applications for Raspberry Pi, ESP32 and nRF52 with Python, Arduino and Zephyr, which uses Nordic Semiconductor's nRF52840 Dongle and nRF52840 Development Kit. But Zephyr supports a plethora of communication protocols, including Thread, a low-power IPv6-based wireless mesh-networking technology for home-automation applications, and other protocols listed in the aforementioned LWN.net article.
Even if you're not up to the task of developing applications in the C programming language, Zephyr can be interesting for you. If you prefer Python, you've surely heard about MicroPython, a programming language that implements a sizable subset of Python that can run on microcontrollers. You can read more about it in my recent LWN.net article MicroPython 1.20: Python for microcontrollers. MicroPython offers firmware downloads for more than 150 microcontroller boards, but it also has been ported to Zephyr.
In MicroPython 1.20, this port is based on Zephyr 3.1.0, which was released in June 2022; the current Zephyr release is 3.4.0. A Zephyr development environment can be used to build MicroPython for every target board supported by Zephyr, although not all have been tested. It also gives MicroPython code access to Zephyr's uniform sensor API using the zsensor module. More information can be found in MicroPython's documentation about the Zephyr port.
Thanks to Zephyr's broad hardware support, the Zephyr port allows MicroPython to run on the BBC micro:bit v2, whereas only a direct MicroPython port for the BBC micro:bit v1 exists. Other interesting boards from the above list that don't have a MicroPython firmware download but that are supported thanks to the Zephyr port are the Arduino Nano 33 IoT, the PineTime, and the RuuviTag. The process of setting up the development environment, building the Zephyr port for the target board, and then flashing the firmware to the board is explained in the port's README file.