We’re huge fans of Zephyr around here. We have been targeting the popular RTOS and Ecosystem since the start of Golioth, including our latest Fi

Zephyr for Hardware Engineers: GPIO

submited by
Style Pass
2024-09-05 14:00:03

We’re huge fans of Zephyr around here. We have been targeting the popular RTOS and Ecosystem since the start of Golioth, including our latest Firmware SDK release (0.15.0). And while I’ve been here a good chunk of that time, my background is in hardware and I still struggle with some simple things in Zephyr. So I thought I’d write about one of them.

What’s that, you say? There’s a blinky example? That’s correct! The blinky example is the canonical starting point for all Zephyr dev boards and is arguably one of the simplest samples. And this does indeed utilize GPIO to turn LEDs on and off! So let’s go look at the blinky example before we get back to my gripe.

A bit further down the page, you see that you need to have an overlay file (or a native node) for your device tree to contain the following:

I’ll pause here and quickly point you at some resources. When I was getting started, I found this to be one of the most confusing parts of Zephyr. Ultimately I know that I am going to solder a part down to the board and that there’s a physical pin that the signals will squirt out of. Depending on the IDE or Ecosystem I’m using, there might be a configurator tool, or a config file, or a set of registers I need to decode in order to get a pin to do what I want. P0.13 on the nRF52840 of the Reel Board (as shown in the example above) is going to be blinking an LED on and off and, so I want to set that…but how?

Leave a Comment