Using EFR Connect Mobile App for OTA DFU#

Introduction#

This tutorial explains how to perform a Device Firmware Upgrade (DFU) with Bluetooth Over-The-Air (OTA) update. Any chip that has OTA-updates enabled in their GATT profile can have an OTA upgrade. Most of the example applications provided in the Bluetooth SDK already have OTA support built into the code. In these examples, the DFU mode is triggered through the Silicon Labs OTA service that is included as part of the application’s GATT database. This can be checked and added in the BLE GATT Configurator in Simplicity Studio.

For tutorial purposes, the SOC - Empty SDK example application will be upgraded to the SoC - Thermometer example application. Because the SoC - Thermometer has the Health Thermometer service for visual feedback, users can easily check that the functionality of the user application has changed.

Requirements#

  • Wireless Starter Kit and Bluetooth-capable radio board

  • Simplicity Studio

  • Android or iOS mobile device

First Steps#

  1. Download EFR Connect mobile app (Android / iOS).

  2. Connect the kit to your computer and select it in Simplicity Studio.

  3. Run the SOC - Empty demo from Simplicity Studio Launcher.

  4. Create SoC - Thermometre Software Examples project.

  5. Build the SoC - Thermometer project and run create_bl_files.bat/sh script from the smart phone project tree.

This creates a folder named `output_gbl` under your project. There are three `.gbl` upgrade image files in this folder:
  - `application.gbl`:  user application (including full Bluetooth stack)

  - `apploader.gbl`: AppLoader (including minimal Bluetooth stack)

  - `full.gbl`: For UART DFU, **not needed** in this example. Starting from SDK 2.7.0, the user application also includes the Bluetooth stack and therefore the Bluetooth stack can be updated without a full update. A full update is needed only if the AppLoader needs to be updated. See [AN1086](https://www.silabs.com/documents/login/application-notes/an1086-gecko-bootloader-bluetooth.pdf) for more details.

batfilebatfile
outputgbl folderoutputgbl folder

6.  Transfer the `.gbl` files to your smart phone so the mobile app can find them. You can either transfer them via USB to any folder on your phone or just place it to a cloud storage which is available from your phone (e.g. Google Drive, Dropbox, iCLoud)
  1. Launch the EFR Connect mobile app.

In the EFR Connect mobile app#

Once in the app,

  1. Go to the Bluetooth Browser and find and connect to your kit (default name "Empty Example").

  2. Open the pop-up menu in the upper right corner and select OTA.

    popup menupopup menu

  3. Select Partial OTA and look for the gbl file in your smartphone

  4. Finally, press OTA and your upgrade should start.

blank ota setup viewblank ota setup view
uploadupload

After the OTA process has finished, verify that the kit is now running the SoC - Thermometer example. You can find the kit in the Bluetooth Browser with a new name "Thermometer Example".

Note#

To enable the Bluetooth OTA upgrade, the target device must be programmed with the Gecko Bootloader that is configured as an Internal Storage Bootloader. This is an application bootloader, which requires that the new firmware image acquisition is managed by the application.

Running the "Demos" in Simplicity Studio will include the bootloader and user application. However, flashing a "Software Example" does not. If your OTA upload stops at 0 % and you get a message on an Android phone saying "GATT CMD STARTED", that might indicate a missing or incorrect bootloader. In this case do the following:

  1. Go to New Project -> Gecko Bootloader -> Gecko Bootloader 1.5.0 and create that for your kit. Remember to choose the "Internal Storage Bootloader" option suitable for your storage size.

  2. In the .isc-file for the bootloader project, you can configure some options, but for this example, press Generate with the default settings.

  3. Build the project and find the folder in your bootloader project tree that is named “GNU ARM <compiler version number> - Default”. Flash the xxx-combined.s37-file to the device. This includes the first stage and main bootloaders.

  4. Now, proceed with flashing the SOC - Empty-project as in First steps #3.

Additional Resources#

AN1086: Using the Gecko Bootloader with the Silicon Labs Bluetooth® Applications

UG266: Silicon Labs Gecko Bootloader User's Guide