4.3.1 Combining the Bootloader and Application for PIC® Devices

This section demonstrates how to merge the bootloader and application projects into a single hex file for 8-bit PIC devices.

In a production environment, it is common practice to build both the bootloader code an the application code together into a single hex file. This allows both projects to be programmed at the exact same time. This section demonstrates how to combine the bootloader and application projects into a unified hex file using MPLAB X.

Important: Make sure to match the Clock Control and Configuration Bits settings to the bootloader project settings. The update might fail if there are differences.
  1. Set the application project as the Main Project.
  2. Create a new configuration in the application project and rename it to ‘COMBINED’.

    Navigate to Project Properties>Manage Configurations.... Click Duplicate with the bootable configuration selected and then Rename the resulting copy to ‘COMBINED’. Then click OK and OK again.

    Figure 4-55. Create the New Combined Configuration
  3. Add the bootloader configuration as a loadable project to the ‘COMBINED’ application configuration.

    In the COMBINED configuration, navigate to Project Properties>Loading and then click the Add Loadable Project... button.

    Figure 4-56. Adding the Bootloader to the Application
    Figure 4-57. Select the Bootloader default project

    Click Add and then Apply.

    Figure 4-58. Completed COMBINED Configuration
  4. Figure 4-59. Select the COMBINED Configuration
  5. Clean and Build the COMBINED configuration.