- Bootloader code is always placed at start of the Boot flash memory (0xBFC00000).
- For devices with lower boot flash memory like few of PIC32MX devices, the bootloader reset handler is placed at start of Bootflash memory (0xBFC00000) and rest of Bootloader code is placed at start of program flash memory (0x9D000000)
- The application code can be placed anywhere in the program flash memory. In PIC32 MX device where bootloader also resides in program flash memory, the application code should be placed after bootloader end.
- As the Bootloader code requires the application start address to be mentioned at compile time, it should match in both the application and bootloader
The Boot Flash and Program Flash memory end addresses may vary from device to device. Refer to respective Data sheets for details of Flash memory layout.
Basic Memory Layout
Fail Safe Update Memory layout
- Fail Safe update mode is only supported for devices which have dual bank support in flash.
- Bootloader code is always placed at start of the Boot flash memory (0xBFC00000) as upon reset the device runs from start of boot flash memory.
- Program Flash memory is split into two equal banks (BANK1 and BANK2). Either of the banks will be mapped to Lower region (0x1D000000) from which the application has to run
- Start address of Active Bank which is mapped to lower region is always 0x9D000000
- Start address of Inactive Bank is from mid of the Program flash memory which can vary from device to device. Refer to respective Data sheets for details of Flash memory layout.
- Row size number of bytes are reserved at end of each bank for storing serial number. This serial number will be used by bootloader to map the appropriate bank to lower memory region and run the application from there
- Actual application start address should always fall into lower mapped region (0x9D000000 to Mid of Flash). Size of the application in the linker script should also not exceed the Mid of flash.
- The address passed to bootloader during programming should fall either in active bank or inactive bank based on update being done.