4.1.1.2 Booting from a QSPI Memory

Before enabling boot from a QSPI memory, the configuration described below is mandatory.

  1. Go to the SAM-BA installation path.

    <user>\sam-ba_v3.7-win32\sam-ba_v3.7-rc2-win32\qml\SAMBA\Device\SAMA5D29\SAMA5D29.qml

  2. Open the SAMA5D29.qml and add the config structure below to the file.

    config {

    // QSPI1, I/O Set 2, 66MHz

    qspiflash {

    instance: 1

    ioset: 2

    freq: 66

    }

    }

To configure and enable a boot from a QSPI memory, send the following commands:

  1. Enable boot from QSPI memory in the Boot Configuration Word.

    sam-ba -p serial -d sama5d29 -a bootconfig -c writecfg:bureg0:QSPI1_IOSET2,EXT_MEM_BOOT

    sam-ba -p serial -d sama5d29 -a bootconfig -c writecfg:bscr:bureg0,valid

    Note: To enable boot on another Flash memory than the default SDMMC, the Fuse EXT_MEM_BOOT must be set (NAND, QSPI, SPI). The ROM code will then attempt to boot on all the Flash memories indicated in the Boot Configuration Word.
  2. Erase the QSPI Flash.

    sam-ba -p serial -d sama5d29 -a qspiflash -c erase

  3. Write and verify the bootstrap file in QSPI Flash.

    sam-ba -p serial -d sama5d29 -a qspiflash -c writeboot:boot.bin -c verifyboot:boot.bin

  4. Write and verify the app file in QSPI Flash.

    sam-ba -p serial -d sama5d29 -a qspiflash -c write:harmony.bin:0x40000 -c verify:harmony.bin:0x40000

  5. Reset to boot from QSPI memory.

    sam-ba -p serial -d sama5d29 -a reset