6.1 Bootloader

Introduction

A bootloader is a small application that can be used to upgrade firmware on a target device without the need for an external programmer or debugger. For PIC32CX-BZ2 standalone bootloader, it provides the following functionalities:
  • Device Firmware Upgrade over Serial (UART) interface, this is also called DFU over serial.
  • Provide functionality support for wireless Over-The-Air Update, which is also called OTAU.
  • Provide various approaches to verify and authenticate firmware if enabled.
  • Display console message if enabled.

PIC32CX-BZ2 Standalone Bootloader Component

PIC32CX-BZ2 bootloader is a standalone Harmony component used to configure bootloader code for PIC32WM-BW1 device. For more details about PIC32CX-BZ2 standalone bootloader component, refer to the MPLAB Harmony PIC32CX-BZ System Services in the Reference Documentation from Related Links. The users can find more information as listed below:
  • Memory layout of the PIC32WM-BW1
  • Boot memory information
  • Image metadata definition
  • Working of bootloader
  • Flow diagram of bootloader
  • Bootloader configuration options
  • Bootloader and DFU API usage

Bootloader Example Code

PIC32CX-BZ2 bootloader provides two methods to enter the DFU mode:
  • GPIO trigger method – This method uses a specific GPIO pin to trigger the bootloader and enter DFU mode. The example code demonstrates how to implement this trigger.
    • The example code for the GPIO trigger method is available at wireless_apps_pic32_bw1\apps\bootloader\bootloader_GPIO.
    • The precompiled hex file for this method is available at wireless_apps_pic32_bw1\apps\bootloader\bootloader_GPIO\precompiled_hex\bootloader_gpio.X.production.hex
  • Timer based trigger – This method uses a timer to trigger the bootloader and enter DFU mode.
    • The precompiled hex file for the timer-based trigger method is located at wireless_apps_pic32_bw1\apps\bootloader\bootloader_timer\precompiled_hex\bootloader_timer.X.production.hex

The following sections provide more information about these methods.