5.2.1.2 Uploading and Creating bin File for PFM OTA DFU

The following BLE OTA demo steps are common for any application implementing OTA functionality.

BLE sensor application is the sample project which implements OTA functioanlity as explained in the above steps. The new upgradable .bin (ble_sensor_OTA.bin) is available in<Harmony Content Path>\apps\ble\advanced_applications\ble_sensor\precompiled_hex for your reference.

Hardware Requirement

Table 5-35. Hardware Prerequisites
S. No.

Tool

Quantity

1 PIC32-BZ6 Curiosity Board

1

2

Micro USB cable

1

3

Android/iOS Mobile

1

Smartphone App

Microchip Bluetooth Data (MBD) iOS/Android app available in stores

Demo Steps:

  1. To perform the OTAU, the upgradable firmware bin file has to be created and must be stored in the MBD app. To create the upgradable firmware bin file , the following changes in Project Properties must be done after creating the project graph.
    Figure 5-170. Project Properties - Header configuration
    Figure 5-171. Project Properties - OTA configuration

    After the Project Properties configurations, click on Create OTA File. The Upgradable .bin image with selected "Output File Name" will be created in .X folder. This is the image stored in OTAU Manager to send to OTAU Target.

  2. Send the upgrdable bin file to the mail. Refer to the following screenshots to store the image received on mail into MBD app.iOS Mobile:
    Download the .bin file that was sent over email
    Downloading the .bin file
    open the downloaded .bin file with MBD
  3. Turn on mobile Bluetooth and select “OTA DFU" tab of Microchip Bluetooth Data App on the mobile device.
  4. Power On the OTA capable target device (PIC32CX-BZ6 and PIC32WM-BZ6) which was programmed in "Programming the Application using MPLABX IDE". Device will be advertising. Click on "SCAN" button in mobile app and the device be visible in scanned list. Click on intended device from the scanned list. Mobile app will now get connected with OTA Target device.
  5. "Connected" message will appear for a short while. Click the ‘Select Image’ option to choose the available firmware file.
  6. The OTAU firmware image file copied in the step 1 will be visible on screen. Click on that image.
  7. After confirming the FW version press OK button.
  8. Firmware update will be initiated and the progress will be shown in mobile app. The process would take few seconds.
  9. Once the complete image is transferred, "OTA Update successfully" status will be shown in mobile app. Click on "OK" and then device will perform authentication of the image. If validation is successful, then system reboot automatically.
  10. On bootup, device does the authentication of new image in Slot1 and then copies the new image to Slot0. Now the new image will be running from Slot0.
  11. To verify whether the running image on the target is newly upgraded image, follow steps 2 to 7 and check the current version. To change the firmware version shown in MBD, follow the steps in the Upgradable image .bin file generation, see Upgradable Image .bin File Generation from Related Links.