Adding Gecko Bootloader to Bluetooth Projects

Bluetooth projects do not include Gecko Bootloder by default, so you have to add it separately!

In Bluetooth SDKs between v2.0 and v2.6:

In Bluetooth SDK v2.7 or later:

Devices are shipped with preprogrammed bootloaders:

To add a Gecko Bootloader to your Bluetooth project do the following:

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., Bluetooth in-place OTA DFU Bootloader or BGAPI UART DFU Bootloader. Click the New Project button in Simplicity Studio, select Gecko Bootloader, select Bluetooth in-place OTA DFU Bootloader or 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 for the first time, while the second stage is needed when upgrading the bootloader (either by flashing or by using the DFU).

Second method

  1. If you use a EFR32BG1 device with SDK v2.6 or older, remove the legacy bootloader from the Bluetooth application project. If you have a different device or a later SDK, skip these steps:
    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 > Miscellaneous > Other objects
    3. Remove binbootloader.o
  2. Build your Bluetooth application.
  3. Create a new Gecko Bootloader project, e.g., Bluetooth in-place OTA DFU Bootloader or BGAPI UART DFU Bootloader. Click the New Project button in Simplicity Studio, select Gecko Bootloader, select Bluetooth in-place OTA DFU Bootloader or 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
  1. Flash the merged image to the device.

Third method

  1. If you use a EFR32BG1 device with SDK v2.6 or older, remove the legacy bootloader from the Bluetooth application project. If you have a different device or a later SDK, skip these steps:
    1. If the .isc file is open in your project, close it first.
    2. Open the .isc file in your project with a text editor (right click -> Open With -> Text Editor).
    3. Change appPlugin: gecko_bootloader=false to appPlugin: gecko_bootloader=true.
    4. Change appPlugin: legacy_ble_ota_bootloader=true to appPlugin: legacy_ble_ota_bootloader=false.
    5. Save and close the .isc file.
    6. Open the .isc file with App Builder (right click -> Open With -> App Builder).
    7. Press Generate.
  2. Build your Bluetooth application.
  3. Create a new Gecko Bootloader project, e.g., Bluetooth in-place OTA DFU Bootloader or BGAPI UART DFU Bootloader. Click the New Project button in Simplicity Studio, select Gecko Bootloader, select Bluetooth in-place OTA DFU Bootloader or 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
  1. Flash the merged image to the device.

Fourth method (If you have SDK v2.7 or later)

  1. Flash a demo to your device.
    • Flash the SoC - Empty demo to your device first. This will flash the SoC - Empty application with Bluetooth in-place OTA DFU type Gecko Bootloader.
    • OR: Flash NCP target - Empty demo to your device. This will flash the NCP target - Empty application with BGAPI UART DFU type Gecko Bootloader.
  2. Build your Bluetooth application.
  3. Flash the .hex or the .s37 file to your device. This will not overwrite the bootloader (unlike .bin).

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

Warning: For SDK versions earlier than v2.4.0, the second and third methods work only if you are using IAR Embedded Workbench as a compiler. The GCC compiler is fully supported starting with v2.4.0.

Warning: In SDK v2.3.3, the postbuild step of the bootloader project may fail and the -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.