Programming the FPGA

NOTE: The FPGA output file needs to be in a .rbf format

Send the FPGA .rbf file to the FPGA when booted into linux:

cat fpga_output_file.rbf > /dev/fpga0

The FPGA programmed LED should now be off.

Converting .sof to .rbf

  1. Open project in Quartus
  2. Go to File->Convert Programming Files...
  3. Change the Programming File Type drop to: Raw Binary File (.rbf)
  4. Click on SOF Data in the Input files to convert table
  5. Click Add File...
  6. Select the .sof file for your project
  7. Click Open
  8. Change the File name if you would like
  9. Click Generate
  10. Generated .rbf will be in the main project directory

Re-programming the FPGA in Linux

If the FPGA has been previously programmed, whether it be through Linux or from UBoot, you can re-program it within linux by issuing the "cat" command from above. However if you are using any of the bridges they may need to be re-initialized. The following commands will allow you enable/disable the respective fpga-bridge:

echo 1 > /sys/class/fpga-bridge/fpga2hps/enable
echo 1 > /sys/class/fpga-bridge/hps2fpga/enable 
echo 1 > /sys/class/fpga-bridge/lwhps2fpga/enable 

echo 0 > /sys/class/fpga-bridge/fpga2hps/enable
echo 0 > /sys/class/fpga-bridge/hps2fpga/enable 
echo 0 > /sys/class/fpga-bridge/lwhps2fpga/enable 

Note that devices in the FPGA that have a Linux driver may need to have the driver "un-loaded" prior to re-programming the FPGA and then "re-loaded" after re-programming.

Go to top
Add picture from clipboard (Maximum size: 600 MB)