3.3 Configure the First Stage Bootloader to Boot from the Serial Flash Memory
The first-stage bootloader must be configured to boot from serial Flash memory. This can be done using SAM-BA commands. To information about the boot process and first-stage boot configuration, refer to the section "Boot Strategies" of the respective data sheet.
The user accesses a list of all applets available by entering the command:
sam-ba -p <port> -b <board> -a help
- -p, --port <port[:options:...]> where port can be j-link or serial
- -b, --board <board[:options:...]> where board can be sam9x60-ek or sama7g54-ek
The boot configuration packet (BCP) can be written either to Emulation SRAM or to OTPC (One Time Programmable Memory Controller).
The user can program BCP to Emulation SRAM during the development phase and to OTPC during production phase.
The SAM-BA commands listed below can be used to program BCP to Emulation SRAM:
- Enable
emulation:
sam-ba -p <port> -b <board> -a bootconfig -c writecfg:bscr:EMULATION_ENABLED
- Read bscr and verify emulation is
enabled:
sam-ba -p <port> -b <board> -a bootconfig -c readcfg:bscr
- Emulation SRAM
reset:
sam-ba -p <port> -b <board> -a bootconfig -c resetemul
- Refresh Emulation
SRAM:
sam-ba -p <port> -b <board> -a bootconfig -c refreshcfg:emul
- Enable QSPI0 as external
NVM:
sam-ba -p <port> -b <board> -a bootconfig -c writecfg:bcp-emul:QSPI0_IOSET1
- Read bcp_emul and verify whether QSPI
is set as external
NVM:
sam-ba -p <port> -b <board> -a bootconfig -c readcfg:bcp-emul
- Reset the board by pressing and then releasing the reset button.
An example using SAMA7G54-EK is shown below:
The steps below can be used to program BCP to OTPC:
- Disable
emulation:
sam-ba -p <port> -b <board> -a bootconfig -c writecfg:bscr:EMULATION_DISABLED
- Read bscr and verify emulation is
disabled:
sam-ba -p <port> -b <board> -a bootconfig -c readcfg:bscr
- Refresh OTP:
sam-ba -p <port>-b <board> -a bootconfig -c refreshcfg:otp
- Enable QSPI0 as external
NVM:
sam-ba -p <port> -b <board> -a bootconfig -c writecfg:bcp-otp:QSPI0_IOSET1
- Read bcp_otp and verify whether QSPI
is set as external
NVM:
sam-ba -p <port> -b <board> -a bootconfig -c readcfg:bcp-otp
- Reset the board by pressing and then releasing the reset button.