BLE Support for XIAO MG24 in PlatformIO

* Warning TLDR :bow:

So I’m spending a few days deep diving into the subject;
I can’t say I’m surprised though… I will spoiler ALERT
and Say IMOHO… THE JUICE is NOT worth the Squeeze.

Bottom line: *MG24 devices do support OTA firmware updates over BLE, but at present this is facilitated only by Silicon Labs’ SDK and bootloader infrastructure. Arduino-compatible support is limited – you can program the MG24 using Arduino, but performing a BLE OTA update will still rely on Silicon Labs tools or low-level APIs. It’s feasible to adapt Silabs’ OTA examples into an Arduino project, but no turn-key Arduino library exists as of now. Thus, developers should be prepared to use the Gecko Bootloader, Silicon Labs GSDK components, and possibly Simplicity Studio or Commander in conjunction with the Arduino workflow to achieve OTA updates on the MG24 family.*​docs.silabs.comdocs.silabs.com

Al Amalgamated the research and the conclusions you can as I did draw for yourself. It’s just NOT there.

My premise Question is ? " BLE OTA Support for Silicon Labs MG24 Devices in Arduino "

Enjoy (preferably read before bedtime)

BLE OTA Updates on Silicon Labs MG24 (EFR32xG24)

Silicon Labs OTA DFU Support (Simplicity Studio)

Silicon Labs EFR32MG24 (MG24) devices do support Bluetooth Low Energy (BLE) based OTA (Over-the-Air) firmware updates, but this capability is primarily provided through Silicon Labs’ Gecko SDK and bootloader framework. In the official Simplicity Studio environment, BLE OTA DFU is enabled by adding a dedicated OTA Service to the device’s GATT server and using the Gecko Bootloader on the device​docs.silabs.comdocs.silabs.com. Most Silicon Labs Bluetooth examples (for example, the “SoC Thermometer” demo) already include this OTA DFU service in their GATT database. When the OTA service’s control characteristic is triggered, the device enters DFU mode and accepts a new firmware image via BLE​docs.silabs.com. Importantly, the MG24 must be running a Silicon Labs Gecko Bootloader (an application bootloader flashed on the device) to handle the actual upgrade process​docs.silabs.com. The bootloader provides the logic to receive a firmware image and replace the application, but it doesn’t implement BLE transfers by itself – it relies on the application (or a minimal “Apploader”) to do that​docs.silabs.com. In practice, Silicon Labs offers two approaches: using a lightweight Apploader (a separate minimal BLE firmware for DFU) or implementing OTA DFU in the user application itself​docs.silabs.com. Recent examples favor the application-based OTA method, where the running application receives the new image into a flash storage slot and then invokes the bootloader to swap it in on reboot​github.com.

Performing a BLE OTA update with the official tools involves Silicon Labs’ proprietary update format and utilities. The firmware image must be packaged as a GBL (Gecko Bootloader) file – a binary format that includes metadata and possibly both application and Apploader segments​docs.silabs.com. With Simplicity Studio, this is handled by a post-build script (e.g. create_bl_files.bat) that outputs files like application.gbl (the application image) and apploader.gbl if needed​docs.silabs.com. The upgrade process is then typically done using Silicon Labs’ mobile app (EFR Connect / Simplicity Connect) or via their PC tools. For example, the Simplicity Connect smartphone app can connect to the device’s OTA Service and upload the GBL file over BLE​docs.silabs.comdocs.silabs.com. In short, Silicon Labs provides robust BLE OTA update support for the MG24, but it’s designed around their Gecko SDK, bootloader, and tooling (Simplicity Studio or Commander CLI).

Arduino Compatibility and Existing Support

Arduino has recently added official support for Silicon Labs MG24-family boards via a dedicated SiliconLabs Arduino Core. This core (developed in collaboration with SiLabs and Arduino) allows programming MG24 SoCs in the Arduino IDE, and it targets boards like the Arduino Nano Matter, SparkFun Thing Plus Matter (MGM240P), Seeed Studio XIAO MG24, and Silicon Labs’ own xG24 dev kits​github.comgithub.com. In the Arduino environment, you can write sketches for the MG24 and even choose which wireless stack to include (e.g. a “BLE (Arduino)” layer for the ArduinoBLE library, or “BLE (Silabs)” to use Silicon Labs’ Bluetooth stack)​github.comgithub.com. However, OTA firmware updating via BLE is not a built-in feature of the Arduino core at this time. There isn’t an official high-level Arduino library or example that replicates the Silicon Labs OTA DFU process on MG24. In other words, BLE OTA is currently only supported through the underlying Silicon Labs mechanisms, not through a simple Arduino API.

