Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20687 Discussions

Dual Boot from QSPI Flash Memory

Altera_Forum
Honored Contributor II
2,083 Views

Hello, 

 

I'm using the Cyclone V Gx Starter Kit from terasic and I'm trying to dual boot from the QSPI Flash memory (2 FPGA images and 2 Nios II images). I'm using Quartus 17.1. 

 

First, I have followed the procedure mentioned on this link "https://www.altera.com/documentation/iga1446487888057.html#exd1481216473856" section "Nios II Processor Application Copied from QSPI Flash to RAM Using RAM Using Boot Copier". I'm using the "Altera Generic QUAD SPI controller II" with a clk at 20MHz and I have set a reset vector offset to address 0x003C0000. 

I have generated this .pof : 

  • Sof Data / Start Address 

  • Factory FPGA image / 0x00000000 

  • Hex Data / Start Address 

  • Factory Nios II image / 0x003C0000 

 

 

It works perfectely, I'm able to load the Factory FPGA image and the Factory Nios II image from the flash memory (EPCQ256). I'm just turning on a green LED to validate that I have effectively load the Factory FPGA image and a red LED for the Factory Nios II image. 

 

Secondely, I have added the "Altera Remote Update" with a clk at 20MHz in Plateform Designer and the "Remote" configuration mode (Assignments->Device->Device and Pin Options...->Configuration->Configuration mode-> Remote). In the Factory Nios II image I have added the code to trigger a reconfiguration on the Application FPGA image. 

I have generated this .pof: 

  • Sof Data / Start Address 

  • Factory FPGA image / 0x00000000 

  • Hex Data / Start Address 

  • Factory Nios II image / 0x003c0000 

  • Sof Data / Start Address 

  • Application FPGA image / 0x00400000 

 

 

It works, I'm able to trigger a reconfiguration on the Application FPGA image. (I'm turning on another green LED to validate I have loaded the Application FPGA image) 

 

Now I would like to load the Application Nios II image when I'm loading the Application FPGA image. 

I will generate a .pof like this: 

  • Sof Data / Start Address 

  • Factory FPGA image / 0x00000000 

  • Hex Data / Start Address 

  • Factory Nios II image / 0x003C0000 

  • Sof Data / Start Address 

  • Application FPGA image / 0x00400000 

  • Hex Data / Start Address 

  • Application Nios II image / 0x007C0000 

 

 

I know I need to use a custom boot loader to boot on the Application Nios II image. I have read this link "http://www.alterawiki.com/wiki/EPCS_bootloaders" and many others but I have not found the miracle solution. 

I have few questions: 

  • For the Application FPGA image should I set the reset vector offset to address 0x007C0000 ? 

  • In this link "https://www.altera.com/documentation/lro1432739743862.html#lro1432740750432" section "Nios II Processor Booting Methods" I find that the boot copier supported for an EPCQ is the Memcpy-based. Is the Memcpy-based refer to the boot_loader_cfi_bits ? 

  • When I generate the "mem_init.mk" script it uses the following program "alt-file-convert -I elf32-littlenios2 -O hex --input=terasic_epcq.elf --output=mem_init/generic_quad_spi_controller2.hex --base=0x02000000 --end=0x03ffffff --reset=0x023c0000 --out-data-width=8 --boot="C:/altera/17.1/nios2eds/components/altera_nios2/boot_loader_cfi.srec" to generate the Nios II image with the following boot loader : "boot_loader_cfi_bits". Is it not weird to use the boot loader "Common Flash Interface" for a EPCQ flash memory ? 

  • Is it possible to use another boot loader with the "Altera Generic QUAD SPI controller II" ? (the boot_loader_universal_bits for example) 

 

 

Thanks, 

PierreFLt
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
1,027 Views

Resolved;.

0 Kudos
Reply