1
\$\begingroup\$

In some boards, like Papilio, spi flash connected only to fpga. As I can understand the firmware writes to flash through fpga. How does it works? Doesnt fpga need firmware first to work? If so, how it goes through fpga before any firmware was written in flash?

\$\endgroup\$
  • \$\begingroup\$ Take a look here \$\endgroup\$ – Eugene Sh. Jan 18 '16 at 18:47
2
\$\begingroup\$

First of all, the whole point of JTAG is that it allows test software to manipulate the pins of the device in order to test their external connections to other devices on the board. The ability to manipulate the internal state of the device is a secondary function. So, it should be obvious that it will be possible to cause the pins to execute the protocol required to write data to the flash.

However, that tends to be rather slow in practice, because of the large number of JTAG transactions required to perform a single flash write. Therefore, most development systems download a small, fixed design to the FPGA whose only purpose is to write to the flash, and then they transfer the configuration data to it using a more efficient protocol (still over the JTAG interface).

\$\endgroup\$
  • \$\begingroup\$ Yep -- for example, on the Zynq SoC, a small executive is loaded via JTAG that can then perform the configuration of an attached QSPI device. If one was concerned about EOL programming time for FPGA bitstreams, a header breaking out the SPI flash pins would allow you to program at very high speeds. \$\endgroup\$ – Krunal Desai Jan 18 '16 at 20:46
0
\$\begingroup\$

There are several ways the FPGA can get its configuration:

  • The Spartan 6 LX9 FPGA has the ability to actively read its own configuration from the EEPROM via SPI.

    See dataseheet: p.4

    The Master Serial Peripheral Interface (SPI) and the Master Byte-wide Peripheral Interface (BPI) are two common methods used for configuring the FPGA. The Spartan-6 FPGA configures it self from a directly attached industry-standard SPI serial flash PROM. The Spartan-6 FPGA can configure itself via BPI when connected to an industry-standard parallel NOR flash. Note that BPI configuration is not supported in the XC6SLX 4, XC6SLX25, and XC6SLX25T nor is BPI available when using Spartan-6 FPGAs in TQG144 and CPG196 packages.

  • Another possibility is that a µController (or USB interface IC) "feeds" the FPGA with the configuration. The µC may get the configuration data from a EEPROM or via USB from a host PC.

  • The third and probably most common way during development is to program the FPGA via the JTAG interface.

Once the firmware is loaded it tells the FPGA to do what ever you want (also writing to EEPROM via SPI if you please).

\$\endgroup\$
  • \$\begingroup\$ Yes, if Flash has some configuration before startup, but SPI Flash connected only to fpga, there no other external sources to write configuration. So if we have no confiduration in flash and it only connected to fpga how we can write configuration in flash? \$\endgroup\$ – vnuEndru Jan 18 '16 at 18:58
  • \$\begingroup\$ What I was writing in the answer is one of several possibilities. Another possibility is that a µController "feeds" the FPGA with the configuration. The µC may get the configuration data from a EEPROM or via USB from a host PC. Another (probably most common) way during development is to program the FPGA via the JTAG interface. \$\endgroup\$ – Curd Jan 18 '16 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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