What this means is that if you develop firmware for an MG24 in the Arduino IDE, you still have to rely on Silicon Labs’ OTA update procedure (and bootloader) to perform an OTA DFU. The Arduino core does include tools to burn the Gecko Bootloader onto the device (the Boards Manager “Burn Bootloader” step flashes the required MG24 bootloader image​github.com), so an Arduino-programmed MG24 can have the necessary bootloader for OTA. But the Arduino runtime/sketch itself would need to incorporate the OTA service or trigger. As of now, the Arduino core doesn’t automatically include the Silicon Labs OTA Service in your sketch’s BLE GATT. If you select the “BLE (Silabs)” protocol stack in Arduino, you are using the Silicon Labs Bluetooth stack (BGAPI) under the hood​github.com – in theory this stack supports the OTA DFU functionality, but you would have to invoke it manually or add the OTA GATT entries yourself (similar to how it’s done in Simplicity Studio). By contrast, if you use the “BLE (Arduino)” stack (the ArduinoBLE library), it abstracts BLE in a generic way and has no awareness of the Silicon Labs OTA bootloading scheme – it won’t automatically work with the Gecko bootloader for OTA updates.

In summary, there is no off-the-shelf Arduino BLE OTA updater for MG24. The device can do OTA updates, but you’ll be leveraging Silicon Labs’ solution even if your main application is Arduino-based. Arduino support for Matter (Thread/Matter OTA is a separate IP-based process) has been a focus, but BLE-based DFU on MG24 is still tied to the Silicon Labs SDK.

Adapting Silicon Labs OTA Examples to Arduino

If you need OTA updates in an Arduino project on MG24, you will likely need to adapt Silicon Labs’ example code or libraries into your Arduino sketch. Silicon Labs provides example applications in their Gecko SDK (and on GitHub) that demonstrate how to perform OTA DFU in a Bluetooth application. Notably, there is an official example called “Bluetooth – OTA Firmware Update in User Application” which shows how the user application can receive a GBL file over BLE and hand it off to the bootloader​github.com. This example (intended for Simplicity Studio) implements the OTA Service: it sets up an OTA control characteristic (to start the transfer/erase flash) and an OTA data characteristic (to stream the incoming file) using the Silicon Labs BGAPI. When the GBL file transfer is complete, the code calls the bootloader API (e.g. bootloader_rebootAndInstall()) to reset and apply the update​silabs.comsilabs.com.

To use this approach in Arduino, one would need to incorporate similar logic. Using the SiliconLabs core with “BLE (Silabs)” selected, it should be possible to call the underlying Bluetooth stack API (the BGAPI functions) from an Arduino sketch or a library. In fact, the Arduino core’s documentation references Silicon Labs’ BGAPI for advanced BLE use-cases​github.com. Practically, you might include the Silicon Labs OTA DFU component by initializing the OTA service in your setup code (if the core exposes an API for it), or by directly registering the OTA service’s 128-bit UUID and characteristics and handling the write events. This is not trivial – it essentially means writing a portion of the firmware in the style of a Silicon Labs Bluetooth application, but within the Arduino environment. You would need to use Silicon Labs’ Bluetooth SDK headers (for the DFU service) or port the example’s logic into Arduino C++ code. As of early 2025, no community-contributed Arduino library specifically for MG24 BLE OTA appears to exist, so this adaptation would be a custom effort using Silicon Labs’ provided code as a reference.

Another approach is to use the Apploader method, though it’s less common in newer designs. The Gecko Bootloader supports a two-stage OTA where a small BLE Apploader handles the file reception in DFU mode​docs.silabs.comdocs.silabs.com. In theory, one could trigger a reboot into the Apploader from an Arduino sketch (via a special bootloader GPIO or command) and then perform the OTA using an external tool. However, since Silicon Labs currently recommends the single-stage application-based DFU, and the Arduino bootloader image for MG24 is likely configured for internal storage (single image) updates, sticking with the application-driven OTA is wiser.

Using existing Silicon Labs code: Developers have successfully used the Silicon Labs examples on MG24 boards (like the xG24 or Thing Plus) by exporting them to Simplicity Studio. Those examples can be a guide for what code needs to run on the device. You can find the OTA DFU server implementation in Silicon Labs’ GitHub repository for Bluetooth applications​github.com. Adapting it may involve merging parts of that code with the Arduino build – for instance, by creating a custom Arduino library or .c file that registers the OTA service and uses the bootloader API (you may need to include Silicon Labs “sl_bootloader.h” and related definitions, which might not be bundled in the Arduino core by default). Keep in mind that Simplicity Studio’s code is geared toward their build system, so some adjustments (and removal of RTOS or plugin structure) might be needed to compile under Arduino.

Limitations and Required Tools

