Getting Started With Zephyr: Devicetree Overlays
In this blog post, I show how the Devicetree overlay is a valuable construct in The Zephyr Project RTOS. Overlays allow embedded software engineers to override the default pin configuration specified in Zephyr for a particular board. In this blog post, I use I2C as an example. Specifically, I showed the default I2C pins used for the nRF52840 development kit in the nominal Zephyr Devicetree. Then, I demonstrated how an overlay can be used to override this pin configuration and the final result.
Summary
This blog post explains how Zephyr's Devicetree overlay mechanism lets engineers override a board's default pin configuration. Using the nRF52840 and I2C as a worked example, the author shows the default Devicetree pins and demonstrates how to write and apply an overlay to change the pin assignments.
Key Takeaways
- Identify how Zephyr defines default I2C pins in the nominal Devicetree for the nRF52840
- Write a Devicetree overlay to override pinmux/pinctrl settings for a device node
- Apply the overlay in a Zephyr build (file placement and build options) to produce the updated Devicetree
- Inspect the build artifacts to verify the final pin assignments and troubleshoot common overlay errors
Who Should Read This
Embedded firmware engineers or developers working with Zephyr who need to customize board pin assignments (intermediate experience with RTOS and microcontrollers).
Still RelevantIntermediate
Related Documents
- Consistent Overhead Byte Stuffing TimelessIntermediate
- PID Without a PhD TimelessIntermediate
- Introduction to Embedded Systems - A Cyber-Physical Systems Approach Still RelevantIntermediate
- Can an RTOS be really real-time? TimelessAdvanced
- Memory Mapped I/O in C TimelessIntermediate








