Programming the FPGA¶
ATTENTION: This is only supported in the 3.12 Kernel or older. For newer Kernels the FPGA must be programmed in UBoot.
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¶
- Open project in Quartus
- Go to File->Convert Programming Files...
- Change the Programming File Type drop to: Raw Binary File (.rbf)
- Click on SOF Data in the Input files to convert table
- Click Add File...
- Select the .sof file for your project
- Click Open
- Change the File name if you would like
- Click Generate
- 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:
Enable echo 1 > /sys/class/fpga-bridge/fpga2hps/enable echo 1 > /sys/class/fpga-bridge/hps2fpga/enable echo 1 > /sys/class/fpga-bridge/lwhps2fpga/enable Disable 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