EmbeddedRelated.com
Getting Started With Zephyr: Devicetree Overlays

Getting Started With Zephyr: Devicetree Overlays

Mohammed Billoo
Still RelevantIntermediate

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

Topics

ZephyrRTOSFirmware DesignARM Cortex-M

Related Documents