Nios® V Embedded Processor Design Handbook

ID 726952
Date 1/27/2025
Public
Document Table of Contents

4.6.2.4. QSPI Flash Programming

Generate Parallel Flash Loader

  1. Create a new MAX® 10 FPGA project.
  2. Instantiate a Parallel Flash Loader in the system.
  3. Configure the IP as follows:
    1. What operating mode will be used? Flash Programming
    2. What is the target flash? Quad SPI Flash
    3. How many flash devices will be used? 1
    4. What’s the Quad SPI flash device manufacturer? Micron
    5. What’s the Quad SPI flash device density? QSPI 512 Mbit
  4. Connect the IP interface as follows:
    1. flash_io0 - QSPI data 0
    2. flash_io1 - QSPI data 1
    3. flash_io2 - QSPI data 2
    4. flash_io3 - QSPI data 3
    5. flash_ncs - QSPI chip select
    6. flash_sck - QSPI clock
    7. pfl_flash_access_granted - VCC (1’b1)
    8. pfl_nreset - VCC (1’b1)
    Figure 78. Interface Connection
  5. Apply timing constraints.
    Figure 79. Example Timing Constraints
    derive_pll_clocks
    
    # JTAG Signal Constraints constrain the TCK port, assuming a 24MHz JTAG clock and 5ns delays
    create_clock -name {altera_reserved_tck} -period 41.667 [get_ports { altera_reserved_tck }]
    set_input_delay -clock altera_reserved_tck -clock_fall -max 5 [get_ports altera_reserved_tdi]
    set_input_delay -clock altera_reserved_tck -clock_fall -max 5 [get_ports altera_reserved_tms]
    set_output_delay -clock altera_reserved_tck 5 [get_ports altera_reserved_tdo]
    
    #
    #some clock uncertainty is required
    #
    derive_clock_uncertainty
    
    set_false_path -from [get_ports {flash_io1}] 
    set_false_path -to [get_ports {flash_*}]
    
  6. Compile the PFL design.
  7. Generate the PFL design SOF file.

Software POF File Programming into General Purpose QSPI

Note: You need to program the parallel flash loader into the MAX® 10 device before programming the QSPI flash.
  1. Program the PFL design SOF file using Quartus Programmer.
  2. Click on Auto-Detect after the PFL is successfully programmed.
  3. Click Yes to overwrite the existing JTAG chain.
  4. A new QSPI flash device will be shown on the screen, connected to Max 10 device. It is the targeted general purpose QSPI flash.
    Figure 80. General Purpose QSPI Flash in JTAG Chain
  5. Click on QSPI_512Mb and select Change File.
  6. Choose the software .pof file, and program it.
    Figure 81. Programming Software POF file
  7. Wait for the software .pof file programming to complete.
  8. Proceed with the FPGA configuration (JTAG, Active Serial, Passive Serial or AvST) to configure the processor hardware.