Uploading image to FPGA

Applications, development tools, FPGA, C, WEB
Post Reply
ClaireE47
Posts: 20
Joined: Thu Oct 02, 2014 8:26 am

Uploading image to FPGA

Post by ClaireE47 » Thu Oct 02, 2014 8:36 am

Hi,

I've been working away with the RedPitaya and trying to make a few changes at each of the various levels (HTML, C, Verilog) and have been struggling with updating the FPGA using the procedure given by the FPGA Development Environment Wiki page and the forum page: viewtopic.php?f=8&t=49.
I've managed to make the environment and the applications in my cloned repository. After that, I've used Vivado 2013.3 to alter a few simple things in the FPGA, i've compiled it and made the .bit file, and then made it into a .bin file using the Promgen tool.
But now I'm a bit stuck and would really appreciate some advice. I'm not quite sure what .bin file is needed to be given to the RedPitaya (red_pitaya_top.bin or boot.bin) and how to send it - the Wiki page talks about "loading the new image" and I was wondering how to do this.
I've been able to do the "cat red_pitaya_top.bin > /dev/xdevcfg" command but am unsure as to what it actually does - I'm very new to FPGAs.

If anyone could spare some advice, it would be much appreciated.

Thanks!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Uploading image to FPGA

Post by Nils Roos » Thu Oct 02, 2014 1:06 pm

After you have successfully created a new boot.bin, you just need to copy it to the SD-card into the root directory.
Either mount the SD-card in your development system and overwrite the existing boot.bin (create a backup first!), or transmit your new boot.bin to the running RedPitaya and copy it in place like this (I'm assuming you scp'ed your boot.bin to /tmp):

Code: Select all

redpitaya> rw
redpitaya> mv /opt/boot.bin /opt/boot.bin.old
redpitaya> cp /tmp/boot.bin /opt/
redpitaya> chmod 755 /opt/boot.bin
redpitaya> ro
redpitaya> reboot
When you reboot the RedPitaya with the altered SD-card, your new FPGA design will become active.

When you use cat xxx >/dev/xdevcfg, you reconfigure the FPGA once with the new bitstream. Your design will become active immediately, but will be lost after a reboot. For development purposes this is a very convenient option.

ClaireE47
Posts: 20
Joined: Thu Oct 02, 2014 8:26 am

Re: Uploading image to FPGA

Post by ClaireE47 » Fri Oct 03, 2014 5:53 am

It works!
Thank you so much - that's unbelievably helpful and has resolved all of my struggles from the last week.

ClaireE47
Posts: 20
Joined: Thu Oct 02, 2014 8:26 am

Re: Uploading image to FPGA

Post by ClaireE47 » Mon Oct 06, 2014 2:46 am

Hi again,

The temporary upload is working perfectly but when I change the boot.bin file to the one I've built, it won't load. I presume that I have forgotten some aspect of the file so as it is incomplete.
I've followed the:
make FPGA_TOOL=vivado clean -- deletes all temporary files
make FPGA_TOOL=vivado fpga -- builds red_pitaya.bit
make FPGA_TOOL=vivado sw_package -- builds fsbl.elf, device_tree.dts,...
make FPGA_TOOL=vivado image -- runs ./image/Makefile, makes boot.bin, patched device_tree.dtb. Results can be found in ./image/out directory
procedure, creating an out file under image for the boot.bin and devicetree to be stored under. I then copy my boot.bin over the RP's /tmp.
Have I forgotten anything?

Thanks very much

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Uploading image to FPGA

Post by Nils Roos » Mon Oct 06, 2014 3:44 pm

I then copy my boot.bin over the RP's /tmp.
Have I forgotten anything?
Just to avoid misunderstandings, after the copy did you also do the steps outlined in my previous post ?
(namely, making the SD writable, copying the boot.bin to /opt, etc.)

ClaireE47
Posts: 20
Joined: Thu Oct 02, 2014 8:26 am

Re: Uploading image to FPGA

Post by ClaireE47 » Tue Oct 07, 2014 12:13 am

Yes I did. Then after I reboot it, it won't reconnect.

Is the boot.bin file I need the one in /image/out? That's the one I've been using

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Uploading image to FPGA

Post by Nils Roos » Tue Oct 07, 2014 1:25 am

Yes, that is the right file. The way you created it is not exactly the same as during a full build, but the steps look right.

You could try to do an ecosystem build from a fresh checkout (provided you have a commit with your functional changes somewhere) and try the /target/boot.bin file that is emitted in the process. That's the only idea I have right now.

ClaireE47
Posts: 20
Joined: Thu Oct 02, 2014 8:26 am

Re: Uploading image to FPGA

Post by ClaireE47 » Fri Oct 10, 2014 4:48 am

I remade the ecosystem and applications, and used the boot.bin file under build. This worked perfectly.

Thanks again

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Uploading image to FPGA

Post by Nils Roos » Sat Oct 11, 2014 4:30 pm

You're welcome. I don't know if you followed the other discussions, or if you found out yourself already, but as it turns out you can also "make build/boot.bin" explicitly. Thought I'd mention it^^

ClaireE47
Posts: 20
Joined: Thu Oct 02, 2014 8:26 am

Re: Uploading image to FPGA

Post by ClaireE47 » Sun Oct 12, 2014 11:08 am

Ah, I did see that at some point but didn't put it all together! I'll try that next time - it's probably much faster :)

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 19 guests