This repo contains peer apps for the Over-the-Air Firmware Upgrade embedded app. Binaries and source code are included.
Separate apps are supplied for:
- Android
- iOS
- Windows
Applications to perform and verify OTA FW upgrade are provided for Windows 10, Android. and iOS platforms. Executables are included and source code is provided.
- Windows Peer App: WsOTAUpgrade.exe
- Android Peer App: LeOTAApp (app-debug.apk)
- iOS Peer App: OtaUpgrade
Windows and Android applications can be used to perform and verify secure (signed) and unsecured (unsigned) OTA upgrade. Both applications accept a secure (signed) or unsecured (unsigned) OTA binary images as input (.ota.bin & .ota.bin.signed). iOS app can perform only unsecure OTA at this time.
Note: Android OTA SPP app (OTASPPApp) is for 20721 platform apps such as headset_speaker.
To demonstrate the app, work through the following steps:
- Plug the AIROC™ eval board into your computer.
- Build and download the application to the AIROC™ board.
- The OTA image file (app-name)_(bsp).ota.bin is generated in the (app-name)/build/(bsp)/Debug folder.
Windows:
- Copy the OTA image .bin file to the wiced_btsdk/tools/btsdk-peer-apps-ota/Windows/WsOtaUpgrade/Release/(OS) folder.
- Launch the appropriate version of WsOtaUpgrade.exe for your OS.
- Use the WsOtaUpgrade application to test over the air upgrade. Pass the filename of the OTA binary created in the build as the command-line argument.
- C:..> WsOtaUpgrade.exe (app-name)_(bsp).ota.bin
- Select the peer device and click the start button to initiate OTA process.
Android and iOS:
- Use LeOTAApp or OtaUpgrade and select the (app-name)_(bsp).ota.bin file.
- Select the peer device and click on start button to initiate OTA process.
- Open a command prompt and go to directory - wiced_btsdk/tools/btsdk-utils/ecdsa256/bin/(OS)
- Generate a private/public key pair by running the ecdsa_genkey application.
- Copy the generated ecdsa256_pub.c to the application directory. For example:
- (app-name)/secure/ecdsa256_pub.c
- In your application, set makefile variable OTA_SEC_FW_UPGRADE=1, and appropriate application ID and version:
- APP_VERSION_APP_ID=0x1234
- APP_VERSION_MAJOR=1
- APP_VERSION_MINOR=0
- Clean and rebuild the application and download to the board.
- Copy generated (app-name)_(bsp).ota.bin file in (app-name)/build/(bsp)/Debug folder back to ecdsa256/bin/(OS) directory.
- Sign the binary .ota.bin file with the public key using ecdsa_sign application in ecdsa256/bin/(OS) folder. This will generate file (app-name)_bsp.ota.bin.signed
- ecdsa_sign (app-name)_(bsp).ota.bin
Windows:
- Copy the (app-name)_(bsp).ota.bin.signed to the same folder as WsOtaUpgrade.exe for your OS.
- Launch the appropriate version of WsOtaUpgrade.exe
- Use the WsOtaUpgrade application to test over the air upgrade. Pass the filename of the OTA binary created in the build as the command-line argument.
- C:..> WsOtaUpgrade.exe (app-name)_(bsp).ota.bin.signed
- Select the peer device and click on the start button to initiate OTA process.
Android:
- On an Android phone use the LeOTAApp.
- Copy the signed OTA image to the Android device.
- Start the LeOTAApp application on the Android device.
- Click on 'Tap to select OTA image' and select the (app-name)_(bsp).ota.bin.signed.
- Click on 'Tap to select a device' and select the OTA FW Upgrade device.
- Tap Connect.
- Tap Upgrade.
Note: On some older Bluetooth® Devices on Windows, the OTA might fail because of an incompatible MTU. To work around this, change the code as below and rebuild the Windows application in ./Windows/WsOtaUpgrade/WsOtaDownloader.cpp:
* define MAX_MTU 256 // (instead of 512)