top of page

Open source.

Open source:

Boreas: Zephyr's kernel APIs on ESP-IDF

Teams that work in both Zephyr and ESP-IDF rewrite the same logic twice against two sets of primitives. We published the layer that stops that.

What it is

Espressif parts mean ESP-IDF, and ESP-IDF means FreeRTOS. Elsewhere there is a good chance you are in Zephyr. Boreas is four ordinary ESP-IDF components that give you Zephyr's kernel API surface and device model on top of FreeRTOS, so the application layer is the same on both. It is Apache 2.0.

zkernel holds k_timer, k_work, k_sem, k_mutex, k_msgq, k_event, k_thread, sys_slist, sys_dlist, ring_buf, the timeout API, atomics and SYS_INIT. zdevice adds struct device and DEVICE_DEFINE, I2C, SPI and GPIO descriptions, and driver-class vtables for GPIO and UART. zsys carries per-module log levels and backends, a thread analyzer, a subsystem watchdog, and retry with backoff. zshell is a shell with command registration, history, completion and VT100 handling.

Kernel objects are statically allocated: the structs are yours. The exception is anything built on a timer. k_timer, delayable work and a thread created with a start delay each create an esp_timer, which allocates its own handle inside ESP-IDF.

Why we wrote it

We write firmware on Espressif parts and on parts that run Zephyr, often for the same client, and the application layer was getting written twice against two sets of primitives.

The first attempt put Zephyr-shaped structs over FreeRTOS handles, which imports Zephyr's memory model without the guarantees underneath it. The zkernel README records what that cost: "months of intermittent scheduler corruption", from a parked task whose control block outlived its stack frame. What came out of it is the rule Boreas is built on, which is to wrap the scheduler but own the synchronization state.

Who it is for

If you are starting an ESP-IDF project and your team already thinks in Zephyr, or you expect to move silicon later, it is worth the dependency. If you are committed to one Espressif part and nobody on the team has written Zephyr, plain ESP-IDF is well documented and the abstraction will not pay for itself.

Using it

Add it as a git submodule, point EXTRA_COMPONENT_DIRS at it and add sdkconfig.boreas to your SDKCONFIG_DEFAULTS. The repository carries the full steps and the examples, including a device-model blink.

Zephyr's kernel APIs on ESP-IDF is the long version: the design principle, the linker-section problem behind the registration macros, and where it still diverges from upstream.

Code: github.com/intercreate/boreas

What this supports

Explore our case studies.