1.3.2 Bootloader:Bootloader Generation Procedure

The first step is to create the bootloader project which will reside at the beginning of flash along with the interrupt tables. The project will be called PIC24FJ128GA204_BootloaderStandalone. After creating the initial project the user should open the bootloader generation library shown below.

Select Device Resources->Libraries->16-bit Bootloader->16-bit Bootloader:Bootloader

This will open the Bootloader configuration screen below.

Figure 1-1.  Bootloader Configuration Screen

The bootloader memory map is described in the bootloader help, under Bootloader Memory Maps. For this example, use the default bootloader size of 0x1800.

By default, the library will reserve the first 0x1400 for the bootloader and the application will start at 0x1800. See the help file Bootloader Memory Maps, Defining the Size of the Bootloader for help with determining the size to use.

Then select the peripheral and protocol to use as a communication peripheral. To do this, select a peripheral from the dropdown box at the top of the Bootloader Setting dialog. For this example, use the UART1 Foundation Services from the protocol drop down box. When this is selected, the UART configuration is opened automatically. For this example, configure the UART for (38400|8|1) for speed and format. Keep Interrupts and redirection disabled as shown below.

 

Next, go to the PIN Manager Grid and configure RB5 to use the UART RX and RB6 to use the UART TX, Start High. Then configure RA9 as outputs for the LED and give it the name LED1. Finally, configure RC9 as an input for the switch and name it RUN_BL_SW. A screen shot of the pin configuration below. These pins depend on the part and the board designs.

Figure 1-2.  Bootloader Pin Config