Visible to Intel only — GUID: gqb1494970064532
Ixiasoft
Visible to Intel only — GUID: gqb1494970064532
Ixiasoft
5.3.5.7. Booting CFI or EPCS/EPCQ Flash From On-Chip Memory
In this section, use the Intel® Quartus® Prime software to program the boot copier in the boot_rom memory of the FPGA, and then use the Nios® II flash programmer to program the test application boot record in either CFI or EPCS/EPCQ flash memory.
To program the boot copier in the FPGA’s boot_rom memory, perform the following steps:
- In a Nios® II command shell, change to the subdirectory
- To generate the memory initialization file for the boot_rom memory that contains the boot copier, type the following command:
elf2hex advanced_boot_copier.elf <boot_rom_start_address> <boot_rom_end_address> --width=32 --little-endian-mem --create- lanes=0 ../../../eth_std_main_system_boot_rom.hex //Press ENTER
- On the Intel® Quartus® Prime Processing menu, click Start Compilation to compile the project.
- When compilation is complete, on the Tools menu, click Programmer.
- Make sure the <project> \niosii_ethernet_standard_<board> .sof filename appears in the File column.
- Make sure the Program/Configure option is turned on.
- Click Start to configure your FPGA with the .sof file.
The boot_rom memory on the FPGA now contains an executable image of the example boot copier.
To program the test application in flash memory, perform the following steps:
- In a Nios® II command shell, change to the subdirectory: <project> /boot_copier_sw/app/hello_world of your Intel® Quartus® Prime project directory.
- Set the offset in flash memory at which to locate the hello_world boot image, by typing one of the following commands:
- If you are booting from CFI flash memory, type the following command:
bin2flash --input=hello_world.elf.flash.bin \ --output=hello_world.flash \ --location=0x00240000 //Press ENTER
- If you are booting from EPCS/EPCQ device, type the following command:
bin2flash --input=hello_world.elf.flash.bin \ --output=hello_world.flash \ --location=0x00060000 //Press ENTER
Set the offset to 0x00240000 or 0x00440000 when booting from CFI flash memory, and to 0x00060000 or 0x00080000 when booting from an EPCS/EPCQ device, because in boot from the respective flash memory, these are the two locations where the boot copier expects boot images 1 and 2, respectively. In both cases, the two addresses work equally well.
You can also change these default locations by editing the #define statements for BOOT_IMAGE_1_OFFSET and BOOT_IMAGE_2_OFFSET in the <project> /boot_copier_sw/app/advanced_boot_copier/advanced_boot_copier.c file, and then rebuilding the boot copier.
Note: If you edited the flash image offsets in advanced_boot_copier.c, specify the --location value as one of the image offsets you defined in advanced_boot_copier.c, not the offsets mentioned here. - If you are booting from CFI flash memory, type the following command:
- Program the hello_world boot image in flash memory by typing the one of the following commands:
- If you are booting from CFI flash memory, type the following command:
nios2-flash-programmer --base=<flash_base> \ hello_world.flash //Press ENTER
- If you are booting from EPCS/EPCQ device, type the following command:
nios2-flash-programmer --base=<flash_base> \ --epcs hello_world.flash //Press ENTER
where <flash_base> is the base address of the CFI or EPCS/EPCQ flash component in your Platform Designer system.
- If you are booting from CFI flash memory, type the following command: