Using BLExplr v1.6.0 to upgrade Bluegiga’s BLE112 or BLE113 firmware over the air (OTA)

Hello everyone,

Bluegiga has released another SDK which supports OTA firmware upgrades. In v 1.2.2 of their SDK Bluegiga optimised the OTA procedure so I just digged into the Application Note “Implementing OTA Firmware upgrade”. After some issues on iOS and not knowing exactly how to deal with the “write without response” characteristics, I implemented the procedure which was only available on the BLEGUI2 app which is part of the SDK in BLExplr v1.6.0.

Yes, you can now upgrade the firmware of a BLE112 or BLE113 module using an iOS device.

OTA-AddOn4

First of all, I would recommend anybody who is interested in OTA upgrading the firmware of a BLE112 or BLE113 to read the Application Note : Implementing OTA Firmware Upgrade provided on Bluegiga’s website. In this application note (Page 13) they are mentioning, that since February 2014 Development Kits which are being shipped include a small carrier board with the Winbond flash memory which is required for the OTA procedure. I don’t have such a carrier board, but I created one of my own, which is doing the same (I think). It is a small add on board which can be attached to a BLE112 Evaluation board or the BLE113 Development board.

Since I own both the BLE112 and the BLE113 Eval-/Development board, I created two of these add on modules which can be attached to their headers. The the picture below showing both boards with the add on module attached.

DevBoardsWithSPIFlash

Now that the hardware is extended to provide the SPI Flash chip, necessary for the OTA upgrade of the BLE112 or BLE113 I’ll describe the procedure to upgrade their firmwares using BLExplr v1.6.0 and higher (BLExplr v1.6.0 was not available while writing this blog post. It is submitted to the Apple App Store and is hopefully available by the end of March 2014).

Before you can upgrade a BLE112 or BLE113 OTA, you have to make sure that a firmware is installed which supports the OTA Service defined by Bluegiga. The easier would be to flash the “ota” sample firmware located in the folder “C:\Bluegiga\ble-1.2.2-100\example\ota” (once you installed the latest SDK). I simply flashed this firmware to my BLE112 Development board. I changed the firmware to reflash by changing the name to “Bluegiga OTA 112 MK” So you will see the change after the firmware is flashed.

Before we can flash anything we need the ota files on the iOS device where BLExplr is running. After you started BLExplr v1.6.0 and open the side bar menu you might have noticed that there is a new menu item called  “OTA Firmware Files” as illustrated in the pictures below. As shown in the picture on the right, there are not ota files available yet. But you can easily import them from E-Mail attachments.

Screenshot 2014.03.24 22.30.42 Screenshot 2014.03.24 22.32.52

 

 

I prepated an E-Mail containing four ota file attachments.

  • BLE113.ota (the original BLE113 firmware)
  • BLE113-MK.ota (the firmware changed to use a different text as friendly name)
  • BLE112.ota (the original BLE112 firmware)
  • BLE112-MK.ota (the firmware changed to use a different text as friendly name)

As you can see the attachments are automatically mapped to BLExplr. Tap on a file to import it to BLExplr. BLE112-MK.ota will be fine for the test.

Screenshot 2014.03.24 22.34.41 Screenshot 2014.03.24 22.38.56

Screenshot 2014.03.24 22.39.00 Screenshot 2014.03.24 22.39.14

 

Make sure to go to the settings view and update the 3rd party UUID descriptions. This is necessary to make BLExplr correctly recognize the OTA Service. The next step is to discover peripherals and make sure that the “Bluegiga OTA 112″ peripheral is found as illustrated in the screenshot below:

Screenshot 2014.03.24 22.28.06

Select the Bluegiga OTA 112 peripheral and make BLExplr connect to it:

Screenshot 2014.03.24 22.44.34

 

Select the Bluegiga OTA Service and you will see, that BLExlpr is not showing the characteristics but a special rendering of the service, where you can select an OTA file you previously imported to the app from an E-Mail:

Screenshot 2014.03.24 22.46.48 Screenshot 2014.03.24 22.46.53

Now you are ready to rock :-) You have selected on ota file and the button “Start OTA Firmware Upgrade” is enabled now.

Screenshot 2014.03.24 22.49.34

 

If you select the button, the OTA procedure will start. You can see the upload progress since BLExplr will show you a progress HUD. The process will take about 60-70 seconds. After that the BLE112 will disconnect the connection to BLExplr.

Screenshot 2014.03.24 22.51.33 Screenshot 2014.03.24 22.54.16

Now please rediscover for BLE peripherals. Since iOS is buffering the names of the peripherals there is a mismatch between the names as shown in the below screenshot.

Screenshot 2014.03.24 23.03.37

Hope this works for you as well.If you encounter any issues, please let me know through the forum at http://forum.mkroll.mobi

Thanks for reading,

Michael.

 

2 Responses to Using BLExplr v1.6.0 to upgrade Bluegiga’s BLE112 or BLE113 firmware over the air (OTA)

  1. Greg Rae April 4, 2014 at 21:36 #

    awesome, thanks for the great post!

  2. Joshua Gramlich September 5, 2014 at 10:47 #

    Can you explain how you copied the data/control to the ota_data and ota_control characteristics? I’m trying to do this myself in Android and I don’t think I have my data format correct.

    I’m doing the characteristic writes to the ota_data characteristic, but after I do that, when I try to tell ota_control to boot to DFU mode, it hangs the module. I think how I’m loading my .ota file is broken.

Leave a Reply


*