Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

5.3.5.3. Building the Advanced Boot Copier

To build the example advanced boot copier in a new Intel® Quartus® Prime project directory, perform the following steps:

  1. Verify that you have downloaded and unzipped the file described in “Software Files” on page 2 to your <project> directory on your computer.
  2. Open the file <project> /boot_copier_sw/bsp/advanced_boot_copier_bsp/ bootcopier_bsp_settings.tcl in a text editor.
  3. To ensure the proper bsp settings and memory linker locations, edit the following settings in bootcopier_bsp_settings.tcl:
    1. Set ONCHIP to 1 if you are booting from on-chip memory, or 0 otherwise.
    2. Edit EXCEPTION_OFFSET and RESET_OFFSET to match values of the CPU component in Platform Designer.
    3. Update SDRAM_SIZE and FLASH_SIZE to match the memory sizes in Platform Designer.
  4. Open the file project /boot_copier_sw/app/advanced_boot_copier/ advanced_boot_copier.c in a text editor.
  5. Edit the line:
    #define BOOT_METHOD <boot_method>
    to indicate the boot method you intend to use. The following options are available for <boot_method>:
    • BOOT_FROM_CFI_FLASH
    • BOOT_CFI_FROM_ONCHIP_ROM
    • BOOT_EPCS_FROM_ONCHIP_ROM

    This #define directs the Compiler to build the boot copier appropriately for the boot method you are using.

  6. To prevent the application from printing messages to the JTAG UART during boot, edit the line:
    #define USING_JTAG_UART 1
    to read:
    #define USING_JTAG_UART 0

    This #define directs the Compiler to build the boot copier leaving out all JTAG UART code.

  7. Open a Nios® II command shell. (On Windows, click Start > All Programs > Intel FPGA > Nios® II EDS > Nios® II Command Shell)
  8. Change to the directory <project> /boot_copier_sw/app/advanced_boot_copier.
  9. To create and build the BSP and application projects, type the following command:
    ./create-this-app
    
    //Press ENTER

You now have an executable boot copier that is ready to run on the Nios® II processor. Next, you must create an application to boot using the new boot copier.