Adding Gecko Bootloader to Bluetooth projects

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> arkalvac ‎04-12-2017 10:49 AM - edited ‎07-12-2017 08:47 AM

In Bluetooth SDK v2.3 Bluetooth projects do not include Gecko Bootloader by default.

  • In projects for EFR32BG1 devices the legacy bootloader is included, placed at address 0x0000
  • In projects for EFR32BG12 devices no bootloader is included. In these devices the application is placed at address 0x0000

If you want to add Gecko bootloader do the followings:

 

First method

  1. Build your Bluetooth application
  2. Flash your Bluetooth application (.s37 OR .hex OR .bin) to the device.
  3. Create a new Gecko Bootloader project, e.g. BGAPI UART DFU Bootloader
    (click New Project button in Simplicity Studio, select Gecko Bootloader, select BGAPI UART DFU Bootloader)
  4. Generate and build it
  5. Flash the .s37 file that ends with „–combined” (e.g. bootloader-uart-bgapi-s37) file to the device. This will overwrite the legacy bootloader in EFR32BG1 devices or the dummy bootloader in EFR32BG12 devices.

Note: bootloader-uart-bgapi-combined.s37 contains the first+second stage of the Gecko Bootloader, while bootloader-uart-bgapi.* contains only the second stage. The first+second stage is needed when flashing the bootloader the first time, while the second stage is needed when upgrading the bootloader (either by flashing or by DFU).

 

Second method

  1. If you use a EFR32BG1 device, remove the legacy bootloader from the Bluetooth application project
    1. Right click on your project -> properties
    2. C/C++ build > Settings > IAR Linker for ARM > Library
      or
      C/C++ build > Settings > GNU ARM C Linker > Miscallaneous > Other objects
    3. Remove binbootloader.o
  2. Build your Bluetooth application
  3. Create a new Gecko Bootloader project, e.g. BGAPI UART DFU Bootloader
    (click New Project button in Simplicity Studio, select Gecko Bootloader, select BGAPI UART DFU Bootloader)
  4. Generate and build it
  5. Merge the (combined) bootloader and the application image:
    commander convert bootloader-uart-bgapi-combined.s37 your_application.s37 -o app+bootloader.s37
  6. Flash the merged image to the device

 

Third method

 0. If the .isc file is open in your project, close it first.

  1. Open the .isc file in your project with text editor (right click -> Open With -> Text Editor)
  2. change appPlugin: gecko_bootloader=false to appPlugin: gecko_bootloader=true
  3. change appPlugin: legacy_ble_ota_bootloader=true to appPlugin: legacy_ble_ota_bootloader=false
  4. save and close the .isc file
  5. open the .isc file with App Builder (right click -> Open With -> App Builder)
  6. press Generate
  7. Build your Bluetooth application
  8. Create a new Gecko Bootloader project, e.g. BGAPI UART DFU Bootloader
    (click New Project button in Simplicity Studio, select Gecko Bootloader, select BGAPI UART DFU Bootloader)
  9. Generate and build it
  10. Merge the (combined) bootloader and the application image:
    commander convert bootloader-uart-bgapi-combined.s37 your_application.s37 -o app+bootloader.s37
  11. Flash the merged image to the device

 

Note: commander.exe can be found in: C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\commander\

 

Warning: for SDKs before v2.4.0 the second and third methods work only if you are using IAR as compiler. GCC is fully supported from v2.4.0.

 

Warning: in SDK v2.3.3 the postbuild step of the bootloader project may fail, and -combined.s37 file may be missing. In this case open the bootloader project, go to "Project > Properties > C/C++ Build > Settings > Build steps", and put the script path between quotes. Rebuild the bootloader project.

Comments
by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Super Star</font></font> </a> bbn4bibin
on ‎04-28-2017 07:45 PM

Hi

 

I have a device running on the field in which the only upgrade option is UART DFU. What should i do for upgrading to Gecko bootloader for device having legacy UART bootloader.

 

Thanks

Bibin

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> arkalvac
on ‎05-02-2017 04:15 AM

 

Hi,

 

There is no supported way to upgrade to Gecko Bootloader without flashing the device, since the bootloader cannot overwrite itself.

 

If you have no other choice, you can create a bluetooth application that includes the Gecko Bootloader binary as data array, and copies it to the bootloader flash address using the flash driver (nvm_hal.c/.h), while interrupts are disabled. But do this at your own risk! If something goes wrong during upgrade, you can brick your device.

 

Best Regards,

Arnold

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Super Star</font></font> </a> pa1329
on ‎08-18-2017 11:23 AM

How do you actually flash the merged file onto the device?

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> arkalvac
on ‎08-18-2017 11:45 AM

Use Simplicity Commander (found in C:\SiliconLabs\SimplicityStudio\v4\developer\adapter_packs\commander).

It is able to flash .s37 files.

You can use either the command line ("commander flash filename.s37") or the GUI.

Find documentation here: https://www.silabs.com/documents/public/user-guides/ug162-simplicity-commander-reference-guide.pdf