This November, we're excited to host a hands-on workshop introducing Thai developers to Silicon Labs microcontrollers with the collaboration between Thai Embedded Systems Association (TESA) and Arrow Electronics (Thailand). The workshop will delve into creating wireless devices that adhere to the Matter protocol. As a preview, I've been working with the EFR32MG24 Dev Kit and am eager to share my initial impressions. While SiLabs might be less familiar to some Thai developers, they're a seasoned player in the industry, renowned for their expertise in Bluetooth, ZigBee, and low-power solutions.
The EFR32MG24 Dev Kit is packed with a wide range of sensors, making it a comprehensive platform for various measurement applications. These sensors include
- Si7021 relative humidity and temperature sensor.
- ICM-20689 6-axis inertial measurement unit.
- Two ICS-43434 stereo MEMS microphones
- BMP384 barometric pressure sensor.
- VEML6035 ambient light sensor.
- Si7210 Hall-effect sensor.
Unlike other development boards that often come with limited on-board devices like LEDs or buttons, the EFR32MG24 Dev Kit offers a much more comprehensive sensor suite.
In addition to its impressive sensor array, the EFR32MG24 Dev Kit is powered by the EFR32MG24B310F1536IM48 processor, featuring 1.5 MB of Flash memory, 256 kB of RAM, and an AI/ML Hardware Accelerator. This powerful combination enables rapid and efficient processing of sensor data, making it ideal for developing machine learning applications such as voice recognition, environment modeling, and user behavior analysis.
The EFR32MG24 MCU in the Series 2 family offers dual-protocol wireless connectivity, supporting both Bluetooth Low Energy and ZigBee on the 2.4 GHz band. This versatility enables a wide range of connectivity options, such as creating Zigbee mesh networks for home automation or connecting to smartphones via Bluetooth Low Energy.
Moreover, the EFR32MG24 Dev Kit is compact, measuring only 3x5 centimeters, and includes a CR2032 battery holder, making it ideal for developing wearable devices and battery-powered IoT applications. The ability to independently power each sensor through individual switches allows for flexible customization and optimization of power consumption, aligning with Silicon Labs' focus on low-power solutions.
Running demoThe EFR32MG24 Dev Kit comes equipped with an on-board J-Link debugger, providing a powerful tool for efficient software development. The J-Link debugger enables real-time debugging, breakpoint setting, and variable inspection. This is my preferred method, though DAPLink is also a viable option.
Simplicity Studio is a free, integrated development environment specifically designed for Silicon Labs products. Its user-friendly interface makes it easy for both beginners and experienced developers to create projects and write code. Simplicity Studio also includes a wide range of sample projects (demos) that allow users to quickly learn and experiment with the board. Simply connect the board to your computer, open Simplicity Studio, and select the desired demo to run.
I tried the GATT Thermometer demo to test reading values from the Si7021 sensor and transmitting them via Bluetooth LE using the GATT protocol through Simplicity Studio. What's impressive is how fast the demo image downloads and installs. Simplicity Studio seems to handle the build and download process automatically, saving me time on additional setup. This streamlined process provided a clear indication of how the device interacts with other hardware.
I used the nRF Connect app on my Android smartphone to connect to the demo device. Discovering and connecting to the device was quick and easy. Once I entered the Health Thermometer service and enabled temperature notifications, I could receive real-time temperature updates every 1 second as configured in the demo. Overall, using the demo app was smooth and met my testing needs perfectly.
Now, try codingBuilt upon the Eclipse framework, Simplicity Studio provides a familiar interface for developers accustomed to other IDEs. The toolchain automatically detects connected boards, simplifying the setup process and eliminating the need for manual configuration.
Simplicity Studio offers a user-friendly experience for creating new projects. By selecting from a collection of demo projects, developers can jumpstart their development process and save valuable time. You can leverage a wide variety of pre-built demo projects as a starting point, which is a great way to quickly evaluate if a particular demo aligns with your project requirements. This streamlined approach makes it easy to get started with developing firmware for wireless communication protocols.
Silicon Labs' Simplicity Studio offers a vast library of over 30 demo projects, each tailored to showcase specific features and applications. Some notable examples include:
- Network Co-Processor: These demo examples demonstrate offloading wireless communication tasks to a dedicated co-processor, interacting with the main processor via UART for efficient and focused operations.
- Matter profile: These demo examples showcase the creation of devices like locks, switches, and sensors that adhere to the Matter protocol, enabling interoperability through Thread networking.
- Network Lighting Control: These demo examples highlight the development of devices such as occupancy sensors and dimming controls for Bluetooth Mesh-based lighting systems.
Once you create a new project, you'll notice a substantial number of files, many of which are dedicated to configuration and build/flash/debug processes. Simplicity Studio operates like most IDEs with two primary modes: code editing and debugging. In the code editing mode, you'll find a pre-configured ARM gcc toolchain (version 12.2.1) ready to build your project into a binary image. Switching to debug mode involves programming this image onto your board.
Let's take the GATT Thermometer example with FreeRTOS as an illustration. While the infinite loop might seem disabled in the initial code, the real logic resides in the app_init()
function. Here, tasks are created to read sensor data and update the corresponding BLE characteristics. The BLE stack handles the underlying communication. After a successful build, examining the memory usage reveals a.text section (code) of approximately 220 KB and a combined.bss/.data section (data) of around 15 KB. Considering the chip's 1.5 MB Flash and 256 KB RAM, there's plenty of room for expansion.
Once the build is complete, pressing F11 or navigating to Run > Debug initiates the debugging process. This triggers the installation and activation of the SEGGER GDB server, establishing a debugging session through the J-Link. The microcontroller is paused at the beginning of the main()
function, specifically at the sl_system_init()
function. From here, you can either resume execution or set breakpoints before continuing.
When it comes to educational tools and entry-level microcontroller development, Arduino is undeniably the industry standard. While Silicon Labs might have been a latecomer to the Arduino ecosystem with their Silicon Labs Arduino Core, they've made a strategic move by partnering directly with the Arduino organization. This collaboration has resulted in the Arduino Nano Matter, a board powered by Silicon Labs' MGM240S MCU, and the official support for Matter APIs.
This partnership is significant because it positions Silicon Labs to become the default choice for Arduino developers working with Matter, a rapidly growing IoT standard. Similar to how third-party vendors have aligned their APIs with Arduino's WiFi and BLE libraries, it's likely that Silicon Labs' APIs will become the de facto standard for Matter development within the Arduino community.
Unfortunately, PlatformIO doesn't currently support Silicon Labs' Arduino Core. This means you'll need to install Arduino IDE 2.x (which many developers may have uninstalled after switching to PlatformIO) as an additional step.
The development toolchain setup is a two-phase process:
- Toolchain Installation: You'll need to manually input the toolchain URL into the Arduino IDE's Preferences and then install the Silicon Labs toolchain via the Board Manager.
- J-Link Setup: Download and install the J-Link software to obtain the JLinkGDBServer program. A custom debug configuration file,
debug_custom.json
, needs to be created specifying the board (xg24devkit), the microcontroller (EFR32MG24B310F1536IM48), and the path to the JLinkGDBServer executable.
To configure your board, go to Tools and select the xG24 Dev Kit. Then, choose Simplicity Commander as the programmer.
[
{
"configId": "SiliconLabs:silabs:xg24devkit:programmer=commander",
"servertype": "jlink",
"device": "EFR32MG24B310F1536IM48",
"interface": "swd",
"serverpath": "C:\Program Files\SEGGER\JLink_V810\JLinkGDBServerCL.exe"
}
]
You can find a variety of example codes under the File > Examples > Silicon Labs menu. For this demonstration, let's choose the 'ble_health_thermometer' example. Copy the 'custom_debug.json' file into the same directory as your project. In the Tools menu, select 'BLE (SiLabs)' as your protocol stack.
Before uploading your code, you'll need to program the bootloader onto the board. This can be done by going to Tools > Burn bootloader. Once the bootloader is programmed, you can build, upload, and debug your code using the respective buttons in the Arduino IDE. After uploading the firmware to the board, you can use the nRF Connect app to scan for Bluetooth devices. You should see the 'Thermometer Example'. However, the temperature reported will be the internal temperature of the microcontroller.
This is a quick unboxing post, still without the details of Matter protocol since I need to prepare a Matter controller and gateway router (devices that control and connect Matter-enabled devices to the internet). The EFR32MG24 Dev Kit offers a smooth and beginner-friendly development experience using Simplicity Studio, which is a great advantage for those new to Silicon Labs MCUs. However, one potential drawback is the relatively large number of files in each project (inherited from the Eclipse Framework). Many of these files are used for configuration and build/flash/debug processes, which might require some time for developers unfamiliar with this approach to understand their purpose and structure.
Comments