Cannot config. CycloneV SoC FPGA fabric, uboot cmd "fpga load..." failed

when trying to configure FPGA fabric with the uboot command : fpga load …
it returns
FPGA: Could not configure
error -2

looking at uboot-socfpga source code socfpga_gen5.c, the error corresponds to the Impossibility of switching from reset mode to config mode

Is it a hardware issue ? is the FPGA KO ?


A quick google did not yield a description of error -2, so I can understand your frustration.

It would be helpful if you would post the commands you are using in u-boot shell, assuming you are using u-boot shell.

Here is an example of how I load the FPGA in my default settings:

load nvme 0:1 $fpga_decoaddr $fpga_filename;
fpga load 0 $fpga_decoaddr $filesize; bridge enable;

fpga_filename=[name of fpga rbf file]

hi brian
this is my commands ( i read rbf from qspi):
bridge disable; sf probe; sf read ${loadaddr} 0x03600000 0xa00000; fpga load 0 ${loadaddr} 0xa00000; bridge enable

notice that it works on another cloned card.

I don’t know why the FPGA stays in a reset state. How can i debug that ?

fpga load 0 ${loadaddr} 0xa00000

You need exactly the filesize of the FPGA image. Is the image really exactly 0xa00000 bytes?

no, it is the size of the partition.
can it be the cause of the reset problem ?

I think so. But since I know very little about what you are doing, it’s hard to say.

There are some rules about generating the FPGA image and programming from within u-boot.

It must be an 8 or 16 bit parallel rbf file. You generate it with “File → Convert Programming Files” menu selection.

You should try loading the FPGA image from sdcard first.

When you load from sdcard, the $filesize variable will contain the size of the file and you can pass that to fpga load command. That will also tell you the size so you can then select it when loading from serial flash.

Also, you need to make sure you are writing the image to serial flash correctly. The best way to do that is copy the file into memory from sdcard, then write it to the serial flash, then read it to another memory location and make sure the two memory locations match each other.

Seriously though, loading from sdcard to prove you can load the FPGA is the best way to start.

i already test loading rbf using dhcp instead of qspi. And the filesize has the correct value.
dhcp ${loadaddr} my_firmware.rbf
fpga load 0 ${loadaddr} ${filesize};
Command ‘load’ failed: Error -2

Then the problem must be the rbf file or the version of u-boot you are using.

If you have a development board, I suggest you learn how the example code provided by intel works. If this is your own board, then you have to make sure you have selected exactly the right part in Quartus, configured the HPS system correctly, built the FPGA with the correct pinout and generated the rbf correctly.

Starting with an eval board would help you learn the flow while having to control less variables.

thanks brian
i’m working on my lab board, And the same rbf file worked one mounth ago on the same board.
I think it’s a hardware issue because previously the JTAG tool displayed HPS and Fabric part, and now i only see the HPS

That does sound like a hardware problem.