AN 709: HPS SoC Boot Guide - Cyclone V SoC Development Kit

ID 683265
Date 1/27/2016
Public

1.5.4. Booting from QSPI Flash

This example demonstrates how to boot from the QSPI Flash. Both the Preloader and the Bare-metal application are stored in QSPI Flash.

The steps required to run this scenario are:

  1. Build the sample bare-metal application or simply use the provided file hello-mkimage.bin directly.
  2. Generate a Preloader based on the GHRD provided with SoC EDS. Make sure to select the following options:
    • Check the option spl.boot.BOOT_FROM_QSPI
    • Uncheck the other boot options (spl.boot.BOOT_FROM_RAM, spl.boot.BOOT_FROM_SDMMC, spl.boot.BOOT_FROM_NAND)
      Note: spl.boot.QSPI_NEXT_BOOT_IMAGE = 0x60000. This is the location where the bare-metal application image needs to be stored.
    • Check the option spl.boot.SDRAM_SCRUBBING and spl.boot.SDRAM_SCRUB_REMAIN_REGION. This zeroes out the SDRAM, preventing any ECC errors to occur during bare-metal program execution.
    • Uncheck the option spl.boot.WATCHDOG_ENABLE. This is because we are not kicking the watchdog in our bare-metal application.
  3. Compile the Preloader. This creates the file preloader-mkpimage.bin.
  4. Set the board to boot from SD card by configuring the BOOTSEL jumpers like this:
    • BOOTSEL0 (J28): left
    • BOOTSEL1 (J29): left
    • BOOTSEL2 (J30): left
  5. Connect the USB Blaster USB cable from board to the host PC. This is needed by the HPS Flash Programmer used in the next step.
  6. Write the Preloader and the application images to the QSPI Flash by starting an Embedded Command Shell and then running the following commands:
    • quartus_hps -c 1 -o PV preloader-mkpimage.bin
    • quartus_hps -c 1 -o PV -a 0x60000 hello-mkimage.bin
  7. Power-cycle the board or reset the HPS by pressing the COLD reset button (S7).
    The board boots, Preloader messages are displayed, then “Hello World” is displayed by the bare-metal application.
    Figure 11. Booting from QSPI Flash