Search code examples
bootloadermicrochipmplabpic32

MPLAB X IDE: Writing Boot Loader application for PIC32


I'm new with Microchip programming and I'm getting some troubles. I need to write a bootloader application using MPLAB X IDE but I don't know how to set up the compiler/linker in order to create an executable mapped in the right regions of memory.

Consuting the datasheet of the component, I can see this addresses:

Program Flash --> 0x1D000000 - 0x1D1FFFFF
Boot Flash --> 0x1FC00000 - 0x1FC73FFF

How can I create a program that uses the boot flash? Which parameters have I to change? Over the net I've read that maybe I should use a linker script but I can't figure out how to use them.

Can you please provide me some information?


Solution

  • I went through similar issue.

    The best way to do it is to use the Harmony framework to generate the linker script for the bootloader with the correct memory regions for your chip.

    Just create a dummy project with the bootloader setup and compile, it will generate the linker script.

    Once you get the linker script, you can import it on your project.

    You also need to do the same for the application code as the linker is different as well for it because of the initialisation regions.