Jump to content
  • 0

How to program bit file into the Nexys A7 QSPI flash


sjalloq

Question

Hi there,

I have a Nexys A7 that I've started to bring up. I can successfully build a project and download that to the FPGA but trying to program the SPI flash results in a board that doesn't configure.  The Nexys A7 reference guide doesn't state which configuration memory alias to use so I picked what I thought was the matching name from the Xilinx manual.  The board jumpers are configured for the SPI flash.

I'm setting the following params in my XDC file:

set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]

I'm writing out the MCS using the command:

write_cfgmem -force -format mcs -size 16 -interface SPIx4 -loadbit "up 0x0 ./bitfile/flasher.bit" -file ./bitfile/flasher.mcs

and my Tcl script to program the MCS file into the flash looks like:

# Program the Flash
open_hw
connect_hw_server -url 172.24.66.5:3121
current_hw_target [get_hw_targets */xilinx_tcf/Digilent/*]
set_property PARAM.FREQUENCY 15000000 [get_hw_targets */xilinx_tcf/Digilent/*]
open_hw_target

set hw_device [ lindex [get_hw_devices] 0 ]

current_hw_device $hw_device
refresh_hw_device -quiet $hw_device
create_hw_cfgmem -hw_device $hw_device -mem_dev  [lindex [get_cfgmem_parts {s25fl128sxxxxxx0-spi-x1_x2_x4}] 0]
refresh_hw_device -quiet $hw_device

set hw_cfgmem [ get_property PROGRAM.HW_CFGMEM $hw_device ]

set_property PROGRAM.ADDRESS_RANGE          {use_file}  $hw_cfgmem
set_property PROGRAM.UNUSED_PIN_TERMINATION {pull-none} $hw_cfgmem
set_property PROGRAM.BLANK_CHECK            0           $hw_cfgmem
set_property PROGRAM.ERASE                  1           $hw_cfgmem
set_property PROGRAM.CFG_PROGRAM            1           $hw_cfgmem
set_property PROGRAM.VERIFY                 1           $hw_cfgmem
set_property PROGRAM.CHECKSUM               0           $hw_cfgmem

set mcsfile bitfile/flasher.mcs

if { [file exists $mcsfile] } {
    set_property PROGRAM.FILES [list $mcsfile] $hw_cfgmem
    create_hw_bitstream -hw_device $hw_device [get_property PROGRAM.HW_CFGMEM_BITFILE $hw_device];
    program_hw_devices $hw_device;
    program_hw_cfgmem -hw_cfgmem $hw_cfgmem
}

close_hw_target [current_hw_target [get_hw_targets */xilinx_tcf/Digilent/*]]
disconnect_hw_server 172.24.66.5:3121
close_hw

 

Any thoughts on what I'm doing wrong?  Thanks.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @sjalloq,

If you are using Vivado, is there are a particular reason you are wanting to use an mcs file rather than creating a .bin and loading it onto the flash through the Hardware Vivado Manager? We have a tutorial that describes how to do this for the Nexys 4 DDR (now rebranded to Nexys A7) here. I found an old Xilinx thread that discusses creating the mcs file through Vivado, but it seems that in the end you still need ISE iMPACT to then be able to load that file onto the flash memory.

Let me know if you have any questions about this.

Thanks,
JColvin

Link to comment
Share on other sites

Hi and thanks for the response.

Why am I using an MCS file?  Because I thought that was the recommended way having read the Xilinx documentation and is what I've been doing for all my projects.   ?  I'm using the standard Vivado Tcl shell and downloading via the Hardware Manager.

In this case, having reviewed things with a clean head this morning, my issue seems to be that the Nexys A7 doesn't support 50MHz flash programming as it states in the ref guide.  I've tried setting BITSTREAM.CONFIG.SPI_FALL_EDGE but that didn't help.  I have to reduce the configuration clock rate to 40MHz for it to configure correctly.

Cheers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...