Categories
IoT Zephyr

Zephyr Weekly Update – New SoC porting guide

Before diving into this week’s updates, a quick reminder about our upcoming Zephyr Tech Talk, next Thursday, May 30!
We will be discussing all things tracing and profiling, and I am really looking forward to seeing lots of live demos of some of the tools available out there that can really help you understand better what’s really going on under the hood of your favorite RTOS, as well as potentially identify performance bottlenecks.

MQTT-based sensor/actuator code samples

We have a new code sample that might be one of the most comprehensive to date in the Zephyr tree.

It demonstrates how to implement a simple IoT sensor that publishes sensor data over MQTT. IoT 101, you might say, but the sample is a great showcase of the many services one needs to support such a scenario, among which:

  • Establishing network connectivity using DHCP ;
  • Establishing a secure MQTT connection (using TLS 1.2) ;
  • Using JSON to encode sensor data and send it at a user-defined interval (would be curious to see CBOR or other encoding formats introduced as alternatives) ;
  • Subscribing to user-defined topic(s) on the MQTT server, e.g. to receive commands ;
  • etc.

New SoC porting guide

A new documentation page describes the process of porting a new SoC to Zephyr.

This is a most welcome addition, that complements the existing architecture and board porting guides, and will be very useful for anyone looking to add support for a new SoC to Zephyr. (PR #69475)

Boards & SoCs

  • Several additions to the list of peripherals supported for Renesas Smartbond SoCs: memory controller, added power management support to the crypto and MIPI DBI driver, … (PR #68023, #72994, #72819)
  • Apollo 3 SoC series getting some love as well, with new counter driver (PR #72842), I2C (PR #72913), and watchdog (PR #72830)
  • Added support for NXP Kinetis KE1xZ series. KE1xZ MCUs are based on a Cortex-M0+ core, running up to 96 MHz. These MCUs support up to 512 KB flash, 96 KB RAM, and a complete set of analog/digital features. (PR #71670)
  • Added support for Microchip MEC5 SoC family. (PR #72876)

New boards and shields:

  • Added support for NXP FRDM-RW612 board.
    The RW612 is a highly integrated, low-power tri-radio wireless MCU with an integrated 260 MHz ARM Cortex-M33 MCU and Wi-Fi 6 + Bluetooth Low Energy (LE) 5.3 / 802.15.4 radios. (PR #72306)
  • Alongside KE1xZ SoC support, the NXP FRDM-KE15Z is now also supported. It contains a robust TSI (touch sensing interface) module with up to 50 channels, making it highly flexible for handling touch keys.
  • USB device controller now available for nRF54H20 DK. (PR #72774)

Drivers

  • It seems like the Video subsystem is getting some attention recently, and it is really nice to see a new driver just landed for the OV5640 CMOS 5-Megapixel image sensor. (PR #71854)
  • New driver for Festo VEAA-X-3 series proportional pressure regulator. (PR #69047)
  • New LED Strip driver for Texas Instruments TLC59731. TLC59731 is a 3-channel, 8-bit, PWM LED driver with single-wire interface based on the EasySet protocol. (PR #68617)

Miscellaneous

  • A new rtt-console snippet has been introduced to quickly switch serial console output to Segger J-Link RTT.
  • When using the sensor_shell code sample, you can now include a fake sensor implementation, which can help when you don’t have an actual sensor at hand 🙂 (PR #72833)
  • You may now enable CONFIG_EXCEPTION_STACK_TRACE_SYMTAB to have symbol names printed in stack traces on Arm64 and RISC-V. (PR #72973)
  • Added a new module implementing MIPI STPv2 (System Trace Protocol). MIPI STP was developed as a generic base protocol that can be shared by multiple application-specific trace protocols. The new module can be used to decode a stream of STPv2 data. (PR #72151)
  • Add a modem backend statistics module.
    Similar to how you can use kernel stats to e.g monitor how “high” your threads go, you can use this new module to keep an eye on buffer usage within the modem subsystem, and use the information to optimize their size. (PR #72576)
uart:~$ modem_stats buffer
ppp0_rx: used at most: 124 of 2048 (6%)
ppp0_tx: used at most: 2048 of 2048 (100%)
uart@b000_rx: used at most: 233 of 4096 (5%)
uart@b000_tx: used at most: 4062 of 4096 (99%)
cmux_rx: used at most: 124 of 2048 (6%)
cmux_tx: used at most: 2047 of 2048 (99%)
dlci_1_rx: used at most: 124 of 2048 (6%)
dlci_2_rx: used at most: 25 of 1024 (2%)
  • Hierarchical state-machine operations in SMF (State Machine Framework) now follow a more “UML-like” transition flow. (PR #71729)
  • New sys_bitarray_* APIs to now allow “popcount” (count how many bits are set), xor with another bitarray, as well as find the Nth bit set in a region. (PR #72901)
  • New Kconfig, CONFIG_MEM_DOMAIN_ISOLATED_STACKS — on supported architectures, thread stacks within the same memory domains are now isolated, i.e. threads within the same memory domains have no access to others threads’ stacks.
  • Added support for bt_disable in the ISO implementation. (PR #72690)
  • west build now allows to pass the list of shield(s) you want to add to your board via the --shield argument — much more natural than the old way of passing -DSHIELD as a CMake parameter. (PR #72720)
  • USB device “next” stack now has initial support for BOS (Binary Object Store). (PR #72215)

A big thank you to the 7 individuals who had their first pull request accepted this week, 💙 🙌: @alex-bellon, @charliegilliland, @luqasn, @roger1wang-intel, @nicogrx, @zaporozhets, and @srmnw.

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 – LLEXT extension development made easier

A very cool addition this week makes the lives of LLEXT extension developers easier, and makes me think I should already start working on some nice demos for when it will be time to announce Zephyr 3.7 (which is not until late July, though!). Check this out, alongside other cool news, in this new weekly update 🙂

Extension developer kit for LLEXT

Introduced with the latest Zephyr 3.6 release, the LLEXT (Linkable Loadable Extension) subsystem has been gaining a lot of traction lately.

In many cases, people developing the “core” of a Zephyr application designed to be extensible (e.g. a smart home gateway with a fancy display allowing for news “apps” to be added) are not the same people that will be developing the extensions (e.g. an energy monitoring or a weather forecast application, to take the previous example). LLEXT extensions as usually meant as lightweight “plugins” that use a well-controlled and limited set of APIs ; therefore, asking developers to setup a full-blown Zephyr development environment is overkill and error-prone.

This is where the new LLEXT Extension Developer Kit (EDK) comes in: it simplifies the development of extensions outside of the Zephyr tree, by allowing to generate an “SDK” (using west build -t llext-edk target) that packages all the necessary headers and compile flags relevant in the context of a given Zephyr app, effectively providing extension developers with all they need to start hacking away!

Try out the new EDK code sample and see PR #69831 for more details.

Sysbuild multi-target sample

As a way to make it easier to grasp the concepts behind sysbuild, and how it can be used to build multiple facets of your application at once (ex. the actual Zephyr application alongside an MCUboot bootloader), a new “multitarget Hello World” code sample has been introduced.

It showcases a classical Hello World application, except that it also includes the configuration files and explanation on how to build it and flash it for multiple targets (ex. different SoC cores), also leveraging the new hardware model and board target terminology in the process. (PR #69652)

Boards & SoCs

  • New ARM architecture Kconfig options CONFIG_ROMSTART_REGION_ADDRESS and CONFIG_ROMSTART_REGION_SIZE allow to relocate the rom_start region (that typically contains the boot-vector data and irq vectors) to a custom region. (PR #71684)
  • Removed limitation to 4 CPUs for SMP on x86, and also updated Zephyr kernel limitation to 32 CPUs (instead of 8) in the meantime! (PR #60230)
  • Power management support added to Renesas SmartBond UART. (PR #62190)
  • Power management support added to NXP RW61 SoC series. (PR #72758)
  • Added USB support for NXP MCX N947. (PR #72386)
  • Added RTC alarm support for all STM32 MCU series. (PR #71957)

New boards and shields:

STWIN.box
STWIN.box from STMicroelectronics
  • The STWIN.box (a.k.a. STEVAL-STWINBX1) from STMicroelectronics packs an impressive amount of sensors (accelerometer, magnetometers, MEMS microphones, …) and has Wi-Fi, Bluetooth, and NFC connectivity as well. It is now supported in Zephyr 🙂 (PR #72723)
  • STM32H745I Discovery kit is a complete demonstration and development platform for STMicroelectronics Cortex-M4 and M7 based STM32H745XI MCU. (PR #72510)

Networking

  • There is now a really great documentation page for the new HTTP server. It compliments the existing code sample quite well and really gives you all you need to know how to declare static resources, expose WebSocket endpoints, etc.
  • A new net http shell command gives you the ability to get a quick snapshot of the HTTP resources currently available. (PR #72578)
Host:Port       Concurrent/Backlog        Resource type   Methods         Endpoint

192.0.2.1:80    1/10                      dynamic         GET,POST        /dynamic
                                          static          GET             /
                                          websocket       GET             /

1 service and 3 resources found.
  • TLS sockets have been available and use in Zephyr for quite a while, so it was long time due that they’re no longer marked as “experimental)”. (PR #72482)

Drivers

  • There were several improvements made to the LED strip driver class this week, including new API function to get the length of an LED strip at runtime, which is now also a mandatory binding property alongside color-ordering. (PR #71630)
  • I2C driver for ESP32 now allows for clock speed to be configured at runtime. (PR #72380)
  • Added support for GPIO for Apollo3 SoCs. (PR #72438)
  • Added the ability to read the advanced capabilities (GETCAPS) of an I3C target. (PR #71792)
  • Added DAC and ADC drivers for the General Analog Unit (GAU) peripheral as found on NXP RW SoCs. (PR #70506)
  • New driver for Innovative Sensor Technology TSic xx6 temperature sensors. These are low-power, calibrated sensors with accuracy as high as ±0.07 °C at +20 °C. (PR#70432)
  • Added support for DS18S20 High-Precision 1-Wire Digital Thermometer (maxim,ds18s20) to the existing DS18B20 driver. (PR #71286)

Bluetooth

  • Bluetooth BAP (Basic Audio Profile) shell now supports receiving audio data from e.g. a PC over USB, and encoding it using LC3 before sending it. to BAP audio streams. (PR#71084)
  • Added support for Hands-free Audio Gateway (AG), which can be enabled using CONFIG_BT_HFP_AG). The audio gateway profile allows the microphone/speakers of a Bluetooth device (ex. a computer) to be used as an audio input/output device for another Bluetooth device, such as a mobile phone. (PR #70532)
  • Simplified Kconfig options and interface between the host and controller. (PR #72580)

Miscellaneous

  • I think a lot of people don’t necessarily know it, but Zephyr has a complete State Machine Framework (SMF) that can greatly simplify the implementation of protocol stacks, graphical user interfaces, etc. There are a few places in Zephyr where SMF is being used, but until this week there was no dedicated sample showcasing SMF “on its own”. Thanks to an awesome contribution from Glenn Andrews, it’s not the case anymore, and I highly encourage you to check out this new sample! (PR #70921)
  • A new build option, enabled via CONFIG_BUILD_OUTPUT_COMPRESS_DEBUG_SECTIONS, allows to compress debug sections and therefore reduce size of ELF files substantially. (PR #72436)
  • As part of ongoing work to move away from TinyCrypt and towards PSA (#43712), MCUmgr switched to PSA for its crypto operations (ex. checksum and hash functions). (PR #71947)
  • Added initial HID device support to the USB “next” stack. (PR #65801)
  • Several welcome fixes and improvements were made to the scripts/footprint/size_report script. (PR #72316)
  • When using deferred logging, new log_thread_trigger() API allows to essentially flush the log buffer by forcing the log thread to process any pending messages immediately. (PR #71530)
  • nRF Services library is now available for the Nordic HAL. (PR #70245)

A big thank you to the 7 individuals who had their first pull request accepted this week, 💙 🙌: @trunghieulenxp, @jlh-makeen, @darkmoon32, @AyushKot96, @mstumpf585, @dapperlo, and @Rafal-Nordic.

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 – Always a Zephyr meetup near you!

Happy Friday! Before diving into this week’s news, I wanted to remind you about the now almost weekly Zephyr meetups happening all around the world.

It is really great to see the community coming together to share their experiences, and I highly encourage you to check out if there’s a meetup happening near you. If not, you may actually be interested in starting one yourself!

Next up is Cologne, where a second Zephyr meetup is already held after a very successful first edition a few months back!

Update to Python 3.10 as min version

A small but noteworthy change: ahead of the upcoming Long-Term Support version of Zephyr, and in order to make sure we support a minimum version of Python that’s consistent with their own LTS cycles, Zephyr now requires Python 3.10 as the minimum version. PR #72142

SoC-wide overlays

Historically, Devicetree/Kconfig overlays have always been board specific. With the introduction of the new hardware model, it is now possible to define overlays that apply to an entire SoC series, which can be really convenient, as illustrated with this recent update to the Wi-Fi code sample, which now doesn’t require zillions of repetitive overlays for all the different ESP-32 boards supported in-tree, but instead just a few only based on the actual SoCs.

Bash completion for Twister commands

I am frankly always struggling to know how to run Twister test suites from the command line, and I spend a ridiculous amount of time either going through my shell history or recent CI jobs to find the options I need. Therefore, I am really happy to see that there is now bash completion for Twister! (PR #72167)

Boards & SoCs

  • Support has been added for Ambiq Apollo3 Blue and Apollo3 Blue Plus SoCs, alongside associated evaluation boards. Apollo3 Blue series are ultra-low power Cortex-M4F MCUs with an integrated Bluetooth 5 controller. (PR #67815)
  • New MDIO driver (Management Data Input/Output) for STM32. (PR #71012)
  • New video driver for STM32 Digital Camera Memory Interface (DCMI). (PR #71462)
  • GCC toolchain configuration updated to support Arm Cortex-R82. (PR #72279)

New boards and shields:

  • Added support for Croxel CX1825 Bluetooth prototyping board. (PR #71901)
  • New shield defintion for Seeed Studio Round Display for Xiao. (PR #71239)
  • A small yet noteworthy change to the STM32C0116-DK board definition added last week. This board features a 5‑way joystick hooked up to a single ADC input pin using a resistor ladder. The adc-keys driver allows to quickly define which voltage range corresponds to each key combination, making it straightforward to expose all the relevant key codes to the input subsystem. (PR #72315)
adc-keys {
	compatible = "adc-keys";
	io-channels = <&adc1 8>;
	keyup-threshold-mv = <3300>;

	select_key {
		press-thresholds-mv = <0>;
		zephyr,code = <INPUT_KEY_SELECT>;
	};

	left_key {
		press-thresholds-mv = <670>;
		zephyr,code = <INPUT_KEY_LEFT>;
	};

	// ...
};

Networking

  • I mentioned it was coming last week… turns out it’s already there: the new HTTP server now supports WebSocket! (PR #72241)
  • Added support for gratuitous ARP transmission. A device may send such a packet on a local network to announce or update its own IP-to-MAC address mapping. It’s particularly useful for ensuring that devices that frequently enter deep sleep mode are immediately recognized by their peers upon reconnection. (PR #71873)
  • Added support for IPv6 Privacy Extension (RFC 8981). (PR #71996)
  • Updated hostap module. (PR #71805)

Drivers

  • New driver for Sequans GM02S cellular modem. (PR #72217)
  • New driver for LuatOS Air530z GNSS receiver. (PR #72053)
  • New driver for Texas Instruments INA226 bi-directional current/power monitor, which can be used to sense current/voltage on buses up to 36V. (PR #68368)
  • New multi-function device driver for Analog Devices ADP5585 keypad decoder, I/O expander, and PWM generator. (PR #69330)
  • New driver for IS66WVQ8M4 PSRAM. (PR #70620)
  • Several cool improvements to GROW_R502A fingerprint sensor (why yes, Zephyr has support for fingerprint sensors, in case you didn’t know!). (PR #59654)

Miscellaneous

  • Various Twister optimizations and speedups, which according to the author should speed up execution times by 5-7%. (PR #71694)
  • Added support for Bluetooth Common Audio Profile Commander Reception start procedure. (PR #69593)
  • A couple new useful shell commands:
    • The GPIO shell module now features a toggle command to… toggle a GPIO :). (PR #72362)
    • The I2C shell module now has a direct_read command, which reads directly from the I2C device without first writing a register address. (PR #71928)

A big thank you to the 11 individuals who had their first pull request accepted this week, 💙 🙌: @bogdanovs, @smaerup, @debbiemartinarm, @vThibo, @louis-feller, @RafaelLaya, @russkel, @davidschneider-cpi, @markaj-nordic, @schumphi, and @AlessandroLuo.

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: