Categories
IoT Zephyr

Zephyr Weekly Update – Packet Filtering, UUIDs & More

Another week, another batch of updates and improvement being made to Zephyr, with over 140 merged pull requests!

Before diving into some of the highlights, I would encourage you to add the video recordings of the recent Zephyr Meetup Grenoble to your watchlist as there were quite a few interesting topics covered!

Network Packet Filtering Updates

It’s no secret that Zephyr’s networking stack is one of its great strengths. This week, some neat improvements to packet filtering have been introduced (PR #88544), including support for VLAN, statistics collection for number of packets affected by filters, a shell module, and more.

A new code sample is available and a great showcase for how you can leverage the Network Packet Filtering API (including the aforementioned improvements) to setup some filtering rules for e.g. implementing firewall functionality, network traffic control, etc.

For example, installing a filtering rule dropping any incoming packet larger than 200 bytes is as simple as:

static NPF_SIZE_MAX(maxsize_200, 200);
static NPF_ETH_TYPE_MATCH(ip_packet, NET_ETH_PTYPE_IP);

static NPF_RULE(small_ip_pkt, NET_OK, ip_packet, maxsize_200);

void install_my_filter(void)
{
    npf_insert_recv_rule(&npf_default_drop);
    npf_insert_recv_rule(&small_ip_pkt);
}

The code sample actually creates multiple VLAN networks, giving an opportunity to showcase rules that only apply to some interfaces. The net filter shell command also conveniently shows you a snapshot of which rules are in place.

uart:~$ net filter
Rule  Type        Verdict  Tests
[ 1]  recv        OK       3    eth vlan type[0x0800],size max[200],iface[2]
[ 2]  recv        OK       3    eth vlan type[0x0800],size min[100],iface[3]
[ 3]  recv        OK       1    iface[1]
[ 4]  recv        OK       2    eth vlan type[0x0806],iface[2]
[ 5]  recv        OK       2    eth vlan type[0x0806],iface[3]
[ 6]  recv        DROP     0

New UUID library

Generating and managing unique identifiers is crucial in many applications, and can be really useful to e.g. tag sensor data samples, generate session identifiers, etc. Thanks to @sorru94‘s work in PR #77884, Zephyr now includes a Universally Unique Identifier (UUID) utility library implemeting RFC 4122.

It provides functions for generating UUIDs (both v4 -random- and v5 -deterministic-), comparing them, and converting UUIDs between string and binary representations.

Check out the dedicated code sample for some code snippets.

New boards and SoCs

  • Renesas RZ/G2LC SMARC EVK: Initial support Renesas RZ/G2LC SoC was added, alongside associated evaluation kit. The RZ/G2LC microprocessor is a dual Cortex®-A55 (1.2GHz) CPU.  (PR #88569).
  • STM32 NUCLEO-WBA65RI: STM32WBA6 SoC is now supported, and the NUCLEO-WBA65RI is a great starting point to experiment with this ultra-low-power board (PR #88407).
  • NXP FRDM-MCXA153: Added support for the NXP MCXA153 MCU and the corresponding FRDM board (PR #85644).
  • BeagleBoard PocketBeagle 2 M4: The Cortex-M4F co-processor of the TI AM6232-based PocketBeagle 2 is now supported. (PR #87997).
  • TF-M on Nordic nRF54L10: Initial support for TF-M now available on the nRF54L10 (PR #88442).

Drivers

  • X-Powers AXP2101 Charger: The charger peripheral within this popular PMIC is now supported. The TTGO T-Watch S3 directly benefits from this since it’s one of the boards supported in Zephyr that uses an AXP2101 PMIC. Note to self: order one ASAP as it is a really cool looking device and now has even more peripherals supported 🙂 (PR #88125).
  • I2C Controller driver added for the WCH CH32V RISC-V family (PR #87922).
  • ITE IT51xxx Watchdog timer driver for ITE EC chips (PR #88470).
  • Silicon Labs SiWx91x WiFi module now supports Background Scanning and Roaming (PR #87037).
  • TI SimpleLink CC23x0 SPI controller support added (PR #84521).
  • RTS5912 Tachometer Sensor driver (PR #86913).
  • STM32N6 USB/UDC: Support added for the USB peripheral and device controller on the STM32N6 series (PR #84976).

Miscellaneous

  • flash_area_copy() API: A new helper function, flash_area_copy(), was added to the flash map API, simplifying the process of copying data between partitions (e.g., for firmware updates) (PR #84604).
  • Xtensa Userspace & Syscall Improvements: Numerous fixes and enhancements were merged for userspace support and system call handling on the Xtensa architecture (PR #88531).
  • LoRaWAN Link Check: Support for the standard LinkCheckReq/LinkCheckAns MAC commands has been added to the LoRaWAN subsystem (PR #87828).
  • Kernel Constructor Handling: Internal handling of C++ constructors (.ctors) and .init_array has been unified and simplified (PR #74700).
  • New CRC Algorithm: Support for the CRC-32K/4.2 algorithm was added (PR #81558).

A big thank you to the 4 individuals who had their first pull request accepted this week, 💙 🙌: @tiennguyenzg, @apni2, @tpambor, and @dhanquna.

As always, I very much welcome your thoughts and feedback in the comments below!

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.

Catch up on all previous issues of the Zephyr Weekly Update:

Categories
IoT Zephyr

Zephyr Weekly Update – Apr. 11, 2025

Hello, Zephyr enthusiasts! It’s been a couple of busy weeks as we move further into the Zephyr 4.2 development cycle. Let’s dive into some of the significant additions and improvements merged over the past couple weeks.

New CI servers are blazing fast

There are literally hundreds of pull requests being submitted to Zephyr every week. We’re trying our best to have them go through a set of relevant tests on our continuous integration servers so that the proposed changes are effectively working, not causing regressions, etc.

With the sheer amount of pull requests involved, our servers are usually VERY busy, pretty much 24/7. Our infrastructure guru Stephanos recently completed the move to Hetzner as our new provider, and we now have a farm of very beefy AMD EPYC™ Genoa 9454P (48 cores / 96 threads!) powered servers that is significantly speeding up the times it takes for pull requests to go through CI (from several hours before to just about 20 minutes now, in most cases).

Interestingly, GitHub just announced this week that they’re making 96 vCPU runners generally available. Priced at $0.384 per minute (!) of usage, it’s a good reminder that Zephyr’s shared development model, with financial support from its member companies, brings a lot of “free” benefits to the community at large.

Twister harness for power measurement

Testing and validating power consumption of embedded systems is often a very manual and time-consuming task.

A new power harness was recently added to Twister, enabling automated power measurement and validation during test runs. As a reminder, a Twister harness is basically responsible for determining whether a given test passes or not. For example, one would often use the console harness to validate console output against e.g. a regular expression to confirm an application is working as expected.

With the new power harness, it is possible to use an external power monitor (the initial implementation supports the STMicroelectronics X-NUCLEO-LPM01A expansion board running PowerShield) to measure the current drawn by the device under test, and to express some “rules” as to what’s considered success or failure (ex. to ensure the peak consumption never goes above a given value).

The pull request that introduced this new feature (#85130) is probably the best starting point at this stage for you to get a closer look at how this works (and it looks like documentation for it is maybe a bit lacking at the moment, unfortunately). I haven’t spent a lot of time digging into this new feature just yet but I would be really curious to see people start extending it to support other popular power monitors such as Nordic’s PPK2, JouleScope, etc.

Bluetooth Hands-Free Profile (HFP) improvements

PR #77694 has recently been merged and it brings a pretty significant update to the already supported Bluetooth Hands-Free Profile (HFP) and adds support for features such as remote volume control, caller ID, memory dialing, and more (it’s over 11,000 lines of code that were added!).

New boards and SoCs

As always, way too many boards added so I am focusing on just a few 🙂

STM32MP135F-DK Discovery
  • STMicroelectronics STM32MP13 micro-processor is based on Arm Cortex-A7, and a lot of work went into not only adding support for it in Zephyr—PR #87687—but basically also introducing Zephyr support for Cortex-A7 in the first place!
    Should you want to get started with Cortex-A7 on Zephyr, I guess you best bet for now is to then use the STM32MP135 Discovery kit port which, quite naturally, was also introduced in the same PR 🙂
  • You may or may not know that Zephyr is widely used to write Embedded Controller firmwares. For example, laptops such as Chromebooks or Framework Laptops are effectively leveraging Zephyr for all kinds of low-level hardware management stuff (power management, keyboard interfacing, etc.).
    PR #87095 introduces support for ITE Tech’s IT51XXX SoC series. IT51XXX is a 32-bit RISC-V microcontroller with 128KB SRAM, 512K-1M of embedded flash, and a variety of buses and peripherals you’d expect to find on a computer motherboard (SMBus, I3C, cryptographic engine, …)
  • Two new XIAO boards from Seeed Studio: XIAO RA4M1 and XIAO MG24.

Drivers

  • A new MBOX driver for Arm MHUv3 (arm,mhuv3) has been introduced. The MHU (Message Handling Unit) is a standard hardware block found in many multi-core Arm MCUs. It is designed to facilitate low-latency signaling and message passing between different cores. (PR #82564)
    You can read more on Arm MHU here.
  • New sensor drivers added for:
    • TDK ICP201XX pressure sensor (PR #83914),
    • Liteon LTR329 ambient light sensor (PR #85453),
    • ESP32-C6 internal temperature sensor (PR #87175),
    • TI DAC161S997 DAC (PR#86285),
    • NXP PCF2123 RTC (PR #88049),
    • PAT9136 Optical Flow Sensor (PR #86747)
  • New driver for the Sitronix ST7701 display controller (PR#85569).
  • New Espressif LP UART driver targetting the Low Power core found on Espressif SoCs such as ESP32-C6 (PR #87684)
  • New driver for the TI BQ25713 battery charger IC (PR #86791).
  • The Silicon Labs EUSART driver now supports Power Management, Asynchronous API, and DMA (PR #85796).
  • I2S support was added for Espressif ESP32 and ESP32-S2 (PR #83710).
  • The Bosch BMA4xx accelerometer driver now supports streaming API (PR #83575).

Miscellaneous

  • Arduino GIGA Display Shield: Support for the display shield designed for the Arduino GIGA R1 board has been added (PR #85569).
Arduino GIGA Display Shield
  • Coredump In-Memory Backend: The coredump subsystem now features an optional in-memory backend, useful for capturing crash information on systems without persistent storage (PR #87565).
    See CONFIG_DEBUG_COREDUMP_BACKEND_IN_MEMORY.
  • Some long overdue improvements to Zephyr’s JSON library, with better support for parsing/serializing “NaN”, “Infinity”, scientific notation, and char arrays. (PR #86956 & #87580)
  • It’s know possible to suspend/resume the task watchdog, which can be useful when the system needs to go into a suspend state. (PR #87590)

A big thank you to the 41 individuals who had their first pull request accepted this week, 💙 🙌: @peterwangsz, @juickar, @seankyer, @raulgotor, @dereje-demant, @Bucknalla, @PicoBoy2017, @aisuneko, @stefan-golinschi, @KwsBaer, @thanhthe23, @pir0n, @manoj-aerlync, @fimohame, @marekmaskarinec, @Yunshao-Chiang, @tq-delimayuki, @Pharb, @kesyog, @AdamOpenshaw, @vbrzeski, @woobacca, @saimohith-google, @lukkelele, @darrenlu-ambiq, @PeggyCienet, @DavidCerrone, @ivanwagner, @derekvalleroy, @caiohbm, @jamesturton, @rob-robinson-14, @cjwinklhofer, @ajordanr-google, @echistyakov, @bukepo, @cichiwskyj, @Tim-Wang38, @Gibson431, @paultimke, and @robertperkel.

As always, I very much welcome your thoughts and feedback in the comments below!

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.

Catch up on all previous issues of the Zephyr Weekly Update:

Categories
IoT Zephyr

Zephyr Weekly Update – Mar. 28, 2025

Let’s catch up on some of the things that happened in Zephyr land since Zephyr 4.1 was released 3 weeks ago. Over 750 pull requests have already been merged so, like always, I’m of course only covering a very small portion of the tremendous activity of the project.

Before diving deeper, don’t forget our upcoming Zephyr Tech Talk next Wednesday, April 2, where David Brown will tell us all there is to know about Rust on Zephyr — what’s there already, what’s coming, and how you can help!

And now for your weekly-ish updates 🙂

Introducing MQTT 5.0 support

We’re getting dangerously close to reaching 90,000 issues/pull requests in the project’s GitHub repository, so it’s not often that an issue in the 20,000 range is being closed 🙂 This week, we just added support for MQTT 5.0 (the project has of course supported MQTT 3.1 for quite a while), which was tracked in issue #21633 open on Jan. 1, 2020!

MQTT 5.0 introduces several improvements over MQTT 3.1(.1), such as the addition of user properties and metadata fields in the CONNECT, PUBLISH, and SUBSCRIBE packets. It also features better error reporting, with reason codes offering clearer feedback when things go wrong.

The addition of MQTT 5.0 support should mostly be transparent for existing MQTT 3.1.1 users 🙂

New boards and SoCs

Some (only a few, really) of the new boards you will probably interested in hearing they are now supported in Zephyr:

Drivers

  • Add support for AXP2101 power management IC, which is mostly replacing the AXP192 and is used in several popular devkits from M5Stack and others. (PR #82474)
  • New driver for Bosch BMM350, a 16-bit high accuracy/low-noise magnetometer. (PR#85174)
  • Vishay VEML6031 Ambient Light Sensor (PR #85818)
  • New stepper driver for Allegro A4979 microstepping motor driver (PR #86620)
  • TDK ICM45686 IMU sensor (PR #85963)
  • PAA3905 optical flow sensor (PR #86644)

Miscellaneous


A big thank you to the 48 individuals who had their first pull request accepted since Zephyr 4.1 was released, 💙 🙌: @Abd002, @yyounxp, @lfilliot, @leonrinkel, @randyscott, @realhonbo, @mthiede-acn2, @tgcfoss, @skwort, @rdagher, @jangalda-nsc, @MichaelFeistETC, @elmo9999, @ecutm1, @nirav-agrawal, @AndreHeinemans-NXP, @XDjackieXD, @m-braunschweig, @rbudai98, @MJAS1, @DanTGL, @sctanf, @cylin-realtek, @ctourner, @WangHanChi, @dlim04, @verenascst, @Titan-Realtek, @Nitin-Pandey-01, @ckhardin, @Quizzarex, @zafersn, @thorsten-klein, @sgilbert182, @sayooj-aerlync, @tervonenja, @dewitt-garmin, @MyGh64605, @povsel, @sarchey, @etiennedm, @phb98, @petejohanson-adi, @Martdur, @ccpjboss, @JBarberU, @bia-bonobo, and @natto1784.

As always, I very much welcome your thoughts and feedback in the comments below!

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.

Catch up on all previous issues of the Zephyr Weekly Update: