1.3.6 Using the Unified Bootloader Host Application

Once the application is running in standalone mode with the 16-Bit Bootloader:Application library, it can be programmed with the bootloader using the Unified Bootloader Host Application (UBHA) to download the code. https://microchip.com/16-bit-bootloader

Download and program the bootloader code discussed on Bootloader Generation Procedure.

Once downloaded, run the UBHA. The screen below will show up.

Figure 1-5.  Initial UBHA Screen

 

The first thing to enter is the device architecture, PIC24\dsPIC33\PIC32MM. Once this is added the screen will update to the screen below.  

Figure 1-6.  UBHA Filled in Screen
Several things need to be entered here.
  1. In Settings, select the correct COM port and enter the configuration to match what was programmed into the UART for the bootloader. (38400:8:1) for this example.

  2. In File, enter the name and location of the application hex file found in the project directory under dist\default\production

  3. To populate the Application Start and Application End addresses, click the Read Device Settings button. This will query the bootloader and retrieve the values. For this project and device, the values should be 0x1400 and 0x153FE.

  4. Choose to enable or disable Enable Reset after Program and Enable Self Verification after Program.

Once all the items are entered, press Program Device to start the programming process. The UBHA will then read the part data, erase the application space memory and then program the application into the part. If readback is enabled, the UBHA will read back the data from the device and verify that it matches what was sent. If self-verification is enabled, it will then verify the contents of the flash match the hex file contents. Finally, UBHA will send a reset command to the part if Reset Device after Program is enabled. This will cause the part to reset. After reset, the bootloader will quickly re-run the first part of the bootloader, see that there is a valid image now in memory and jump to the application code.

If errors are encountered during the programming process an error message will appear. More error information on the problem can be found by going to Tools->Console to see the detailed error message.

This example was meant to provide the user a quick walk through of using the 16-bit bootloader and UBHA. More information on the details can be found in the bootloader help file.