UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer ishahak
Observer
432 Views
Registered: ‎01-31-2018

UltraZed+ loading BIT file on-the-fly from Linux

Hi,

This is a knowledge sharing post, after collecting pieces of information from various sources.

 

cd to your petalinux project folder (e.g. petalinux/projects/uz3eg_iocc_2017_2)

cd hw_platform

ls

 

>you should see your bit file here: system_wrapper.bit

>if you got a newer bit file, replace it here

>one time only: create a BIF file:

cat>fpga.bif 

the_ROM_image:

{

system_wrapper.bit

}

^D

 

>create a bin file:

bootgen -image fpga.bif -w -process_bitstream bin -packagename xczu3eg

 

>copy the new generated bin file into your SD card. I'm doing it like this:

sudo cp system_wrapper.bit.bin /media/ubu2/media/sd/

 

>now go to the UltraZed linux shell and create a shell script for updating the FPGA with the new BIT file:

cat>bit-into-fpga.sh

echo 0 > /sys/class/fpga_manager/fpga0/flags

mkdir -p /lib/firmware

cp /media/sd/system_wrapper.bit.bin /lib/firmware/

echo system_wrapper.bit.bin > /sys/class/fpga_manager/fpga0/firmware

^D

chmod 777 bit-into-fpga.sh

 

>now you can

./bit-into-fpga.sh 

 

>Remember! If you reboot the UZ, you revert back to the old BIT (assuming that the old one is still loaded by the boot loader)

>consider calling ./bit-into-fpga.sh from /etc/init.d script...

 

BTW, if you use an NFS filesystem, no reason for storing the BIT file in the SD card...

Enjoy!

 

 

Tags (3)