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: 
Adventurer
Adventurer
3,959 Views
Registered: ‎02-04-2016

Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

Hi,

I want to program my PL from PS in my Ultrazed board that has Zynq Ultrascale+. 


I have enabled FPGA manager in kernel configuration  and made available FPGA manager driver in my kernel ( using petalinux 2016.3). When I initially tried writing .bin file of bitstream to firmware, it said " write error: invalid argument" . Can someone shed some light on this error? 


I have referred to other forums and AR like https://www.xilinx.com/support/answers/68246.html and did those tweeks. Applied the workaround mentioned in pmufw and added it in BOOT.BIN. Still getting this error called "invalid argument"  error when I echo the binary format of bitfile to /sys/class/fpga_manager/fpga0/firmware. 

$mount /dev/mmcblk0p1 /media
$ mkdir /lib/firmware $cp /media/bitstream.bin /lib/firmware/ $echo bitstream.bin > /sys/class/fpga_manager/fpga0/firmware

right after echoing bitstream.bin, I am getting 

[ 1625.057033] fpga_manager fpga0: writing bitstream.bin to Xilinx ZynqMp FPGA Manager
[ 1625.079420] fpga_manager fpga0: Error while writing image data to FPGA
-sh: echo: write error: Invalid argument  

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
6,130 Views
Registered: ‎02-04-2016

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

Hi @pratham, Finally got the FPGA manager driver work with Petalinux 2016.3. I had to update the PMUFW.elf to version 0.2 (2016.4 sdk gives 0.2 version) and include that in BOOT.BIN to get it to work. Also I had to apply the patches to FSBL and U-Boot sources as mentioned in avnet github, to make the booting flawless in Ultrazed.

 

#Created using petalinux 2016.3

#Added SDHCI and PHY nodes to the device tree files manually , before building.

#Got SDHCI and PHY nodes format from Avnet Github.

#Also added patches to psu_init.c in the FSBL source and platform-top.h in U-Boot sources. Got patch files from Avnet Github.

#Also added memory node address  manually in the device tree. It was a bug in the petalinux 2016.3.

#used SDK 2016.4 to create version 0.2 of PMUFW.elf and included that in the BOOT.BIN

0 Kudos
7 Replies
Scholar pratham
Scholar
3,884 Views
Registered: ‎06-05-2013

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution
Please do not post duplicate.

https://forums.xilinx.com/t5/UltraScale-Architecture/FPGA-Manager-driver-with-petalinux-2016-3-error-in-writing-data/m-p/780703#M4771
-Pratham

----------------------------------------------------------------------------------------------
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
Adventurer
Adventurer
3,873 Views
Registered: ‎02-04-2016

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

Hi @pratham , Sorry for the duplicating the post. I had two accounts in here and accidentally used the other one. I would prefer to use this account to continue the discussion. I will delete the other one soon,

 I have followed the http://www.wiki.xilinx.com/FPGA+Manager+ZCU102 . I am able to do the PL programming in standalone mode ( wrapping fsbl, elf file generated by xil_fpga example, and design_1_wrapper.bit.bin ) to BOOT.bin. It was able to program PL with SD card boot.

But with the same .bit.bin file, I am not able to write to firmware from linux as I am still getting invalid argument error. Any other potential reasons coming to mind ?


Thanks
Goutham 

0 Kudos
Adventurer
Adventurer
3,859 Views
Registered: ‎02-04-2016

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

Also, I am afraid if this has to do anything with the petalinux 2016.3 version. I read in another post that firmware built with petalinux 2016.4 has many changes and wont need any patch. Can I build linux image using petalinux 2016.3 with sources of kernel taken remotely from xilinx-2016.4 commit of xilinx git? Can that cause conflicts? I am trying to avoid fresh installation of petalinux 2016.4

0 Kudos
Scholar pratham
Scholar
3,843 Views
Registered: ‎06-05-2013

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

@gouthamp I think it is worth doing a clean build of 2016.4 and give it a try.

-Pratham

----------------------------------------------------------------------------------------------
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
Adventurer
Adventurer
3,818 Views
Registered: ‎02-04-2016

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

Hi @pratham

I have tried the same with petalinux 2016.4 and result is same. Also came across a well written blog https://www.invincealabs.com/blog/2017/03/ubuntu-ultrazed/ that uses petalinux 2017.1 , and still result is same. Only variable that I see here is FPGA board. I am using Avnet Ultrazed and not Xilinx boards. But I assume FPGA driver has nothing to do with the board. I have also came across a patch suggested by @debrajr in https://forums.xilinx.com/t5/Embedded-Linux/ZynqMP-PL-Programming-Throught-Linux-petalinux-2016-3/td-p/754914 . Planning to apply the patch and try again. 

Please let me know if any other thoughts are coming to you.


Thanks

Goutham

0 Kudos
Highlighted
Adventurer
Adventurer
6,131 Views
Registered: ‎02-04-2016

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

Hi @pratham, Finally got the FPGA manager driver work with Petalinux 2016.3. I had to update the PMUFW.elf to version 0.2 (2016.4 sdk gives 0.2 version) and include that in BOOT.BIN to get it to work. Also I had to apply the patches to FSBL and U-Boot sources as mentioned in avnet github, to make the booting flawless in Ultrazed.

 

#Created using petalinux 2016.3

#Added SDHCI and PHY nodes to the device tree files manually , before building.

#Got SDHCI and PHY nodes format from Avnet Github.

#Also added patches to psu_init.c in the FSBL source and platform-top.h in U-Boot sources. Got patch files from Avnet Github.

#Also added memory node address  manually in the device tree. It was a bug in the petalinux 2016.3.

#used SDK 2016.4 to create version 0.2 of PMUFW.elf and included that in the BOOT.BIN

0 Kudos
Observer hisrg
Observer
1,115 Views
Registered: ‎06-16-2018

Re: Error : writing data to FPGA manager firmware in Ultrascale+

Jump to solution

could you tell me how to update PMUFW.elf ? thanks

0 Kudos