Changes between Initial Version and Version 1 of howto/SPI_Flash_Config


Ignore:
Timestamp:
Aug 25, 2012, 9:50:44 PM (12 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/SPI_Flash_Config

    v1 v1  
     1= WARP v3: SPI Flash =
     2
     3== Programming the SPI Flash ==
     4The SPI flash is programmed via iMPACT. Programming the SPI flash requires two steps- generating the PROM file and writing the PROM file to the flash.
     5
     6The PROM programming file (.mcs file) can be generated via the iMPACT GUI or with the promgen command.
     7
     8'''To generate the PROM programming file via the iMPACT GUI:'''
     9 1. Open iMPACT and start the '''Create PROM File''' flow
     10 1. In the PROM File Formatter window:
     11  1. Set '''Storage Target''' to '''SPI Flash -> Configure Single FPGA'''
     12  1. Click the first green arrow
     13  1. Set '''Storage Device''' to '''128M'''
     14  1. Click '''Add Storage Device''', then click the second green arrow
     15  1. Change the '''Output File Name''' and '''Output File Location''' to your preferred path
     16  1. Set '''File Format''' to '''MCS''' and '''Add Non-Configuration Data Files''' to '''No'''
     17  1. Click '''OK'''
     18 1. Click '''OK''' in the Add Device dialog box
     19 1. Select your desired FPGA configuration .bit file
     20 1. Click '''No''' when prompted to add another device file, then click '''OK''' to continue
     21 1. Right-click in the iMPACT window and choose '''Generate File'''
     22
     23'''To generate the PROM programming file via promgen:'''
     24 1. Launch a Xilinx command prompt
     25 1. Navigate to the folder with your .bit file
     26 1. Run:
     27{{{
     28promgen -spi -p mcs -c FF -s 131072 -u 0 <your .bit file name> -o <new .mcs file name>
     29}}}
     30
     31'''To write the .mcs file to the SPI flash:'''
     32 1. Connect a programming cable to the FPGA JTAG connector (J14)
     33 1. Run iMPACT (if not already open) and start the '''Boundary Scan''' flow
     34 1. Right-click and choose '''Initialize Chain'''
     35 1. Click '''OK''' in the Device Programming Properties window
     36 1. Right-click on the FPGA icon and select '''Add BPI/SPI Flash'''
     37 1. Select your .mcs file
     38 1. The Select Attached SPI/BPI window will show. Choose '''SPI PROM''' model '''M25P128''', data width 1.
     39 1. Right-click on the Flash icon (''not'' the FPGA icon) and choose '''Program'''
     40 1. Confirm '''Design-Specific Erase Before Programming''' is checked
     41 1. Optionally un-check '''Verify'''; verification increases the programming time, and we've never seen a verification error
     42 1. Click '''OK'''
     43
     44iMPACT will now begin writing your .mcs file to the SPI flash. This process is slow, typically requiring 3+ minutes. Watch the iMPACT GUI and console for status and error messages.
     45
     46When the programming process completes the FPGA will initiate a configuration cycle from the flash. You will see the green '''STAT''' LED glow at half intensity as the FPGA reads the configuration file. The LED will illuminate fully when configuration completes.
     47
     48=== Configuration Clock Frequency ===
     49The FPGA uses Master SPI mode when loading a bitstream from the SPI flash. In this mode the FPGA generates the configuration clock signal and drives it to the CCLK pin. The CCLK pin is routed to the SPI serial clock input. A faster CCLK will result in a faster configuration process.
     50
     51The CCLK frequency is specified in the .bit file and is preserved when generating the .mcs file (as described above). You can change the CCLK frequency via the {{{-g ConfigRate}}} bitgen option. We have successfully tested CCLK frequencies up to 33MHz. Higher frequencies will sometimes work. However the FPGA-generated CCLK frequency is specified as ±55%, so higher nominal frequencies may violate the SPI flash max frequency of 54MHz.
     52
     53To set the CCLK frequency to 33MHz:
     54 * ISE: open the Generate Programming File properties and change Configuration Options -> ConfigRate to 33.
     55 * XPS: edit Project -> bitgen.ut, add a line:
     56{{{
     57-g ConfigRate:33
     58}}}
     59
     60You will need to re-generate the .mcs file and re-program the SPI flash if you change the CCLK frequency.