Even with an adapted OTA solution, there are several limitations and extra steps when using Arduino for MG24 OTA updates:

  • Image Packaging: The firmware compiled by Arduino (a .hex or binary) must be converted to Silicon Labs’ GBL format for OTA. The Arduino IDE does not produce .gbl files, so you’ll need to use Silicon Labs tools. A common approach is to use Simplicity Commander (a CLI tool) to convert an Intel HEX to a GBL, or run Silicon Labs’ make scripts if available. For example, Silicon Labs’ workflow uses a script that generates application.gbl and related files from the build output​docs.silabs.com. This step is necessary because the Gecko Bootloader expects the OTA image in that format (with cryptographic signatures, version info, etc., as configured in your bootloader).
  • No Arduino GUI support for OTA: The Arduino IDE itself doesn’t have a mechanism to perform OTA uploading for these boards. You cannot hit “Upload” and send the code via BLE – the IDE only knows how to flash via a hardware interface (USB/J-Link). So the actual OTA transfer must be done with an external tool. Typically, you would use Silicon Labs’ EFR Connect / Simplicity Connect mobile app or a custom BLE central script to send the image. (Silicon Labs’ smartphone app is the easiest: it recognizes the OTA service on the MG24 and can upload a chosen GBL file​docs.silabs.comdocs.silabs.com.) This is inherently outside the Arduino workflow; it’s closer to how you’d update a product in the field.
  • Memory and Bootloader Constraints: The MG24’s bootloader and OTA design assumes a designated flash slot for the new image. The Arduino core’s provided bootloader is an “Internal Storage Single-slot” bootloader, meaning the device uses internal flash to store one downloadable image at a time (for example, a 512 kB slot on a 1.5 MB flash)​github.comgithub.com. Arduino users should be mindful not to fill the flash with an application so large that it leaves no room for the OTA slot. In practice, the core’s partitioning (set by the bootloader) will enforce this, but it’s a consideration if using heavy stacks (Matter + OTA might be pushing the limits). There is also a requirement that the bootloader remain intact – using the Arduino “Burn Bootloader” writes it once​github.com, and you shouldn’t overwrite that region during normal use.
  • Lack of High-Level Library: Unlike some platforms (e.g. ESP32 Arduino which has ArduinoOTA for Wi-Fi updates), there is currently no high-level Arduino library to abstract the BLE DFU process for MG24. Developers must interface with Silicon Labs’ Bluetooth stack API or use their tools, which requires familiarity with Silicon Labs documentation (the BGAPI commands, bootloader upgrade APIs, etc.). This steeper learning curve is a trade-off when using the Arduino environment for such advanced functionality on MG24.
  • Potential Alternatives: If OTA via BLE is a firm requirement and the current Arduino-based approach proves too complex, one alternative is to develop the firmware using Silicon Labs’ Gecko SDK in Simplicity Studio (where OTA is fully supported out-of-the-box) and perhaps use Arduino only for initial prototyping. Another possibility is using other wireless update paths if applicable (for example, Matter devices might use Thread-based or Wi-Fi-based OTA via the Matter protocol, bypassing the need for BLE). But for strictly BLE-only DFU on MG24, Silicon Labs’ solution is the only game in town.

References and Examples

  • Silicon Labs Documentation: The primary references for MG24 OTA are Silicon Labs’ docs and application notes. AN1086 – Using the Gecko Bootloader with Silicon Labs Bluetooth Applications and the Bluetooth SDK App OTA DFU guide detail how the bootloader and OTA service work for BLE devices​docs.silabs.comdocs.silabs.com. These explain the required image format and the OTA GATT procedure. The Silicon Labs “Firmware Upgrade” documentation also clarifies that OTA is not autonomous in the bootloader and must be handled by an application or Apploader​docs.silabs.com.
  • Gecko SDK Examples: Within Simplicity Studio’s Gecko SDK, you can find ready-made examples for BLE OTA. For instance, “Bluetooth – OTA DFU in User Application” (available via Simplicity Studio’s example projects or on Silicon Labs’ GitHub) provides a complete reference implementation​github.com. Although it’s not an Arduino project, this example can guide an Arduino developer on what components to implement. Key parts of its source can be studied (setting up the OTA service UUID, handling writes to OTA control, writing the received chunks to the flash slot, and calling bootloader functions).
  • SiliconLabs Arduino Core (GitHub): The official Arduino core for EFR32 devices is on GitHub (SiliconLabs/arduino)​github.com. While its documentation doesn’t explicitly cover OTA, it shows how to set up the board support and mentions the need to flash the bootloader. It also provides the ezBLE library and supports using Silicon Labs’ BLE stack, which could be the vehicle for integrating OTA if one were to attempt it. Keeping an eye on this repository (and its issue tracker) is wise, as the Arduino core may evolve to include more features; any community-contributed OTA solution might surface there.
  • Community Forums: The Silicon Labs community forums and the Seeed Studio forum have discussions on the XIAO MG24 and similar boards. Users have inquired about debugging and advanced features. While not many threads explicitly detail Arduino BLE OTA yet, these forums can be useful to see if others have attempted similar tasks. For example, guidance on using Simplicity Studio with Seeed’s MG24 (for deploying the bootloader or troubleshooting) has been shared by the community, which can indirectly help Arduino users understand the device’s requirements​docs.silabs.com.

HTH
GL :slight_smile: PJ :v:

Not a lot of info exists, so your experience may determine your results. :+1:

1 Like