2
\$\begingroup\$

I have a question about Nexys A7-100T development board that I want to use as a debugging tool for another project. I will provide some background info below:

I have a sensor that is sending square pulses and is being read by a separate MCU, and the pulse count on the MCU display is not correct according to the oscilloscope. I want to configure my FPGA to count and display the pulses, which I can do easily in order to rule out the hardware end of the project.

In order to configure my FPGA I have to use my PC which is at my desk, but the sensor I want to connect the FPGA to is remote from the PC (approx 200 yards).

My question is, how can I configure my FPGA at my office PC, and then take it to the sensor and have the configuration there on the FPGA.

I am thinking I could power the FPGA with a battery and once configured, keep the FPGA powered up and this will work fine. Or I could store the configuration which is used during bootup to program the FPGA but is this easily done with this board?

I would love to hear your advice.

Here is the datasheet for the FPGA development board: Nexys A7-100T Reference Manual

\$\endgroup\$
2
  • 2
    \$\begingroup\$ You can choose a different FPGA that stores its configuration internally, or you can choose to boot your FPGA from a flash memory on the same PCB (or in a SD card plugged into that PCB). \$\endgroup\$
    – user16324
    Commented Jul 6, 2021 at 12:45
  • \$\begingroup\$ Some boards supports from USB flash drive as well. Like Basys-3. \$\endgroup\$
    – Mitu Raj
    Commented Jul 6, 2021 at 18:48

2 Answers 2

4
\$\begingroup\$

Your board has an Artix (Xilinx) device on it that supports a number of config options. Digilent provides a serial SPI flash for this, and so 'Master SPI' should be pre-selected with the Mode M[2:0] pins (should be 3'b001). Make sure that is the case. Note: using JTAG overrides the Mode setting while it's in use, so there isn't a need to switch Mode back and forth to use JTAG.

To use this method you need to program the flash in-system via JTAG. Fortunately this is fairly straightforward.

In the Vivado flow, do the following:

  • In Tools->Generate Memory Configuration File, make the Flash programming file, using your file (.bit), and targeting the correct device (Spansion S25FL128S) and I/O type (SPI x4). Choose 'MCS' format.
  • in Hardware Manager, Open Target to connect JTAG, then add the Configuration Memory (Flash) device to the scan chain if it isn’t already shown.
  • Program the Flash using the Memory Configuration File (.mcs) you created above.

The process takes several minutes to program the flash.

Once the flash is programmed with a valid bitstream, the Artix will then boot itself from the flash from there on. Note that you can still download bitstreams via JTAG as before for debugging.

As you become more familiar with this process, know that there are options for the bitstream like compressing the stream and setting the SPI clock rate. These can reduce programming and loading time.

More here: https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf

Finally, the programming SPI interface pins can be shared with an on-chip SPI interface IP block, allowing you access to the SPI for your own storage. This requires a SPI device driver, and ensuring that your application doesn’t accidentally corrupt the FPGA bitstream. Your user data can be merged in as part of the .mcs file.

\$\endgroup\$
6
\$\begingroup\$

The Nexys board use (like many FPGAs) an on-board serial flash to download its firmware from. The flash is connected to the FPGA with Quad SPI serial link.

At startup the FPGA is the master of the SPI bus, and downloads its bitstream from it.

The manual of the Nexys states that you can use the spare space of the flash to store user configuration settings (77% of the flash is unused). Maybe you can use this spare space to store your configuration, and read it back using SPI.

datasheet 3.2

You can also refer to the 2.2 part of the reference manual for Quad SPI programming with Impact (ISE Tool) or Vivado.

datasheet 2.2

\$\endgroup\$
5
  • \$\begingroup\$ Can this be in the form of a microSD card plugged into the board? \$\endgroup\$
    – David777
    Commented Jul 6, 2021 at 15:41
  • 1
    \$\begingroup\$ @David777 What are you referring to? Use the MicroSD as configuration source or as bitstream source? If you want to use the SD as configuration source, you will need to implement at least the FAT filesystem handling in your FPGA, or go raw on the SD card, but it can also be complicated. \$\endgroup\$ Commented Jul 6, 2021 at 15:47
  • \$\begingroup\$ Which would you recommend? I would like the easiest method as this is new to me. Ideally would just like a method where I can take the FPGA board out remotely, power it up and it will have my design configured \$\endgroup\$
    – David777
    Commented Jul 6, 2021 at 15:49
  • 1
    \$\begingroup\$ @PierreOlivier The Artix-7 FPGA on that board does not directly support booting from an SD Card (some other Xlinx FPGAs like ZYNQ do). The easiest method is going to be to load the code into SPI flash via USB/JTAG in Vivado. Just open the hardware manager in Vivado, connect to your device, select what type of flash you have attached, select your bitstream file, and then press the button to load your bitstream its that easy. \$\endgroup\$
    – user4574
    Commented Jul 6, 2021 at 20:30
  • \$\begingroup\$ @user4574 This sounds exactly like what I need. I will try this tomorrow \$\endgroup\$
    – David777
    Commented Jul 7, 2021 at 20:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.