Generic Nios II Booting Methods User Guide

ID 683820
Date 5/24/2016
Public

1.4.1. Memcpy-Based Boot Copier

Memcpy-based boot copier supports MAX® 10 UFM, EPCQ and CFI flash memory. The boot copier is stored within the flash memory as the flash controller supported Execute-in-Place (XiP). Subsequent boot image is located just right after the boot copier. You need to ensure the Nios II reset vector offset points to the start of the boot copier.

The following figure shows the flash memory map for EPCQ and CFI flash when using a boot copier. This memory map assumes a FPGA image is stored at the start.

Figure 1. Memory Map for EPCQ and CFI Flash with Memcpy-based Bootcopier
Note: At the start of the memory map is the FPGA image, followed by the customer data which consists of boot copier and application code. The size of the FPGA image is unknown and the exact size can only be known after the Quartus Prime project compilation. The Nios II reset vector offset must be set in Qsys and must point to the start of the boot copier which is located after the FPGA image. You will have to determine an upper bound for the size of the FPGA image. For instance, if the size of the FPGA image is estimated to be less than 0x01E00000, you can set the Nios II Reset Vector offset to 0x01E00000 in Qsys, which is also the start of the boot copier.

The following diagram shows the memory map of a system using UFM flash and the memcpy-based controller. Since the FPGA image (*.sof) is stored in MAX10 CFM section, the boot copier is located at the base address of UFM, followed by the application code. Hence, the Nios II reset vector offset can be set to address 0x00000000 in Qsys.

Figure 2. Memory Map of a System Using UFM with memcpy-based Boot Copier
The memcpy-based boot copier is automatically incorporated as part of the:
  • HEX file during memory initialization file generation ("mem_init_generate" target) in the Quartus Prime Programming Flow method
  • SREC image (*.flash) file during elf2flash utility execution in the Nios II Flash Programming Flow method