Boot successful but FPGA not configured

I put SD card image provided by cyclone V sockit board dealer (TERASIC). The Linux boots up successfully every time but my fpga is not able to be configured. I put my raw binary file onto the FAT partition of my SD card but my Linux is boot up but my fpga is not configured. I checked almost all FPGA configuration switches but fpga is not configured.

Any suggestions??


Are you attempting to load the rbf using u-boot or inside linux?
If you are using the u-boot, check if the variable is set to the right file name in your u-boot env.

Best regards,

Hi Rafael, thanks a lot for your reply. If I am correct isn’t it the case that you just copy FPGA configuration file (named as soc_system.rbf) onto FAT partition of your SD card and then you put SD card into your board and when Linux will boot then FPGA will be configured automatically because i have set bootsel switch to booting Linux from microSD card?
I have also tried loading my rbf file inside Linux by following the instructions on;table=3;up=0
but even then FPGA is not configured. The FPGA configuration light on the board doesn’t light up and even when I type cat /sys/class/fpga/fpga0/status ; it shows me configuration mode.

Can you please guide me what should I do?

I’ll try my best to help you, but I’m not the best at explaining stuff.

What you said about putting the rbf file in the FAT partition is correct, suposing that the sdcard image is attempting to load that file.

There are basicaly 4 ways to load the bitstream to the fpga, programming it with JTAG (very nice for development), use the EPCS like other fpga boards, use the U-Boot to load or use the linux FPGA Manager.

Now, I understand that you want to use the U-Boot or the FPGA Manager, correct?

Assuming that you want to use the U-Boot, you will need to understand the structure of your sdcard (basicaly know the partition order)
First you will need to interrupt the boot by pressing any key when prompted by U-Boot
After that you should be able to use the console.
Now you should run the following commands: (I’m assuming that the file is in the root of the partition ant that the partition is number 2, please change the partition and add the path to the rbf file to your configuration)

1)set a variable with the rbf file name
setenv fpgafile

2)check if you can locate the file in the partition (if it fails stop and check the file path and partition number)
if test -e mmc 0:2 ${fpgafile}; then echo “OK”; else echo “File not Found”; fi;

3)load the rbf file
load mmc 0:2 ${fpgadata} ${fpgafile}

4)program the fpga
fpga load 0 ${fpgadata} ${filesize}

5)enable fpga bridges
bridge enable

If you want to configure the FPGA using the FPGA manager, you will need to rebuild the kernel and make sure that the option to configure the fpga using devicetree overlays, create a simple devicetre overlay file and load it using the fpga manager structure (I’ll try to write a better description or make a video, but the process is a bit long)

Best regards,
Rafael Villatore

Hi Rafael,
Sorry for late reply actually i got really ill thats why couldn’t reply.
Thanks a lot for your help. I successfully configured FPGA from u-boot however the Linux still doesn’t boot up correctly because the Linux image and binary Archives (GHRD 15.1) that I downloaded use fpga configuration switch in FPP x32 mode and this particular configuration is not available for cyclone V Sockit revision C boards. As you can see here
Hence, I have to work around on this problem. Can you guide me or give me some suggestion what can I do to resolve this issue?

It is compatible with cyclone v, the documentation is kind of messy, but it is possible to set the board to use FPPx32 if you are configuring the fpga using the hps. (I need to find the correct document, but it’s in one of the cyclone v manuals)
In order to create a compatible rbf file I’m using the following configurations for my device in quartus:

It is kind of weird but the board should work with the generated rbf file, I’m able to configure the FPGA using u-boot and linux devicetree-overlay methods.

Hi, hope you are fine and well. thanks your answer is helping me alot. just wanted to ask about the command which can save all the commnads in uboot that I used to program fpga because every time i have to reconfigure fpga, i have to run each command again and again so isnt there a way to save these commands in uboot? I wrote uboot script but it is not able to run …

another question, my uboot.scr file is not able to be detected at booting. How do I make it to be detected at boot process? Right now I just copied my uboot.scr file onto the fat partition of my sd card but it is not working.

Hi, I’m fine. Hope that you are also fine.

You can create scripts directly in the u-boot terminal to load the fpga.

Right now I’m using a variable that holds the rbf file path, so if you change the variable you load another rbf file.

If you add the following variables to you u-boot env and call the “loadfpga” in your “bootcmd”, it should work.

loadfpga=echo Loading fpga with ${fpgafile} bitstream;if test -e mmc 0:2 ${fpgafile}; then load mmc 0:2 ${fpgadata} ${fpgafile};fpga load 0 ${fpgadata} ${filesize};bridge enable; else echo Fpgafile not found;fi

Now, for the u-boot scr file, I’m using another configuration on the sdcard with only 2 partitions, 1 for the spl and bootloader (I’m using u-boot with spl) and another ext4 partition with linux fs, kernel, rbf files, etc. So it might not be what you want, but maybe you can use it as a base for your needs.
I’m loading a “uenv.txt” file from the ext4 partition to change my u-boot env. To do that, I’m using a process that is almost the same as the fpga one:

loadenv=echo Loading ${envfile} File; if test -e mmc 0:2 ${envfile}; then load mmc 0:2 $loadaddr ${envfile}; env import -t ${loadaddr} ${filesize}; echo ${envfile} loaded; else echo file ${envfile} not found!!!; fi; 

So you can use the uenv.txt file to set a specific rbf file to load, by overwriting the “fpgafile” variable.