Loadable Projects and Files: Bootloaders

To combine a bootloader with application code:

  1. 1.Create one project for your application and one project for your bootloader.
  2. 2.Load the bootloader project or hex file into the application project. See Projects Window – Loadables Setup or Project Properties Window – Loading Setup for how to do this.

The next time you build your application project, the resulting hex file will be a combined bootloader/application hex file. Any debug files will also be combined.

For build errors, see The Preferred Method to Use Loadables or the sections below.

MPLAB C Compiler for PIC18 MCUs (MPLAB C18)

This compiler provides application start-up code (c018x.o) that begins at the reset vector (address 0) for use in initializing the software stack, optionally initializing the idata section, and jumping to main(). If this start-up code is left in an application, there will always be a conflict with the bootloader code reset and you will get a linker error message about a data conflict.

A resolution would be to edit the start-up code to begin at an address other than 0.

MPLAB XC8 – PIC18 MCU Example

The following Microchip webinar details how to combine a bootloader with application code for a PIC18 MCU using MPLAB XC8 and MPLAB X IDE:
 Linking PIC18 Bootloaders and Applications

MPLAB XC16 Bootloader Example

See the “MPLAB XC16 C Compiler User’s Guide” (DS50002071) or Help file for an example bootloader.

MPLAB XC32 Bootloader Example

See the “PIC32 Bootloader Application Note” (DS01388) on the Microchip website.