Categories
Embedded IoT Zephyr

Introducing the Zephyr Weekly Updates

As the Zephyr project continues to grow and evolve, I care deeply about making sure the community stays informed and engaged. To support this, I will start sharing Zephyr Weekly Update blog posts. In this series, I will do my best to highlight key changes, improvements, and noteworthy contributions that made it into the Zephyr GitHub repository over the previous week.

The goal is to provide you with a concise and easily digestible summary of the latest developments, ranging from new features and bug fixes to boards and drivers additions. I’ll probably tend to post these on Fridays, but I thought I would send this one out as it was ready to go!

Now, without further ado, let’s dive into this week’s update!

New boards and SoC support

The BeagleConnect Freedom is a TI CC1352P7-based development
board with enclosure and antenna featuring BLE and SubGHz wireless, 2x
mikroBUS sockets, external flash, light, temperature/humidity sensors,
USB-to-UART bridge, buzzer and battery charger.

BeagleBoard.org BeagleConnect Freedom
BeagleBoard.org BeagleConnect Freedom

A huge congratulations to Jason Kridner and team for not only helping bring support for the TI CC13X2X7 SoC series (cb953a4255) into Zephyr, but also adding support for their new baby, the BeagleConnect Freedom board (a57810dc3b).

If you want to try things out, feel free to head over to the dedicated documentation page and get your first Zephyr apps running on the board. I would love to hear about it if you end up doing so!

Bluetooth

  • Audio: CAP (Common Audio Profile) unicast audio start support and implementation (b71f9f2702, 6866cd30e8)
    • The Bluetooth audio shell now supports the CAP unicast start command. Additionally, the unicast audio start for the CAP has been implemented, providing more functionality for audio streaming.
  • Host: Encrypted Advertising Data and Appearance values (a693b9b33b, 2ffe890b6a)
    • Encrypted Advertising Data is a new feature from the Bluetooth Core Specification 5.4. It provides a way to communicate encrypted data in advertising, scan response and EIR packets.
    • Additionally, new appearance values have been added, making it easier to advertise Bluetooth devices in a standard way.
  • Mesh: Removal of deprecated Health API (08f4a82038)

Drivers

  • ADC: New Atmel SAM ADC driver (0b45710219)
  • Bluetooth: Infineon cyw43xxx BT driver (f91e35d447).
  • Clock: New Atmel SAM PMC driver (88cedcf5c5)
    • The Atmel SAM PMC driver has been introduced, enhancing clock management capabilities for devices based on the Atmel SAM platform.
  • Counter: Device tree adaptation (656b0e6426)
    • The counter drivers (RTC and timer) have been adapted to use the device tree, improving code maintainability and simplifying hardware configuration.
  • DMA: RaspberryPi Pico DMA support (08606eac44)
  • Fuel Gauge: MAX17048 support (2380710020)
  • Retained Memory: nRF GPREGRET driver (9bda013e5d)
    • The nRF GPREGRET driver has been added to the project, providing support for retained memory functionality on Nordic Semiconductor devices.
  • Serial: Virtual UART over ARC hostlink channel (56572687c7)
    • Added support for a virtual UART device that uses ARC Hostlink channels for data transfers.
  • SMBus: SMBus subsystem driver API, and SMBus subsystem shell, Intel ICH/PCH SMbus driver (adff73d618, 5fc55364a2, 4099bc2e63)
    • SMBus (System Management Bus) is a simple two-wire communication protocol derived from I²C that is used for low-speed communication between devices. It is often found in computer motherboards and embedded systems.
    • A new SMBus subsystem driver API has been added, with drivers for the Intel ICH / PCH controller hubs being the first implementors.
    • Furthermore, a shell module for the SMBus subsystem is now available, providing an interactive interface for developers to explore SMBus communication with peripheral devices.
  • SPI: Add Intel SPI penwell driver (3d44508c38)
  • Watchdog: Add Intel TCO Watchdog driver (2fe4a4a218)

Please do not hesitate to share your thoughts and feedback in the comments! As there has been over 400(!) commits last week, I may very well have missed something important so feel free to chime in ☺️.

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.

Categories
Embedded IoT Zephyr

[VIDEO] Embedded World 2023: Zephyr OS – The Open Source RTOS

Last week I attended Embedded World 2023 and had a great time helping out the community at the Zephyr booth.

Ian from Electromaker stopped by and recorded a nice video, and also did a nice write-up on where things are at in Zephyr land.

Enjoy!

Categories
Embedded IoT

3 Free Simulation Tools to Work Around the Global Chip Shortage

There is something that’s been seriously bothering me ever since I started to work with embedded devices: trying out new things when you don’t have an actual device at hand is hard!

Over the years, I’ve had the following happen more often than I care to admit:

  1. 💡 Hear about an interesting embedded tool or library ;
  2. 🧑‍💻 Check out the provided code samples ;
  3. 😔 Realize none work with any combination of the—dozens!—embedded boards and sensors I own ;
  4. 🚶‍♂️ Give up…

With the ongoing global chip shortage, the problem is just so much worse these days. Even if I were to go through the hassle of ordering the required hardware, I would have to face incredibly long lead times—sometimes well over a year!

Do I really want to wait a full year until I get started with my IoT/Embedded project idea?

Luckily, there has been a lot of innovation around making it easier to simulate embedded hardware over the past years, and I have found myself using the following tools on a regular basis.

For each, I will (briefly) explain what they do, what I like about them, and I will include a link to a quick demo for you to realize first-hand how much time they can save you!


Renode

Renode is an open-source framework that allows you to run, debug and test unmodified embedded software right from your PC.

Out of the box, Renode supports a wide variety of embedded boards and peripherals, with more being added regularly. If the board or peripheral you need is not in the list, there is a good chance they can be added with minimal work. Renode has a really elegant and extensible mechanism to describe platforms, as well as to model peripherals.

I am using Renode to drastically simplify and speed up my “inner dev loop” when I build Azure RTOS applications. It can emulate pretty complex peripherals such as LCD touchscreens, which means I can even test my GUIX applications!

Azure RTOS GUIX Home Automation Demo running on a simulated STM32F746G-DISCO board in Renode.

I have to give extra bonus points to Renode for allowing debugging of the simulated code, as well as providing a complete framework for automated testing.

I have assembled in the GitHub repository below some examples of Azure RTOS applications running on Renode, including an example showing how to use the testing framework mentioned above.

There is a lot more that can be done with Renode (multi-node simulation, networking, …) so I will probably write some more about it in the future.


Wokwi

It is becoming increasingly common to develop right from a web browser. While it is a significant paradigm shift for long-time embedded developers, it also brings tons of benefits and makes it much easier to setup reproducible (and versioned!) development environments and toolchains. In fact, I already spoke about this a while ago in this video 😊.

Wokwi is a web-based hardware simulation environment that can be used to simulate a wide variety of micro-controllers (Arduino Uno, ESP32, Raspberry Pi Pico, …) , electronic parts, sensors, and actuators.

At first sight, Wokwi feels like a tool that is only targeting “hobbyists”, but it is in fact really powerful and so much more than a toy (for example, it too does come with debugging support)! It comes with an online web IDE that resembles the Arduino IDE, but you can also bring your pre-compiled ELF binary if you want to keep using your usual development environment.

Beyond the fact that Wokwi “just works” and the fact that sharing a project with someone is as simple as giving them the URL to access it(!), I really love the following Wokwi features:

Example of Wokwi’s Logic Analyzer capturing the I2C traffic between the MCU and an RTC (real-time clock) module.
An external tool such as PulseView can then read and decode the captured traffic.
  • Logic analyzer for capturing/debugging the various signals in your system (ex. I2C or SPI traffic)
  • Network traffic capture for analyzing Wi-Fi traffic in Wireshark. You can e.g. troubleshoot the connection to your IoT cloud, something that’s pretty cumbersome or even impossible to do when running on “real” hardware.

When you use Wokwi to simulate an ESP32 application, you can actually connect to a Wi-Fi, right from within the simulation. Your application may simply connect to the simulated “Wokwi-GUEST” WLAN to access the Internet. Pretty convenient for simulating your next IoT project, eh?

As a way to show you how much easier things are when you don’t have to worry about the hardware, you may check out this Wokwi project.

It is showing the official Azure IoT Central sample code application for ESP32, running in a fully simulated environment. Getting the sample to run is really straightforward:

  1. Create an Azure IoT Central Application, if need, and provision a new device, as per the sample’s instructions.
  2. Enter your Azure IoT Central and device information into the sample’s iot_configs.h.
  3. Run the simulation! The application will automatically get compiled by Wokwi, and then run within your browser.

As the application starts, the simulated device will attach to the—simulated—wireless network, and will show up shortly thereafter in Azure IoT Central.

You will be able to interact with the LEDs or the LCD display by sending commands from Azure IoT Central, as well as see the telemetry corresponding to the various sensors (you can control what “fake” temperature, acceleration data, etc. the sensors are reporting by clicking on them in the Web interface.


TinkerCAD

TinkerCAD’s circuit simulator is the perfect companion to ensure you don’t fry the actual components of your next project.

I discovered TinkerCAD‘s circuit simulation capabilities only recently. Compared to Renode and Wokwi, TinkerCAD will get you the closest to the “metal”. It helps validate the circuit down to making sure you have the wiring 100% correct, and do not risk frying a component due to a missing resistor!

TinkerCAD lets you simulate Arduino UNO and micro:bit-based circuits, but I must admit that I haven’t spent a lot of time using it for actual projects just yet. The fact that it doesn’t allow to simulate network communications makes it a bit impractical for IoT scenarios anyway. However, there are some great projects in the online gallery that should give you a sense of what the tool is capable of.


I highly recommend you give these amazing (and did I mention free?) tools a try.

You should be able to get all the examples I shared up and running in no time, which I hope is making my point regarding how much of a time-saver they can be.

I would also love to hear about other simulation/emulations tools out there that you may be using to speed up your embedded & IoT development workflow—just let me know in the comments!

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.