3 Unified Bootloader Host Application (UBHA)

Introduction

The Unified Bootloader Host Application (UBHA) is responsible for transferring an embedded application program (the .hex file) from the host machine (development host) to a target device (a device running the embedded application). It talks to the bootloader present on the target device by sending appropriate commands and it transfers data (the embedded application program) using a communication protocol. It can be used to program the Flash memory for PIC16, PIC18 and AVR devices. EEPROM writes are also supported.

Prerequisites

Figure 3-1. Unified Bootloader Host Application User Interface (PIC)
Figure 3-2. Unified Bootloader Host Application User Interface (AVR)

UBHA Workflow

The workflow required for UBHA to function with the bootloader firmware is described below. All the steps mentioned here are required (unless stated otherwise) to successfully load a new application onto a device with a bootloader.

Note: Skip step 3 for AVR.
  1. Select the architecture for the bootloader using the Device Architecture menu.
    Note: PIC devices need to select the correct architecture from the 8-Bit Architecture option, as well as the Device Architecture.
    Figure 3-3. UBHA Device Architecture
  2. Select the COM port that the target device is connected to. Navigate to Settings>Serial>COM Port.

    Figure 3-4. Serial Port Settings
  3. Input the Bootloader Offset (End Application Start Address) and the Program Memory Size (Total Flash Size). The other address values seen here are ignored by UBHA unless the Program EEData or Program Config Words options are checked.

    Note: This value is in bytes. If the target device uses word addresses, then this value will need to be multiplied by 0x2.

    Example: If the boot end address is 0x400 in the bootloader UI, then this value would be 0x800 for PIC16F devices.

    Figure 3-5. Bootloader Memory Settings
  4. Select the application hex file to bootload. Navigate to File>Open/Load File (*.hex).

    Figure 3-6. Load Bootloader Hex File
  5. Open the output console. Navigate to Tools>Console.

    Figure 3-7. UBHA Console Window
  6. Click the Program Device button.

UBHA Device Firmware Upgrade

This section presents the device firmware upgrade flow for UBHA. This figure describes the PIC logical flow of the UBHA Device Firmware Upgrade (DFU) process. After a command is sent to the bootloader, UBHA will wait roughly 20s before timing out with a Serial Port Exception.
Note: AVR devices use this same process flow, but UBHA does not support checksum for AVR.
Figure 3-8. UBHA DFU Flow
Known Issues
  • When using a version of Java greater than v1.8.0_251, selecting a UART COM port and selecting ”Apply” causes the UBHA to crash. To avoid this use a version of Java at or below version 1.8.0_251.
  • The warning “Application Offset exists between ROWS/PAGE boundaries” might be shown incorrectly, even though the application offset is at the start of a page. Make sure that the application start address is at the beginning of a page by referring to the device data sheet.
  • The UBHA COM port can become corrupted if a failed bootload occurs and the lines are busy. This prevents the read version command from being successful. Restarting the UBHA will fix this issue.