SAMA7D65 – Dual Boot Feature
Introduction
In this training, you will learn about the dual boot features of the SAMA7D65 microprocessor (MPU) and you will also learn how to use and test the features. Before learning the dual boot feature, you need to learn how to generate a bootstrap image with a header.
What you will need:
- SAMA7D65 Curiosity Kit
- Personal computer (Windows®, macOS®, Linux®) running a terminal emulation program
- USB-to-Serial 3.3 or 5.0 VDC TTL Level adapter with a 6-pin single-in-line 0.1” pitch connector
- To power the SAMA7D65 Curiosity, you will either:
- Connect a USB Type-C® cable to the USB-A port (J3) (included)
- Connect an external 5 VDC power supply to DC Jack (J1)
- SAM-BA® In-System Programmer (ISP).
Prerequisites
- Familiarity with the features of the SAMA7D65 Curiosity Kit
- Knowledgeable of the SAMA7D6 series boot process
- Familiarity with SAM-BA ISP
- MPLAB® X IDE installed on the host computer
- MPLAB XC32 compiler installed on the host computer
- Make sure you have downloaded the latest SAM-BA software version 3.9.1 or above
SAMA7D65 Curiosity Kit
See the "SAMA7D65-Curiosity – Features" page.
Set up the SAMA7D65 Curiosity as listed below to the host computer.
Jumpers
- Ensure Jumpers J39 and J36 are in the open position.
- Set the remaining jumpers to their default positions as shown in the "Jumper Summary" section of the "SAMA7D65-Curiosity – Features" page.
SD Memory Cards
- Ensure no SD memory card is plugged into the SD card (J4) connector.
Power
- Apply power as shown in the "Power Options" section of the "SAMA7D65-Curiosity – Features" page.
Console Serial Communications
- To view the target console, connect the host computer running a terminal emulation program in accordance with the "SAMA7D65-Curiosity – Console Serial Communications" page.
How to Generate a Bootstrap Image With a Header
The bootstrap image with header can be generated by two different methods: 1) configuring the at91bootstrap source code using MPLAB X IDE, or 2) using SAM-BA ISP commands.
- Method 1: Configure at91bootstrap
- See the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from SD Memory Card" page for how to generate a bootable SAMA7D65 bootstrap image file named "boot.bin" with a bootstrap image header.
- Method 2: SAM-BA ISP Command
- Ensure you have built at91bootstrap as mentioned in the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from SD Memory Card" page.
In this section, you will generate an at91bootstrap binary image boot.bin with a header from the following commands:
Open a command prompt and change the directory to the location of boot.bin.
<project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin
Now generate a bootable SAMA7D65 bootstrap image file named "boot_img.bin" with a defined version of 4.25 from a bootstrap binary file named "boot.bin":
$ sam-ba -u gen_image:sama7d65:boot.bin:boot_image.bin:4:25
To view the header information stored in the bootstrap image file, boot_image.bin, use the following command:
$ sam-ba -u parse_image:boot_image.bin
What is Dual Boot?
The Dual Bootstrap feature enables the ROM code to look for a second (secondary) bootstrap, in addition to the first (primary) bootstrap, on the same NVM. This feature is based on the bootstrap version indicated in the bootstrap image header.
When Dual Bootstrap is enabled, the ROM code selects which bootstrap to launch according to the version number. The ROM code launches the bootstrap with the highest version number. If the primary and secondary bootstrap versions are identical, the primary one is launched. If the selected bootstrap is not valid, the ROM code tries to load and launch the other one.
To update the at91bootstrap version number, refer to the "How to Generate Bootstrap Image With Header" section.
How to Enable Dual Boot on an SD Card
We can enable dual boot using OTP Emulation mode or using real OTP memory on the SAMA7D65 Curiosity Kit.
Using OTP Emulation
Remove the SD card and ensure jumper J36 and J39 are removed. Press the RESET (SW4) button. Observe the RomBOOT print on the serial terminal.
Open the command prompt and enter the following command:
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bscr:EMULATION_ENABLED
This enables emulation mode.
Reset emulation.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c resetemul
Refresh emulation.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c refreshcfg:emul
Soft Reset the board.
$ sam-ba -p serial -d sama7d65 -a reset
Enable dual boot by writing the boot configuration packet.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bcp-emul:FLEXCOM6_USART_IOSET4,SDMMC1_IOSET1_NO_CD_DB@_alt
Using Real OTP Memory
Remove the SD card and ensure that jumpers J36 and J39 are removed.
Press the RESET (SW4) button. Observe the RomBOOT print on the serial terminal.
Disable Emulation mode.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bscr:EMULATION_DISABLED
If a boot configuration packet has already been written to OTP, mark it as invalid.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c invalidatecfg:bcp-otp
Refresh OTP.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c refreshcfg:otp
This enables the dual boot feature by writing boot configuration packet.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bcp-otp:FLEXCOM6_USART_IOSET4,SDMMC1_IOSET1_NO_CD_DB@_alt
How to Implement Dual Boot on an SD Card
Before implementing the dual boot feature, we need to have at91bootstrap images with two different version numbers.
- Example:
- One with version number 3.00 (Build time: 2025-07-04 14:38:43) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-07-04 14:21:30) named "boot_alt.bin"
Emulation Mode
Scenario 1: Primary and Secondary bootstrap Versions are Different
Copy both boot.bin and boot_alt.bin into the FAT partition of the SD memory card.
Insert the SD memory card and press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot.
Scenario 2: Primary and Secondary bootstrap Versions are Identical
Example:
- One with version number 4.00 (Build time: 2025-08-06 14:35:02) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-07-04 14:21:30) named "boot_alt.bin"
Copy both boot.bin and boot_alt.bin into the FAT partition of the SD memory card.
Insert the SD memory card and press the RESET(SW4) button.
Since primary and secondary bootstrap versions are identical, the primary bootstrap image named boot.bin (Build time: 2025-08-06 14:35:02) will boot.
Scenario 3: Primary bootstrap Invalid and Secondary bootstrap Valid
- Example:
- One bootstrap without a version number named "boot.bin"
- Another with version number 4.00 (Build time: 2025-07-04 14:21:30) named "boot_alt.bin"
Copy boot.bin (without header) from the location <project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin (refer to the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from SD Memory Card" page) and boot_alt.bin into the FAT partition of the SD memory card.
Insert the SD memory card and press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with valid version number 4.00 will boot.
Real OTP Memory
Scenario 1: Primary and Secondary bootstrap Versions are Different
Copy both boot.bin and boot_alt.bin into the FAT partition of the SD memory card.
Insert the SD memory card and press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot.
Scenario 2: Primary and Secondary bootstrap Versions are Identical
- Example:
- One with version number 4.00 (Build time: 2025-08-06 14:35:02) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-07-04 14:21:30) named "boot_alt.bin"
Copy both boot.bin and boot_alt.bin into the FAT partition of SD memory card.
Insert SD memory card and press RESET(SW4) Button.
Since primary and secondary bootstrap versions are identical, the primary bootstrap image named as boot.bin (Build time: 2025-08-06 14:35:02) will boot.
Scenario 3: Primary bootstrap Invalid and Secondary bootstrap Valid
- Example:
- One bootstrap without a version number named "boot.bin"
- Another with version number 4.00 (Build time: 2025-07-04 14:21:30) named "boot_alt.bin"
Copy boot.bin (without header) from the location <project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin (refer to the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from SD Memory Card" page) and boot_alt.bin into the FAT partition of the SD memory card.
Insert the SD memory card and press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with valid version number 4.00 will boot.
How to Enable Dual Boot on NAND Flash
We can enable dual boot using OTP emulation mode or using real OTP memory on the SAMA7D65 Curiosity Kit.
Using OTP Emulation
Remove the SD card and ensure jumpers J36 and J39 are removed.
Press the RESET (SW4) button. Observe the RomBOOT print on the serial terminal.
Now open command prompt and enter the following command:
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bscr:EMULATION_ENABLED
This enables emulation mode.
Reset Emulation.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c resetemul
Refresh Emulation.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c refreshcfg:emul
Soft Reset the board.
$ sam-ba -p serial -d sama7d65 -a reset
Now enable dual boot by writing the boot configuration packet.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bcp-emul:FLEXCOM6_USART_IOSET4,NFC_IOSET1_PMECC0xc2605007_DB@0x20000
Using Real OTP Memory
Remove the SD card and ensure that jumpers J36 and J39 are removed.
Press the RESET (SW4) button. Observe the RomBOOT print on the serial terminal.
Disable Emulation mode.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bscr:EMULATION_DISABLED
If a boot configuration packet has already been written to OTP, invalidate it before proceeding.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c invalidatecfg:bcp-otp
Refresh OTP.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c refreshcfg:otp
This enables the dual boot feature by writing boot configuration packet.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bcp-otp:FLEXCOM6_USART_IOSET4,NFC_IOSET1_PMECC0xc2605007_DB@0x20000
How to Implement Dual Boot on NAND Flash
Before implementing the dual boot feature, we need to have an at91bootstrap image with two different version numbers.
- Example:
- One with version number 3.00 (Build time: 2025-08-12 14:52:18) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 14:54:57) named "boot_alt.bin"
Emulation Mode
Scenario 1: Primary and Secondary bootstrap Versions are Different
Close jumper J36 (NAND BOOT).
Write the primary bootstrap image file in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 14:54:57 as highlighted in the image.
Scenario 2: Primary and Secondary bootstrap Versions are Identical
- Example:
- One with version number 4.00 (Build time: 2025-08-12 15:47:18) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 14:54:57) named "boot_alt.bin"
Close jumper J36 (NAND BOOT).
Write the primary bootstrap image file in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since primary and secondary bootstrap versions are identical, the primary bootstrap image named "boot.bin" (Build time: 2025-08-12 15:47:18) will boot. Verify the same from the debug prints that the build time is 2025-08-12 15:47:18 as highlighted in the image.
Scenario 3: Primary bootstrap Invalid and Secondary bootstrap Valid
- Example:
- One bootstrap without version number from the location <project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin (refer to the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from NAND Flash Memory" page) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 14:54:57) named "boot_alt.bin"
Close jumper J36 (NAND BOOT).
Write the primary bootstrap image file in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with valid version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 14:54:57 as highlighted in the image.
Real OTP Memory
Scenario 1: Primary and Secondary bootstrap Versions are Different
Close jumper J36 (NAND BOOT).
Write the primary bootstrap image file in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 14:54:57 as highlighted in the image.
Scenario 2: Primary and Secondary bootstrap Versions are Identical
- Example:
- One with version number 4.00 (Build time: 2025-08-12 15:47:18) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 14:54:57) named "boot_alt.bin"
Remove jumper J36 (NAND BOOT). Press the RESET (SW4) button.
Close jumper J36 (NAND BOOT).
Write the primary bootstrap image file in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since primary and secondary bootstrap versions are identical, the primary bootstrap image named "boot.bin" (Build time: 2025-08-12 15:47:18) will boot. Verify the same from the debug prints that the build time is 2025-08-12 15:47:18 as highlighted in the image.
Scenario 3: Primary bootstrap Invalid and Secondary bootstrap Valid
- Example:
- One bootstrap without version number from the location <project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin (Refer to the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from NAND Flash Memory" page) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 14:54:57) named "boot_alt.bin"
Remove jumper J36 (NAND BOOT). Press the RESET (SW4) button.
Close jumper J36 (NAND BOOT).
Write the primary bootstrap image file in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the NAND Flash memory.
$ sam-ba -p serial -d sama7d65 -a nandflash:1:8:0xc2605007 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press RESET(SW4) Button.
Since we have enabled dual boot, the bootstrap image with valid version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 14:54:57 as highlighted in the image.
How to Enable Dual Boot on QSPI Flash
We can enable dual boot using OTP Emulation mode or using real OTP memory on the SAMA7D65 Curiosity Kit.
Using OTP Emulation
Remove the SD card and ensure that jumpers J36 and J39 are removed.
Press the RESET (SW4) button. Observe the RomBOOT print on the serial terminal.
Now open the command prompt and enter the following command:
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bscr:EMULATION_ENABLED
This enables emulation mode.
Reset Emulation.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c resetemul
Refresh Emulation.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c refreshcfg:emul
Soft Reset the board.
$ sam-ba -p serial -d sama7d65 -a reset
Now enable dual boot by writing the boot configuration packet.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bcp-emul:FLEXCOM6_USART_IOSET4,QSPI0_IOSET1_DB@0x20000
Using Real OTP Memory
Remove the SD card and ensure that jumpers J36 and J39 are removed.
Press the RESET (SW4) button Observe the RomBOOT print on the serial terminal.
Disable Emulation mode.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bscr:EMULATION_DISABLED
If a Boot Configuration Packet has already been written to OTP, invalidate the existing packet before proceeding.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c invalidatecfg:bcp-otp
Refresh OTP.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c refreshcfg:otp
This enables the dual boot feature by writing Boot Configuration Packet.
$ sam-ba -p serial -d sama7d65 -a bootconfig -c writecfg:bcp-otp:FLEXCOM6_USART_IOSET4,QSPI0_IOSET1_DB@0x20000
How to Implement Dual Boot on QSPI Flash
Before implementing the dual boot feature, we need to have an at91bootstrap image with two different version numbers.
- Example:
- One with version number 3.00 (Build time: 2025-08-12 17:17:35) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 17:22:08) named "boot_alt.bin"
Emulation Mode
Scenario 1: Primary and Secondary bootstrap Versions are Different
Close jumper J39 (QSPI BOOT).
Write the primary bootstrap image file in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 17:22:08 as highlighted in the image.
Scenario 2: Primary and Secondary bootstrap Versions are Identical
- Example:
- One with version number 4.00 (Build time: 2025-08-13 14:53:13) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 17:22:08) named "boot_alt.bin"
Close jumper J39 (QSPI BOOT).
Write the primary bootstrap image file in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since primary and secondary bootstrap versions are identical, the primary bootstrap image named as boot.bin (Build time: 2025-08-13 14:53:13) will boot. Verify the same from the debug prints that the build time is 2025-08-13 14:53:13 as highlighted in the image.
Scenario 3: Primary bootstrap Invalid and Secondary bootstrap Valid
- Example:
- One bootstrap without version number from the location <project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin (refer to the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from NOR Flash (QSPI) Memory" page) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 17:22:08) named "boot_alt.bin"
Close jumper J39 (QSPI BOOT).
Write the primary bootstrap image file in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the QSPI NOR flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 17:22:08 as highlighted in the image.
Real OTP Memory
Scenario 1: Primary and Secondary bootstrap Versions are Different
Close jumper J39 (QSPI BOOT).
Write the primary bootstrap image file in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 17:22:08 as highlighted in the image.
Scenario 2: Primary and Secondary bootstrap Versions are Identical
- Example:
- One with version number 4.00 (Build time: 2025-08-13 14:53:13) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 17:22:08) named "boot_alt.bin"
Remove jumper J39 (QSPI BOOT). Press the RESET (SW4) button. Close jumper J39 (QSPI BOOT).
Write the primary bootstrap image file in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since primary and secondary bootstrap versions are identical, the primary bootstrap image named as boot.bin (Build time: 2025-08-13 14:53:13) will boot. Verify the same from the debug prints that the build time is 2025-08-13 14:53:13 as highlighted in image.
Scenario 3: Primary bootstrap Invalid and Secondary bootstrap Valid
- Example:
- One bootstrap without version number from the location <project_directory>\at91bootstrap-4.0.11\build\binaries\boot.bin (refer to the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from NOR Flash (QSPI) Memory" page) named "boot.bin"
- Another with version number 4.00 (Build time: 2025-08-12 17:22:08) named "boot_alt.bin"
Remove jumper J39 (QSPI BOOT). Press the RESET (SW4) button. Close jumper J39 (QSPI BOOT).
Write the primary bootstrap image file in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c erase -c write:boot.bin -c verify:boot.bin
Write the secondary bootstrap image file at address 0x20000 in the QSPI NOR Flash memory.
$ sam-ba -p serial -d sama7d65 -a qspiflash:0:1:50 -c write:boot_alt.bin:0x20000 -c verify:boot_alt.bin:0x20000
Press the RESET(SW4) button.
Since we have enabled dual boot, the bootstrap image with the higher version number 4.00 will boot. Verify the same from the debug prints that the build time is 2025-08-12 17:22:08 as highlighted in the image.
Summary
In this training, you downloaded, configured, and built at91bootstrap using MPLAB X IDE to run on the SAMA7D65 Curiosity Kit. Finally, you cleaned and built the at91bootstrap for production.
What’s Next?
Once the second-stage bootloader, at91bootstrap (boot.bin), has been configured and built, the next step is to configure and build the application (harmony.bin) binary image. The following training topics show how this is done for NAND Flash, NOR Flash (QSPI), and an SD memory card.
Learn More
- SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from NAND Flash Memory
- SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from NOR Flash (QSPI) Memory
- SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB® Harmony v3 Application from SD Memory Card
- SAMA7D65-Curiosity – Writing MPLAB® Harmony v3 Application and at91bootstrap to NAND Flash Memory Using SAM-BA® ISP
- SAMA7D65-Curiosity – Writing MPLAB® Harmony v3 Application and at91bootstrap to NOR Flash (QSPI) Memory Using SAM-BA® ISP
- SAMA7D65-Curiosity – Copy MPLAB® Harmony v3 Application and at91bootstrap to SD Memory Card