Benjamin Cabé

Zephyr Weekly Update – Gotta love ’em snippets

Zephyr Weekly Update - March 31, 2023

Zephyr Weekly Update - March 31, 2023

Welcome to the second edition of the Zephyr Weekly Update series covering the week of March 24-31, 2023. In this series, I try to highlight some of the noteworthy changes that made it into Zephyr over the past week.

This week is all about snippets, a couple interesting new boards, and as always lots of activity on the drivers front. Let’s dive right in!

Snippets

The most significant update this week is the introduction of Snippets.

If you’re like me, you’ve probably often found yourself reusing similar snippets of configuration (sometimes alongside corresponding devicetree overlays) to add a bit of functionality to your project. Things like overriding the default physical UART and Zephyr console to use a USB CDC-ACM UART one instead, enabling your favorite debugging combo (shell, custom log levels, …), etc.

However, the current build system lacked an extensible and composable solution that allows for capturing and naming such “snippets”, so that they can be referenced at build time, as opposed to copied repeatedly across your various projects.

Enter snippets! Snippets help streamline your project’s configuration by allowing you to define commonly used settings and then reference them when needed. This way, you can maintain a cleaner, more organized project structure while reducing the risk of errors caused by manual copy-pasting or inconsistent configurations across various parts of your project.

If it’s still not 100% clear to you how snippets can help you, check out this sample. It demonstrates how adding and enabling a USB CDC-ACM console to your project is now just a west build -S cdc-acm-console […] away. This will, behind the scenes, automagically:

Boards and SoC support

Arduino Giga R1 Wi-Fi

STM32H573I-DK Discovery kit

Drivers

Texas Instruments BP-BASSENSORSMKII BoosterPack™

Bluetooth

Miscellaneous

You may be familiar with the Pmod standard interface that allows to easily attach peripherals to development boards. A new GPIO nexus has been added, allowing you to define your Pmod port as a node in your device tree [9d50b143ae]


I hope you find this update useful. Please share your thoughts in the comments and don’t hesitate to share the article widely to help spread the love for Zephyr! 🪁

If you enjoyed this article, don’t forget to subscribe to this blog to be notified of upcoming publications! And of course, you can also always find me on Twitter and Mastodon.

Exit mobile version