The project implements image uploading to the bootloader storage slots using the standard OTA process. It is also extended by allowing the users to select a slot to upload and boot from. You are free to modify this example according to your needs.
The following picture shows the system view of how it works.
- GSDK v4.4.0
-
Smartphone
The following picture shows the hardware for the device (with EFR32MG12).
To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.
To implement the Bluetooth - Uploading Images to Multiple Slots application, we need to have a bootloader that supports multiple images.
-
From the Launcher Home, add your product name to MyProducts, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project with filter "bootloader".
-
Create a Bootloader - SoC Internal Storage (multiple images on 1MB device) project in Simplicity Studio.
-
Build the project and flash the bootloader to your device.
-
Back to the Launcher Home, Find the example project with filter "multi-slots".
-
Create TWO projects with Bluetooth - Uploading images to multiple slots example. These example projects creation dialog pops up -> click Create and Finish and Projects should be generated.
-
At the first Bluetooth - Uploading images to multiple slots project:
-
Open the .slcp file in the project.
-
Select the CONFIGURATION TOOLS tab and open the Bluetooth GATT Configurator.
-
Change the Device Name to “silabs origin”.
-
Save the GATT database.
-
-
Build and flash this first project to your boards.
-
At the second Bluetooth - Uploading images to multiple slots project:
-
Open the .slcp file in the project.
-
Select the CONFIGURATION TOOLS tab and open the Bluetooth GATT Configurator.
-
Change the Device Name to “silabs version 1”.
-
Save the GATT database.
-
-
Build this second project.
-
From the Launcher Home, add your product name to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project with filter "bootloader".
-
Create a Bootloader - SoC Internal Storage (multiple images on 1MB device) project in Simplicity Studio.
-
Build the project and flash the bootloader to your device.
-
Create a Bluetooth – SoC Empty project.
-
Copy all attached files in the inc and src folders into the project root folder (overwriting existing).
-
Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install these software components:
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- [Application] → [Utility] → [Assert]
- [Platform] → [Board] → [Board Control] → enable Virtual COM UART
- [Bluetooth] → [OTA] → [In-Place OTA DFU]: uninstall.
(This will uninstall Apploader and remove OTA DFU service and the OTA control characteristics handler code.)
-
Import the GATT configuration:
-
Open the .slcp file in the project.
-
Select the CONFIGURATION TOOLS tab and open the Bluetooth GATT Configurator.
-
Find the Import button and import the attached
config/gatt_configuration.btconf
file. -
Save the GATT configuration (ctrl-s).
-
-
Build and flash this first project to your device.
-
Make a copy of this project to have the second project.
-
Similar to the second project, change the Device Name to “silabs version 1” in the GATT Configurator, and save the GATT database
-
Build these projects.
-
In the second project, run create_bl_files.bat. You may need to set up some environmental variables first, as described in section 3.10 of AN1086: Using the Gecko Bootloader with the Silicon Labs Bluetooth® Applications
-
Find the full.gbl file in the 'output_gbl' folder.
-
Copy full.gbl to your smartphone.
-
Open EFR Connect app on your smartphone.
-
Find your device with Bluetooth browser (advertising as silabs origin) and connect to it.
-
Find the unknown service and open it (this is your custom service including Upload slot and Bootload slot characteristics).
-
Open the first characteristic (this is the upload characteristic) and write the slot number, that you want to upload to, in it, for example: 0x00.
-
In the local menu select OTA Firmare.
-
Select the partial type.
-
Select the full.gbl file you want to upload.
-
Click Upload. The file will be uploaded to the selected slot.
-
Open the second characteristic in the unknown service (Bootload slot) and write the slot number (e.g. 0x00), that you want to load the application from, in it. The device will trigger a reset and the new application will be loaded.
-
Reload and find your device advertising itself as “silabs version 1”.