Loadable Projects and Files: Bootloaders

To combine a bootloader with application code:

  1. Create one project for your application and one project for your bootloader.
  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.

Consideration #1: 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.

Consideration #2: 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 & Applications

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.