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: 
Visitor cdarok2
Visitor
6,329 Views
Registered: ‎03-15-2017

ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Hi!

I´m working on a project with evaluation board zcu102, ZynqMp. I´m trying to load a bitstream from Linux, I already boot Linux from initRam image and following the guide: http://www.wiki.xilinx.com/Solution+ZynqMP+PL+Programming.

 

After using bootgen for preparing the bitstream into .bin file I copy it throught tftp to the board and after that copy the file to "/lib/firmware/bitstream.bin". Finally, I do "echo bitstream.bin > /sys/class/fpga_manager/fpga0/firmware" and obtain following error:

 

-----------error log---------------

root@Xilinx-ZCU102-2016_3:~# echo bitstream.bin > /sys/class/fpga_manager/fpga0/firmware
[ 2300.505608] fpga_manager fpga0: writing bitstream.bin to Xilinx ZynqMp FPGA Manager
[ 2300.557560] fpga_manager fpga0: Error while writing image data to FPGA

-------------------------

 

Don´t know what I´m doing wrong, need some help...

 

Thanks!

 

0 Kudos
1 Solution

Accepted Solutions
Visitor cdarok2
Visitor
10,452 Views
Registered: ‎03-15-2017

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Solved!

 

The key was solving the bug that exist on  PMU sources on 2016.3 version. Indications on note AR#68246.

 

Link to AR#68246: https://www.xilinx.com/support/answers/68246.html

 

(Also this topic is discussed on: https://forums.xilinx.com/t5/Embedded-Linux/zynq-ultrascale-fpga-manager/m-p/755617/highlight/false#M19058)

 

Thanks guys!

0 Kudos
10 Replies
Scholar rfs613
Scholar
6,320 Views
Registered: ‎05-28-2013

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Try it with "cat" instead of "echo"... you want to send the contents of the file, not its name.

 

(Disclaimer: I have not tried this on ZynqMP... only with the older Zynq.)

0 Kudos
Visitor cdarok2
Visitor
6,312 Views
Registered: ‎03-15-2017

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution
Hi rfs613,
I tried also "cat" and result is the same ;(
Thanks
0 Kudos
Visitor cdarok2
Visitor
6,283 Views
Registered: ‎03-15-2017

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Hi! this is the error that I obtain when doing cat:

 

----error log ----


root@zcu102-zynqmp:~# cat bitstream.bin > /sys/class/fpga_manager/fpga0/firmware
[  239.374145] fpga_manager fpga0: writing ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ to Xilinx ZynqMp FPGA Manager
[  239.386298] fpga_manager fpga0: Direct firmware load for ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ failed with error -2
[  239.399111] fpga_manager fpga0: Error requesting firmware ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
[  239.410236] fpga_manager fpga0: writing ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ to Xilinx ZynqMp FPGA Manager
[  239.422388] fpga_manager fpga0: Direct firmware load for ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ failed with error -2
[  239.435214] fpga_manager fpga0: Error requesting firmware ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
cat: write error: No such file or directory

--------------------------------

 

Any idea? it seems that the fpga are not connected to PS, but don´t know exactly what I´m doing wrong

 

thanks

0 Kudos
Scholar rfs613
Scholar
6,277 Views
Registered: ‎05-28-2013

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution
Afraid I can't offer much more help, I have not worked with the ZynqMP yet... On the earlier Zynq the process was a bit different ("cat bitfile >/dev/xdevcfg"). But your steps look correct according to the wiki article.

So either your bitstream is problematic (can you try it with a known-good bitstream from Xilinx?), or the instructions in the wiki are incorrect.

You could look at the source code in the kernel for the fpga manager, to see what "error -2" means.
0 Kudos
Visitor cdarok2
Visitor
6,266 Views
Registered: ‎03-15-2017

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Thanks rfs613, With ZynqMp the workflow is different, it uses other driver...

 

I still trying to program the FPGA from Linux, it seems that the fpga is not present when trying to load the bitstream... Then the other variable that takes part on the puzzle is the PMU, I´m not using any PMUfw on my boot, then fpga is not starting. I´ll try to compile the PMU firmware with SDK and load again the bitstream... lets see results!

 

https://forums.xilinx.com/t5/Embedded-Linux/zynq-ultrascale-fpga-manager/m-p/755163#M19015

 

 

0 Kudos
Moderator
Moderator
6,239 Views
Registered: ‎04-17-2011

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Please verify if the following steps were done to set up the kernel

 

 
$ source {PETALINUX_INSTALL_PATH}/petalinux-v2016.3-final/settings.sh
$ petalinux-create -t project -s /proj/petalinux/petalinux-v2016.3_bsps/Xilinx-ZCU102-v2016.3-final.bsp
$ cd Xilinx-ZCU102-2016.3
$ petalinux-config
           linux Components Selection  ---> kernel (xlnx-4.6)  ---> (X) remote .
           linux Components Selection  ---> Remote linux-kernel settings  ---> https://github.com/Xilinx/linux-xlnx.git
           linux Components Selection  ---> Remote linux-kernel settings  ---> master
$ petalinux-config -c kernel
                   Device Drivers  ---> FPGA Configuration Support  --->  <*>   Xilinx Zynqmp FPGA
$ cd build/linux/kernel/download/linux-xlnx
Apply attached Linux patch:0001-fpga-Add-firware-store-function.patch (attached to this post)
$ git am 0001-fpga-Add-firware-store-function.patch
$ cd ../../../../../
$ petalinux-build
 
Also, if possible use SD Card to mount and use the .bin file.
 

 

Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Visitor cdarok2
Visitor
10,453 Views
Registered: ‎03-15-2017

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Solved!

 

The key was solving the bug that exist on  PMU sources on 2016.3 version. Indications on note AR#68246.

 

Link to AR#68246: https://www.xilinx.com/support/answers/68246.html

 

(Also this topic is discussed on: https://forums.xilinx.com/t5/Embedded-Linux/zynq-ultrascale-fpga-manager/m-p/755617/highlight/false#M19058)

 

Thanks guys!

0 Kudos
Adventurer
Adventurer
4,979 Views
Registered: ‎02-04-2016

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Hi @debrajr , I have been consistently getting error while trying to write fpga binary file to fpga manager firmware. Error code is 2 and says invalid argument for echo command. I have been trying with petalinux 2016.3 and 2016.4 built and result is same. Following the http://www.wiki.xilinx.com/FPGA+Manager+ZCU102  . Just curious about the patch you have mentioned here. This is to apply for which version of kernel source? Is this patch written to solve this write error to fpga manager firmware?

 

 

Thanks
Goutham

0 Kudos
Adventurer
Adventurer
4,971 Views
Registered: ‎02-04-2016

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution

Hi @debrajr , When I apply the patch to petalinux 2016.3 in the process you have mentioned, I am getting :

 

Applying: fpga: Add firware store function
error: patch failed: drivers/fpga/fpga-mgr.c:171
error: drivers/fpga/fpga-mgr.c: patch does not apply
Patch failed at 0001 fpga: Add firware store function


Cant figure out what is going on here. Should I change the tag of the xilinx git to be 2016.3 and then try again?

Goutham

0 Kudos
Adventurer
Adventurer
2,612 Views
Registered: ‎02-04-2016

Re: ZynqMP PL Programming Throught Linux - petalinux 2016.3

Jump to solution
To me, the patch mentioned here seems to be already included in source tree ,even for 2016.3 tag of xilinx !
0 Kudos