Uncannier Software

It's not enough to just be uncanny

Thunderboard Sense 2 – Over The Air (OTA) Upgrades

Like the Thunderboard React, the Thunderboard Sense 2 doesn’t support Over The Air (OTA) Device Firmware Upgrade (DFU) out of the box. This article describes how to modify the stock Thunderboard Sense 2 firmware to enable OTA DFU.

This article references my previous post, Thunderboard React – Over The Air (OTA) Upgrades, and concentrates on how the Sense 2 differs from the React.

Memory Map

A key difference between the Sense 2 and React is that the Sense 2 uses an EFR32xG12 SoC instead of an EFR32xG1 SoC. Consequently, the bootloader loader lives outside the main Flash memory, in the information block instead.

Accordingly, the Thunderboard Sense 2 stock firmware can be used to program an erased main Flash memory. Unlike the React.

Gecko Bootloader

The Gecko Bootloader is nonetheless still required to enable OTA upgrades. Like the React, you can dive right into Simplicity Studio and generate a Bootloader from one of the stock templates:

New->Project->Silicon Labs AppBuilder Project->Gecko Bootloader

Select the particular Gecko Bootloader version you want to use. 1.7.0 in the case of this article.

Where the React uses the Bluetooth in-place OTA DFU Bootloader, the Sense 2 uses the Internal Storage Bootloader as a template. The user is presented with three Internal Storage bootloaders for 1MB EFR32xG1 SoCs:

  • multiple images
  • single image
  • single image with LZMA compression

There’s no right or wrong selection, but I’ll go with the no frills “single image” selection for the purposes of this article, since I just want to get OTA upgrades going.

Now it’s just like the React:

  • Generate the bootloader source code from the .isc file, using the default options in the .isc file.
  • Build the Gecko bootloader.
  • The Gecko Bootloader includes a post-build script (uts-bootloader_postbuild.sh in my case) that combines the first and second stage bootloaders into a single S-record file.

Stock Firmware Changes

Add The Silicon Labs OTA Service

Do it, just like the React. A reminder (React screenshot):

Enable OTA In The Stack Configuration

Like the React, but the Sense 2 stock firmware doesn’t have a data structure initialized at declaration. Instead it’s done at run-time.

radio_ble.c changes: https://github.com/gregbreen/uncannier-thunderboard-sense2/commit/c3fbe460a8169d067754f647164f1bcefde6e965#diff-cd9394e192460699fc42012c7bfa9d62

Trigger Reboot Into OTA DFU Mode

Like the React.

ota_service.c new file: https://github.com/gregbreen/uncannier-thunderboard-sense2/commit/c3fbe460a8169d067754f647164f1bcefde6e965#diff-2245a491cd29effb4f7442d5ec37e0f6

app_ble.c changes: https://github.com/gregbreen/uncannier-thunderboard-sense2/commit/c3fbe460a8169d067754f647164f1bcefde6e965#diff-d9cb742e1a4730e9036258894fd211d9

Custom Post-Build Step: GBL File Generation

And like the React, I’ve made my own post-build script: https://github.com/gregbreen/uncannier-thunderboard-sense2/commit/c3fbe460a8169d067754f647164f1bcefde6e965#diff-7d2b2c8d9784bda32311774f120d0262

You can then flash the consolidated image to have an Thunderboard Sense 2 with an OTA Service.

OTA DFU With The Blue Gecko App

The OTA Service is now visible in the Blue Gecko app. And OTA is a menu option. An update can then be performed using the GBL files. Here are the React screenshots again; all that’s different for the Sense 2 are the App and Stack file names and file sizes.

Uncannier Pull Request

https://github.com/gregbreen/uncannier-thunderboard-sense2/pull/5

References

  1. https://uncannier.com/thunderboard-react-over-the-air-ota-upgrades/
  2. https://www.silabs.com/documents/login/user-guides/ug136-ble-c-soc-dev-guide.pdf
  3. https://www.silabs.com/documents/public/user-guides/ug266-gecko-bootloader-user-guide.pdf
  4. https://www.silabs.com/documents/login/application-notes/an1086-gecko-bootloader-bluetooth.pdf
Tagged , , ,

2 thoughts on “Thunderboard Sense 2 – Over The Air (OTA) Upgrades

Leave a Reply

Your email address will not be published. Required fields are marked *