4.1 Running the Bootloader Application
Follow these steps to run the bootloader application:
- Connect a micro USB cable to the DEBUG port of the SAM E54 Xplained Pro board.
- Build and program the UART fail safe bootloader (dual-bank bootloader) using the MPLAB X IDE.
- Launch the MCC for the UART fail safe
bootloader application:
- Disable the Fuse Settings as shown in the Test Application Configurations section.
- Regenerate the code.
- Enable and execute this line after build option in the MPLAB X IDE Project Properties as shown in the Test Application Configurations section Figure 3-5.
- Build the bootloader application
(uart_fail_safe_bootloader_sam_e54_xpro) again using the MPLAB X IDE.
- This is required to generate the binary file for the bootloader application.
- Build the Test application (uart_fail_safe_bootloader_test_app_sam_e54_xpro) using the MPLAB X IDE but do not program.
- Run
btl_app_merge_bin.py
from the command prompt to merge the generated bootloader binary and the application binary. The following output must be displayed on the command prompt.Command: python <python script> -o <Offset> -b bootloader image -a application image <Offset>: Application start address (E.g. - 0x00002000) <python script>: btl_app_merge_bin.py Example: python <harmony3_path>\bootloader\tools\btl_app_merge_bin.py -o 0x00002000 -b <harmony3_path>\bootloader\apps\uart_fail_safe_bootloader\bootloader\firmware\sam_e54_xpro.X\dist\sam_e54_xpro\production \sam_e54_xpro.X.production.bin -a <harmony3_path>\bootloader\apps\uart_fail_safe_bootloader\test_app\firmware\sam_e54_xpro.X\dist\sam_e54_xpro\production \sam_e54_xpro.X.production.bin
Note: Running the help command provides a brief overview of options available as shown below. Command: python <python script> --help <python script>: btl_app_merge_bin.py Example: python <harmony3_path>\bootloader\tools\btl_app_merge_bin.py --help
- Run
btl_host.py
from the command prompt to program the merged binary to the opposite panel. The merged binarybtl_app_merged.bin
will be generated in the path from wherebtl_app_merge_bin.py
was executed.Command: python <python script> -v -s -i <COM PORT> -d <Device Name> -a <Address> -f <bootloader_application_merged_image> <python script>: btl_host.py <COM PORT>: Serial communication port <Device Name>: SAME54 <Address>: Application start address (Bank A: 0x00002000 / Bank B: 0x00080000) Example: python <harmony3_path>\bootloader\tools\btl_host.py -v -s -i COM18 -d same5x -a 0x00080000 -f btl_app_merged.bin
Note: Running the help command provides a brief overview of options available as shown below. Command: python <python script> --help <python script>: btl_host.py Command: python <harmony3_path>\bootloader\tools\btl_host.py --help
- The following figure shows the example output of the firmware programming.
Note:
- After the successful programming of the application, Bank B is mapped to the 0x00000000 address, and Bank A is mapped to the 0x00080000 address.
- The starting address for the firmware always remains the same, due to the banks being swapped after each firmware upgrade.