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 ‎05-04-2017 04:18 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
    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

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

 

Warning: for SDK v2.3.1 or older the second method works only if you are using IAR as compiler. GCC is fully supported from v2.4.0.

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">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