Categories
IoT Zephyr

Zephyr Weekly Update – Call me maybe 🤙

Today is the last day for new features to get merged into the main Zephyr repository, as the next few weeks will be dedicated to documenting, testing, and polishing the upcoming 3.4 release.

Before diving into this week’s noteworthy updates, and since I know many of you are actually building products based on Zephyr, I wanted to remind you about Zephyr’s Vulnerability Alert Registry.

If you are building a product on Zephyr—and I know many of you are!—you probably want to know ahead of time should a security vulnerability impact you and your customers, so that you can properly address it. I would really encourage you to review the criteria for participation and apply, it should take you literally 30 seconds of your time.

And now for this week’s update 🙂

Bluetooth Telephony and Media Audio Profile

Bluetooth is an incredibly active space, and there are just so many profiles one can chose from to build a standard-based wireless solution. And of course, Bluetooth is particularly popular for all things telephony, so it’s great to see that initial support for Bluetooth LE Telephony and Media Audio Profile (TMAP) was added this week (#56686).

The Telephony and Media Audio Profile (TMAP) establishes configuration settings of underlying audio-related specifications to allow manufacturers to deliver interoperable conversational, streaming, and broadcast audio user experiences in a wide variety of telephony and media products. This includes products such as headsets, TVs, smartphones, personal computers, headphones, earbuds, wireless speakers, and wireless microphones.

https://www.bluetooth.com/specifications/tmap-1-0/

Two samples have been added: tmap_central mimics a smartphone while tmap_peripheral reflects an earbud that would act as a Call Terminal, with audio being streamed from the “smartphone” upon connection.

Huge kudos to Silviu Petria from NXP, as this is their first contribution to Zephyr, and a pretty significant one!

MCUboot on ESP32

When using Zephyr on ESP32, one would have historically relied on the ESP-IDF bootloader as the second-stage bootloader. The typical application startup flow is actually very well described in the ESP-IDF documentation.

With the merge of pull request #54835, MCUboot bootloader can now be used instead, and developers can handle firmware signing, over-the-air updates, etc. in a familiar manner.

Read more in the documentation of each ESP32 supported board.

New memory barrier API

A new API has been introduced for data memory barriers. Data barriers are essentially a way to nicely tell your processor: : “Hey, I know you like to rearrange tasks for efficiency, but these particular memory operations need to happen in the exact order I’ve given them! 😘“. This is particularly useful in Symmetric Multi-Processing (SMP) scenarios, but can also be needed in multi-threaded applications or when hardware is accessed asynchronously.

The new barrier API enables a more consistent way to implement synchronization fences, regardless of the processor architecture. (#57439)

Twister adds GoogleTest support

GoogleTest (a.k.a gTest), is a unit testing library developed by Google. It is used for writing test cases in C++ and supporting test-driven development. It provides a rich set of assertions, automatic discovery of tests, and a human-readable test output format.

Thanks to Yuval’s contribution in PR #58046, Twister now supports using GoogleTest as a harness for your tests, bringing you an alternative to ztest, pytest, etc..

Boards, shields & SoCs

This been has been pretty busy on this front as a few boards were added. What’s more, I always find it nice when existing boards and SoCs get even fuller support for Zephyr (see Xtensa MMU work below).

  • The Kria KV260 AI Starter kit from Xilinx is a devkit for the Kria K26 SOMs that targets avanced edge computer vision scenarios. It includes a real-time processing unit (RPU) based on a dual-core Cortex-R5F, and #54916 introduces support for it. Head over to the dedicated documentation page for more info.
  • Initial support for Xtensa MMU version 3 has been added (#57908) and can be enabled through the XTENSA_MMU KConfig flag.
  • A CAN driver for Microchip SAMC21 has been added (#50408)
  • An update has been made to the Panasonic Grid-EYE shield, which is an evaluation shield for the AMG8833 8×8 pixel thermal camera. Read more here (#53244)
STM32L475 Pandora board
  • The STM32L475 Pandora board from Alientek is now supported thanks to @QinYUN575‘s first contribution to the project 🙂 (#55577)

New drivers

  • A nice addition to the SPI driver is that it now allows collecting statistics (number of bytes transmitted/received, # of transfer errors, …). This feature can be enabled using the SPI_STATS KConfig option. (#57767)
  • Fuel gauges:
    • Fuel gauge driver API now includes support for relative-state-of-charge and absolute-state-of-charge (existing drivers for MAX17048 and generic SBS have been updated to reflect the change). (#57824)
    • SBS fuel gauges expose informations such as chemistry, manufacturer name, device name, … through buffer registers. They can now be accessed through the newly introduced fuel_gauge_get_buffer_property API (#58014).
    • Shout out to Microsoft for the great contributions in this area!
  • The ADP5360 from Analog Devices is a one-stop shop battery management PMIC with ultra-low power fuel gauge, battery protection, buck regulator, and more. The initial version of the driver that got added this week adds support for the buck/buck boost part of this IC. (#58184)
TSC 3400 diagram
  • A new driver is available for the TSC3400 color sensor. An interesting feature of this sensor is that it actually includes 5 channels. Beyond red, green, and blue, you also get a “Clear” channel for measuring overall luminosity, and “Infrared” which can be used for measuring color temperature. (#58144)
  • I’ve had my eyes on recently merged pull request #48389 for a long time, as it adds support for the Microchip MCP9600 thermocouple amplifier. It supports most types of thermocouples, meaning that you can aim for as cold as -200℃ or as hot as 1,800℃! As I plan on building a Zephyr-based temperature monitor for my raku pottery kiln, I am really happy to see this driver merged in the official repo!
  • A new driver is available for ARC DesignWare Data Fusion Subsystem SPI (#56925)
  • ADC driver has been added for Renesas Smartbond. Both GPADC (10-bit resolution by default) and SDADC (14-bit) are supported. (#57164)
  • Added USB interface driver for the Renesas Smartbond DA1469x device family. (#56977)
  • An initial version of a driver for Infineon CAT1 watchdog has been added (#57910)

Miscellaneous

  • You can now enable or disable the shell prompt using the shell prompt [on|off] command. (#57736)

A big thank you to the 16 individuals who had their first pull request accepted this week 💙 🙌: Chad, Silviu, Nathan, Denis, Peter, Oscar, Niek, Rander, Chris, Michael, Nils, Matthias, Disha, Lukasz, TianShuang, and Bansidhar.

As always please feel free to jump in with your thoughts or questions in the comments below. See you next week!

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 the editions of the Zephyr Weekly Update:

Categories
IoT Zephyr

Zephyr Weekly Update – Zephyr 3.4 less than a month away!

With the Zephyr 3.4 release being less than a month away, there is increased activity in the Zephyr repository, and some substantial features are about to be merged. While this week might seem a bit more quiet than usual (which, in Zephyr terms, still means that 130+ pull requests got merged 😊) I expect next week to be packed with some really cool stuff.

Zephyr SDK gets updated to 0.16.1

A really big benefit of Zephyr is the fact that it comes with its own SDK or, in other terms, a pre-packaged version of the toolchains for all the architectures that Zephyr support, plus host tools such as OpenOCD, QEMU, etc. This can throw some people off as it feels like “downloading the earth” the first time you setup your Zephyr developer environment, but this is incredibly convenient on the long run. It also makes your life easier since you know you’re going to be basing your development off the exact same one that Zephyr maintainers all around the world (and our CI jobs) are using daily.

A minor update of the SDK (v0.16.1) has been made available by Stephanos this week. Check out the release notes and consider upgrading your SDK install if any of the addressed issues and added toolchains are relevant for you (if not, there’s probably no pressing need for you to update).

MCUmgr

I’ll probably come up with a blog post fully dedicated to MCUmgr in the future, as it’s one of those Zephyr capabilities that deserve to be more widely advertised. In a nutshell, it lets you perform all kinds of device management operations on your device, over-the-air (ex. BLE) or through serial or UDP connections.

With PR #54041, MCUmgr’s Simple Management Protocol (SMP) has been updated and commands can now return more detailed error responses for each command group.

Drivers

  • Jailhouse is a static partitioning hypervisor that can be used to create and manage isolated environments, or “cells,” on a multi-core system. PR #55202 makes it possible for cells to communicate with one another using Ethernet over Inter-VM shared memory.
  • The LSM6DSV16X sensor from STMicroelectronics is a high-performance, low-power 6-axis IMU, featuring a 3-axis digital accelerometer and a 3-axis digital gyroscope. #57688 added a driver for the sensor and, similar to the LSM6DSO16IS I covered last week, it is also possible to use the sensor as a sensor hub.
  • There’s some cool stuff in the works around all things battery charging, and a related addition this week is the fact that fuel gauge drivers can now expose RemainingCapacityAlarm and RemainingTimeAlarm properties. (PR #57446)
  • The MEC172x from Microchip is a Cortex-M4F based embedded microcontroller well-suited for e.g. keyboards or notebooks. It provides Hardware Root of Trust and has a hardware accelerator for cryptographic operations. #57511 added a driver for the chip’s crypto engine, and exposes APIs to use hash algorithms such as SHA-224, SHA-256, SHA-384, and SHA-512. A code sample has also been added.
  • The driver for OnSemi’s MT9M114 camera sensor now supports YUV pixel format. Special thanks to @jeronimoagullo for their first accepted contribution to Zephyr! 🥳

Boards & SoCs

  • NXP contributed support for the MIMXRT1062-FMURT6 board #57382
  • A Bluetooth driver for the PSoC™ 6 BLE Prototyping Kit has been added with PR #57160.
  • I2S support has been added for NXP RT595 board (#57620).

Miscellaneous

  • Zephyr’s RTIO (real-time I/O) subsystem exposes a standard mechanism to enable complex, event-driven I/O handling by abstracting out some of the complexity inherent to DMA and interrupts. With PR #57823 the RTIO subsystem now provides an API for cancelling submission queue entries.
  • PR #54761 adds support for block transfer in LWM2M.
  • When using BLE Audio’s Basic Audio Profile, the Read Long procedure is now supported in both the unicast client and server. #54363

As always please feel free to jump in with your thoughts or questions in the comments below. See you next week!

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 the editions of the Zephyr Weekly Update:

Categories
IoT Zephyr

Zephyr Weekly Update – May 12, 2023

Happy Friday! Another week, another round of new features, drivers, and more. Before jumping into the actual news, I want to mention that I will soon be launching a recurring series of Virtual Zephyr Talks. These will be video interviews and presentations with guests from the embedded and IoT community at large, where we will discuss best practices, tech news, and maybe more importantly answer all the questions you may have, live!

I encourage everyone to subscribe to the Zephyr YouTube channel, if you haven’t already, as this will allow you to not miss upcoming notifications and live streams when we go live with this in the next few weeks. Also, if you are reading this and feel like you would have something cool to show off during an upcoming episode, please shoot me a message!

AWS IoT Core Sample

Lucas Dietrich contributed a comprehensive code sample that demonstrates how to publish messages to AWS IoT Core from a Zephyr application using the MQTT protocol. It includes key concepts such as establishing a TLS 1.2 connection, subscribing to a topic, and of course publishing data.

“This sample can be used as a starting point for developers who are interested in building their own IoT solutions using Zephyr RTOS and AWS IoT Core.”

Lucas Dietrich

Head over to the sample documentation page to get all the info you need to run it on your own device! 🙂

New boards, shields & SOCs

Infineon Technologies PSoC™ 6 BLE Prototyping Board
  • The PSoC™ 6 BLE Prototyping Board is a low-cost development board for designing and debugging solutions based on the PSoC 6 MCU from Infineon Technologies. As you can see in the picture, the PCB is split in two halves — you can just snap away the programmer and debugger module from the main board as you’re getting to the final stages of your prototyping phase!
    PR #56169 added the board definition to Zephyr, with lots of on-board features being supported out-of-the-box, including of course Bluetooth.
NXP RT1040 EVK
  • NXP’s RT1040 EVK is now supported in Zephyr! This devkit comes with the i.MX RT1040 MCU (Cortex-M7, 600 MHz), 256MB of RAM, 64MB of QSPI Flash, Ethernet, a CAN transceiver, …
  • The board definition for NXP i.MX8’s Audio DSP core has been updated (PR #57084) and now supports UART.
  • The board definition for NXP MIMXRT1010-EVK evaluation kit now contains a description of its Arduino headers making it easier to use Arduino shields more transparently, i.e. you can simply mount the shield’s sensors and peripherals on arduino_i2c or arduino_spi and they will just work (PR #57433).
  • Single-threading support has been added for the RISC-V architecture (PR #53346). When in single threaded mode, only the main thread is enabled and as such, Zephyr will look for a main() function to execute.
  • GDMA (General Direct Memory Access) support has been added for ESP32S3 SoCs (PR #57495). GDMA is a feature that allows peripheral-to-memory, memory-to-peripheral, and memory-to-memory data transfer at a high speed. The CPU is not involved in the GDMA transfer, and therefore it becomes more efficient with less workload.

Drivers

I really enjoy keeping an eye on the changes on the sensor driver front, as it is a good opportunity to learn about potentially lesser known types of sensors, so I’m glad this week has been pretty active for all things drivers!

IMU Sensors

  • The BMI323 from Bosch Sensortec is an IMU (Inertial Measurement Unit) that provide acceleration and angular rate measurement. It can be used for motion detection, fitness tracking, … Bjarki added support for it this week via PR #56594, and it features lots of Zephyr goodness.
    One thing that I particularly like is that the driver leverage’s Zephyr power management capabilities to allow the sensor to achieve the lowest possible power consumption until it’s effectively resumed.
  • Another IMU sensor to join the hundreds of already supported ones is the LSM6DSO16IS from STMicroElectronics. The interesting thing with this one is its ISPU (Intelligent Sensor Processing Unit) which allows to run advanced signal processing and AI algorithms right on the sensor. The sensor can also act as a sensor hub for sensor fusion scenarios, and it can collect data from up to 4 external sensors attached to it.
    The new driver supports fetching accelerometer and gyroscope data, as well as fetching data from the “companion” sensors that may be connected to the hub.

Display

  • Support has been added for the SSD1680 electronic paper display chip (commit #daf9030f).
  • Related: the generic SSD16xx display driver has seen a significant improvement that now allows to get much better control on partial refreshes (PR #48163). Board and shields featuring e-ink displays have been updated to use the newly added refresh profiles.

ADC

  • The recently added driver for Texas Instruments ADS114S0x ADC now allows access to the port expander (PR #55789).
  • ADC driver has been added for the i.MX 6SoloX Processors (PR #40355).
  • As part of ongoing housekeeping efforts, the ADC driver for STM32 has been updated to allow setting sampling time directly through the Devicetree (PR #57342).

Others

  • OpenTitan is an open source silicon Root of Trust (RoT) project that uses the LowRISC RISC-V core. A driver for OpenTitan SPI host has been added (PR #54639).
  • The driver for NOR Octo-SPI flash on STM32 has been improved to wait for the erase operation to complete before returning (PR #56472). This fixes potential issues when one would try to access the chip while a (typically long) erase operation was still in progress.
  • An initial version of Infineon CAT1 flash driver has been contributed (PR #56667).

Wi-Fi

  • One of the Wi-Fi power saving features consists in advertising a listening interval (“I will be sleeping–to save power–and only waking up every X beacon intervals. #kthxbai”). Thanks to PR #57116, the Wi-Fi API and shell commands make it possible to configure the “Listen Interval” power save mode
  • It is now possible to access raw Wi-Fi scan data. The wifi scan shell command has also been updated to output the raw scan data should the feature be enabled (PR #57699).
  • If you are using Wi-Fi on ESP32, you will be interested in learning that you can now use the wifi scan and wifi status shell commands, thanks to the fix in PR #57627.

USB

  • The USB Battery Charging (BC) v1.2 specification defines limits and detection mechanisms for USB devices to draw current exceeding the USB 2.0 specification limit of 0.5A, 2.5W.
    Support for allowing BC1.2 peripherals to act as a charging device–a capability often provided on USB Type-C ports–has been added to Zephyr with PR #57101).
  • USB Communications Device Class (CDC) Ethernet Control Model (ECM) class has been added to the new experimental USB device support.
    The USB CDC-ECM specification allows devices to use a USB interface to emulate an Ethernet network connection. In simpler terms, it allows a device to connect to a network (like the internet) through a USB connection instead of a traditional network cable. See PR #54448.

Miscellaneous

  • Several notable Bluetooth bug fixes:
    • #56034 Bluetooth: Audio: CSIP set member register fix.
    • #57650 Bluetooth: Controller: Fix incorrect use of rx buffer in Tx ISR.

As always please feel free to jump in with your thoughts or questions in the comments below. See you next week!

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 the editions of the Zephyr Weekly Update: