Simulating low-power mesh IoT systems in Renode with Silicon Labs Wireless Gecko Series 2
Published:
Topics: Open simulation, Open source tools
Silicon Labs’ 32-bit ARM Cortex-M33-based Wireless Gecko Series 2 SoCs have been available in Renode for a while now. Some time ago, thanks to the collaboration between Antmicro and Silicon Labs, this support has been extended to cover their 2.4 GHz multi-protocol radio connectivity functionality, allowing you to develop and test complex networks of low-power IoT devices built around the popular chip family in Antmicro’s flagship open source simulation framework.
With support for a number of low-power protocols including Bluetooth Low Energy (BLE), Zigbee, Thread, and Matter, in typical scenarios the radios in Silicon Labs’ low-power SoCs are in sleep mode for most of the time to maintain the energy efficiency required by IoT devices that are expected to have a (very) long battery life. From home automation like IKEA’s TRÅDFRI smart lightbulbs, smart locks or thermostats, through voice assistants in wearables, to sensor-rich smart factory and smart city scenarios, Renode’s support for wireless communication in the widely used Series 2 platforms opens a multitude of opportunities for developers and product companies to develop and test their systems in a simulation - without having to rely solely on hardware. Support for Series 3 radios is already in the works which means there is also an easy upgrade path and opportunity for next gen projects to continue end-to-end CI-driven development throughout the product lifecycle.
In this article, we will explore how you can set up and simulate the wireless communication between two boards based on Silicon Labs EFR32xG24 in Renode.
Testing wireless communication in Renode
Renode allows developers to simulate complex multi-node heterogeneous systems, including wired and wireless connectivity using unmodified software. This lets you accurately replicate your development setup; for instance, you can test how firmware for multiple networked devices interacts in different variants and scenarios, without being bottlenecked on physical hardware.
Diving into the example scenario, you first need to ensure you can run the latest version of Renode. On Linux, you can get it by using these commands:
mkdir renode_portable
wget https://builds.renode.io/renode-latest.linux-portable.tar.gz
tar xf renode-latest.linux-portable.tar.gz -C renode_portable --strip-components=1
You can also check the installation instructions for other systems. Renode’s nightly builds repository may be of help too if you’re looking for a specific version.
To start a two-node Series 2 demo in Renode, based on the sample from Simplicity SDK, run the following code:
(monitor) start @scripts/multi-node/efr32xg24-twonode_demo.resc
You can then execute a simple test scenario by running tx 4
in the opened eusart0
console, which will send 4 sample packets between the two created nodes.
In exploring wireless setups, Wireshark is a very useful tool providing information about your IEEE 802.15.4 traffic, like the type of protocol used or byte length of the captured data, as well as more information about the type of data that packet sends.
To set up a connection to Wireshark for realtime packet inspection, you can use the following command, which will let you observe and log only a specific type of wireless communication (like IEEE 802.15.4) between your nodes:
(machine) emulation LogIEEE802_15_4Traffic
More information is available in a dedicated chapter of the Renode documentation
The video below shows the Railtest + Wireshark from the above instructions.
As seen in the video shown above:
Node2:
Node1:
Zephyr support for Series 2 and upcoming Renode support for Series 3
Renode, being a software-agnostic emulator, allows you to run any firmware on these chips - aside from the samples bundled in the vendor-provided SDK, you can also e.g. run Zephyr RTOS. Many SiLabs boards are available in Antmicro’s System Designer, most of them supported in Zephyr. Next to each entry, you will also see an indication of which ones are supported in Renode. Select one, such as Silicon Labs EFR32xG24 Dev Kit, and you can view the results of running samples emulated in Renode.
You can also browse for the boards - and the samples available for them - in the Renode Zephyr Dashboard. The Zephyr samples for these boards are tested in Renode on a regular basis. Among others, Renode supports the following platforms:
RADIO, LDMA, GPIO, AES, GPCRC, RNGCTRL, SYSRTC, TIMER, EUSART, USART, and miscellaneous clock and system control peripherals are among those already supported in Renode.
With the recently announced next-gen Silicon Labs Series 3, works are underway for its support in Renode as per the PR adding SiXG301 support submitted by Silicon Labs. Once added, you will be able to read about that in a new blog note - and, of course, test your new setup based on those chips in Renode.
Testing an IoT mesh network with Renode simulation
Working in Renode simulation grants you a robust sandbox for debugging and validation, where you can develop and test IoT devices faster, and eliminate bugs before rollout, as well as continue improving the quality and shipping new features after the initial deployment.
Silicon Labs Series 2 provides a solid basis for wireless devices such as smartwatches, sensor hubs and intelligent lightbulbs, which you can prototype using Antmicro’s System Designer, and then test in Renode - without even touching the hardware (yet), saving you the time and resources on every stage of the development cycle.
Contact us at contact@antmicro.com so we can assist you in testing your hardware solutions in Renode. Antmicro can also help add your own (proprietary) hardware devices to Renode - so that your tests can incorporate your own platforms.