I have been using this guide to build an SD Card image to boot Linux on CycloneV.
One of the shortcomings of the guide appears to be that it does not include instructions on how to program the FPGA from u-boot in the CycloneV workflow. I have gotten around this using a boot script and modifying u-boot to run the script before booting the kernel.
echo --- Programming FPGA ---
echo -----Loading image------
# load rbf from FAT partition into memory
fatload mmc 0:1 ${fpgadata} socfpga.rbf;
# program FPGA
echo -----Print filesize-----
printenv filesize;
echo -----Program FPGA-------
fpga load 0 ${fpgadata} ${filesize};
# enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges
echo -----Enabling IFs--------
bridge enable;
I receive the following output during uboot operation before the kernel begins uncompressing and booting
Hit any key to stop autoboot: 0
449 bytes read in 3 ms (145.5 KiB/s)
Executing script at 02000000
— Programming FPGA —
-----Loading image------
7007204 bytes read in 366 ms (18.3 MiB/s)
-----Print filesize-----
filesize=6aebe4
-----Program FPGA-------
Command ‘load’ failed: Error -6
-----Enabling IFs--------
switch to partitions #0, OK
mmc0 is current device
After boot, I look at the fpga manager sysfs utility and see
root@cyclone5:~# cat /sys/class/fpga_manager/fpga0/state
write init
I was wondering if anyone has worked with CycloneV u-boot and might be able to tell what this error means and how to get around it.