6.3.4 Bluetooth Low Energy OTA DFU Image File Definition

The Bluetooth® Low Energy (Bluetooth® LE) OTA DFU file contains the OTAU header and the upgradable Flash image. The OTAU manager (such as a smartphone or GATT client) loads this file and sends it to the OTAU target over the Bluetooth LE link. The following figure illustrates the Bluetooth LE OTA DFU image file definition.

Figure 6-37. Bluetooth® LE OTA DFU Image File Definition
  • Flash Image: The flash image consists of a meta-data header and executable firmware. The system programs this complete image content into the device’s Flash slot 1.
  • Meta-data Header: The Flash image contains a metadata header, metadata payload and metadata footer. These components provide the bootloader firmware with information such as the location of the firmware image, security decryption details, signature, sequence number and more. Digital signatures ensure the authenticity of the image and the integrity of the data. A digital signature also ensures that the data in the image remains unmodified (preserving integrity) and intact as it was generated at the source. Refer to Meta Data Header Format of the MPLAB Harmony Wireless BLE in the Reference Documentation from Related Links.
  • OTAU File Encryption: The user can configure the system to encrypt the executable firmware. Encrypting the image ensures data confidentiality, preventing unauthorized parties from accessing the image’s contents. Only the end device can decrypt the image. The system uses the AES128-CBC encryption method. The system encrypts only the firmware image and does not encrypt the OTAU header.
  • Bluetooth LE OTAU Header: The Bluetooth LE OTAU header contains OTAU file information for the Bluetooth LE OTA DFU client (for example, a mobile application) to perform OTA DFU procedures. The system does not send this header over-the-air to the OTAU target.
Figure 6-38. Bluetooth® LE OTA DFU Image File Definition
  • Total Header length: 16 bytes
  • Bluetooth LE OTAU header version (HEADER_VER): 1-byte
    • 0x01: PIC32WM-BW1
    • Others: RFU
  • Flash Image is encrypted or not (FLASH_IMG_ENC): 1-byte
    • 0x00: Firmware image is not encrypted
    • 0x01: Firmware image is encrypted by AES-CBC method
    • Others: RFU
  • Checksum: 2 bytes
    • Contains the checksum value for the entire OTAU file.
  • Flash image ID (FLASH_IMG_ID): 4-bytes
    • Identity number of Flash image.
  • Flash image revision/version (FLASH_IMG_REV): 4-bytes
  • OTAU file type (FILE_TYPE): 1-byte
    • 0x01: Bluetooth LE OTAU file
    • 0x02: Bluetooth LE with Zigbee® combo OTAU file
    • Others: RFU
  • Reserved: 3-bytes
  • OTA file is .bin file which can be generated from MPLAB X tools environment as illustrated below. The detail steps for image generation is explained later.
  • The following figure illustrates the Bluetooth LE OTA header and encryption key configuration:
    Figure 6-39. Bluetooth® LE OTA Header and Encryption Key Configuration in MPLAB® X
  • The following figure illustrates the meta-data header configuration:
    Figure 6-40. Meta-data Header Configuration in MPLAB® X