6.3.6.6 Upgradable Image (.bin) File Generation

To generate an upgradable .bin image for BLE OTA DFU, the user must use the SignFirmware and OTA scripts integrated into the MPLAB® X project. For more details, see Project Properties Configuration for Current/Running Firmware from Related Links. The OTA window in project properties helps the user to configure and generate the .bin file for BLE OTA upgrades.

The following steps describe how to generate an upgradable .bin image for OTA DFU using MPLAB X IDE:
  1. After making the new upgradable application, ensure the new upgradable image has a version number different from the currently running image. The user must ensure to update the version in both:
    1. Device Information Service (DIS) in the new firmware source code. For more details, see Verifying Configurations from Related Links. Ensure BLE_SENSOR_VERSION macro in app.c has the desirable firmware version. Clean and build the project. Do not program/Flash the device.
    2. In the “Firmware Rev:” field in the SignFirmware properties window. For example, if the current version is 1.0.0.0, set the new image version to 1.0.0.1 in both locations.
  2. Open the SignFirmware properties window (see Step 1 of Project Properties Configuration for Current/Running Firmware from Related Links).
    1. In the “Firmware Rev:” filed, change the firmware version as per the requirement and then click Apply.
      Figure 6-85. Firmware Revision Update
    2. Compile the project to generate the updated firmware image.
  3. Open the OTA properties window (see Step 1 of Project Properties Configuration for Current/Running Firmware from Related Links).
    1. Configure the following options in the OTA window:
      Figure 6-86. OTA Window – Create OTA File
      1. Enter the name of the output file name. In the “Output File Name:” filed, type OTAPackage.bin.
      2. From the “Output File Encryption:” drop-down list, select Unencrypted.
      3. From the “Output File Type:” drop-down list, select BLE OTA File for BLE based OTAU.
      4. Enter the Flash image ID. In the “Flash Image ID:” field, type 0x9B000000. For more details, see Step 2 of Pull-in MCC Components for OTA from Related Links.
    2. After configuring, click Create OTA File to proceed.
    3. After clicking Create OTA File, this action creates the upgradable .bin image with the selected “Output File Name:” in the .X project folder. The OTAU manager stores this image to send to the OTAU target.
      Figure 6-87. Created OTA File