3 Configuring the Dual-Bank Bootloader

The dual-bank bootloader is referred to as the UART fail-safe bootloader in MPLAB Harmony v3, and it comprises of these applications:

  • Bootloader: uart_fail_safe_bootloader_sam_e54_xpro is the bootloader code, which performs upgrading of the firmware.
  • Test application: uart_fail_safe_bootloader_test_app_sam_e54_xpro is the user application code.
Note: Projects are available in the bootloader_apps_uart MPLAB Harmony v3 repository, users can download it from the following path: <Harmony framework>\bootloader_apps_uart\apps\uart_fail_safe_bootloader\.

Configuring the bootloader library in MPLAB Harmony v3

  • Use Dual-Bank for Safe Flash Update:
    • Can be used to configure the bootloader to use the dual banks of the device to upload the application.
  • Bootloader Peripheral Used:
    • Specifies the communication peripheral used by the bootloader to receive the application in this case, it is the serial communication (SERCOM) or USART.
  • Bootloader Memory Used:
    • Specifies the memory peripheral used by the bootloader to perform Flash operations.
  • Bootloader Size (Bytes):
    • Specifies the maximum size of Flash required by the bootloader.
    • This size is calculated based on the bootloader type and memory used.
    • This size will vary from device to device and must always be aligned with the device erase unit size.
  • Enable Bootloader Trigger from Firmware:
    • This option can be used to force trigger the bootloader from the application firmware after a soft reset.
  • Number of Bytes to Reserve from Start of RAM:
    • This option adds the provided offset to the RAM start address in the bootloader linker script.
    • The application firmware can store a pattern in the reserved bytes region of the RAM start for the bootloader to check at reset in the bootloader_Trigger() function.
Figure 3-1. Bootloader Configuration
  • Application Start Address (Hex):
    • Start address of the application is programmed by the bootloader.
    • The application start address is auto filled by the MCC when the user configures the bootloader size as shown in the previous figure. This value will be equal to the bootloader size (size of bootloader = 8K (0x00002000)).
    • This value will be used by the bootloader to jump to the application at device reset.
Figure 3-2. Application Start Address Configuration