1 MPLAB® Harmony v3 UART-I2C Factory Bootloader for PIC32CM LE00/LS00/LS60
The Bootloader programmed at production by Microchip is an MPLAB Harmony v3-based Bootloader capable of programming an application binary using either the UART or I2C interface.
Key Features
- The Bootloader is programmed at the
                Flash memory location (
0x00000000) and takes up to 4 KB of Flash memory for PIC32CM LE00 or 5 KB of Flash memory for PIC32CM LS00/LS60 devices. It is protected by default using the SULCK and BOOTPROT Fuse settings from any erase-writes. The BOOTPROT value is set to 4 KB (0x1000) for PIC32CM LE00 or 5 KB (0x1400) for PIC32CM LS00/LS60 devices. - The Bootloader startup code copies
                the Bootloader from the Flash memory to the SRAM from (
0x20001010) before calling the main function. The main function (and therefore the entire Bootloader) runs from the SRAM to allow upgrading of the Bootloader code itself in Flash memory. Bootloader code will unlock the BOOTPROT region before updating if bootloader region has to be programmed. - The Bootloader provides a feature to read the current version of the Bootloader by using the read version command.
 - The Bootloader provides a feature to program the Fuse settings using a separate command.
 - The Bootloader provides two options
                to trigger the Bootloader mode:
- External trigger: Bootloader will be triggered based on the status of a dedicated GPIO pin.
 - Internal trigger: Bootloader will be triggered based on the trigger pattern written at a specific location in the SRAM by the application firmware.
 
 - After a new application image is programmed, the Bootloader will verify the programmed application space by generating a CRC-32 value and comparing it with the CRC-32 received from the Host. The application CRC will not be verified after every reset before jumping to the application space for faster startup.
 - The Bootloader will read the first 4
                bytes of application space 
0x1000for PIC32CM LE00 or0x1400for PIC32CM LS00/LS60 to decide if a valid application is present. If the contents of the first 4 bytes are not0xFFFFFFFF, then the Bootloader assumes a valid application is present and jumps to the application. If a valid application is not present, then the Bootloader will wait, and remain in Bootloader mode. 
Key Features for TrustZone variants PIC32CM LS00/LS60
- The Bootloader is part of the Secure Flash BOOTPROT (BS) region with no BNSC region.
 - The Bootloader will always jump to
                    Application Secure Region at location 
0x1400for PIC32CM LS00/LS60 after programming. Therefore, the applications Reset handler should be part of Application Secure Region which can further call its Non-Secure region if any. 
Key Requirements
- By default, the Bootloader expects
                the application to start from the location 
0x1000for PIC32CM LE00 or0x1400for PIC32CM LS00/LS60 devices. Therefore, the application should be built to start from the Flash location0x1000for PIC32CM LE00 or0x1400for PIC32CM LS00/LS60 devices. - For TrustZone variants, proper Fuse settings required by the application have to be sent along with application binary.
 - The external pull-ups must be used for the I2C SDA and SCL lines.
 
        
        
        