banner

Programming the FPGA-384 board Flash Memory and running without a host.

The board contains a Flash memory device which can be used to store the FPGA program. Once stored then the FPGA can be removed from the host and made to boot from the Flash memory directly.

You should have fetched and built the FPGA-384 software so as to have the fpga-384 utility.

To erase the flash you can use the utility interactively by invoking it with the -i parameter or by using it directly:

./fpga-384 -e

If you want to program an FPGA bin configuration file, such as fpga.bin, to it then it will erase the memory and program as follows:

./fpga-384 -w ./fpga.bin

You can use the utility to hex dump the Flash memory contents or show the chip ID too.

Using the board without a host.

Now that the FPGA bin configuration has been stored into the Flash memory the board can be used without a host being used to program it. When the board obtains power, or whenever the FPGA is reset, then it is possible to make the FPGA boot to its configured state by reading from the Flash memory.

The FPGA will always check to see if it can read a Flash memory chip on boot. It does this by being the master on its SPI interface and issuing some SPI commands to see if it can see a Flash memory device. When connected to the host, the SPI select pins are connected to the Raspberry Pi or the Arduino so it will not boot from Flash. So you need to make a connection of the SPI select lines.

The board has been designed so that the SPI select line for the FPGA and the SPI select line for the Flash memory are on the board pins numbered 12 and 13. See the Pinout diagram for more description.

So remove the board from the host and connect pins 12 & 13 together. You can use a removable jumper across the two pins if you soldered up the arduino connector, or if you use the pi connector then you can break off two pins from the spare headers and solder them to the top side of the board and use a removable jumper or, if your sure, you can solder a wire between the two pins.

Note that if you want to reprogram the board or Flash using the host again then the removeable jumper needs to be removed or the pins not connected together any more.

Once the board is away from the host and the two SPI select pins have been shorted together then apply power and it should boot to the configured state. Note that the onboard 16MHz clock generator will still run and drive any configuration reliant upon clock signals, such as here, where it boots directly to the PWM example when power is applied to it.

Booting from Flash

Like this, the board has now become a custom electronic module part, capable of performing its job in your project whenever power is applied to it.