I’m trying to build a working pynq OS for ZCU102. I built an OS but get the following error when I try to program the FPGA (running as root):
[ 336.509329] fpga_manager fpga0: Error while writing image data to FPGA
[ 336.554434] fpga_manager fpga0: Error while writing image data to FPGA
OSError: [Errno 12] Cannot allocate memory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “./driver/driver.py”, line 77, in
runtime_weight_dir = runtime_weight_dir
File “/home/xilinx/output_tfc-w1a1_ZCU102/driver/driver_base.py”, line 78, in init
super().init(bitfile_name, download=download, device=device)
File “/usr/local/lib/python3.6/dist-packages/pynq/overlay.py”, line 355, in init
self.download()
File “/usr/local/lib/python3.6/dist-packages/pynq/overlay.py”, line 419, in download
super().download(self.parser)
File “/usr/local/lib/python3.6/dist-packages/pynq/bitstream.py”, line 187, in download
self.device.download(self, parser)
File “/usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py”, line 770, in download
fd.write(bitstream.binfile_name)
OSError: [Errno 12] Cannot allocate memory
I can program the bitstream from the vivado hardware manager but not from the OS.
I’ve read many topics and try a lot a things without success.
Thanks for your help!
Can you try adding the following into your device-tree? On boards with more than 2 GB of RAM it’s possible that the contiguous memory region occurs over the 2G boundary and then the PMU can’t access the bitstream.
Hello, i’m having the same problem that can you please tell me how to add the code to device-tree?
I’ve built PYNQ image v2.6.0 by
copying board/ZCU104 to board/ZCU102, modified ZCU102.spec to point xilinx-zcu102-v2020.1-final.bsp
Built PYNQ image with pre built bionic.aarch64.2.6.0.img
succedded to boot
download with overlay in PYNQ failed, OK with Vivado.
should i add “alloc-ranges = <0x0 0x0 0x0 0x7ff00000>;” in the path PYNQ/boards/ZCU102/petalinux-bsp/meta-user/recipes-bsp/device-tree/files/system-user.dtsi ??
or petalinux project created in the PYNQ/sdbuild/build/ZCU102/…/system-user.dtsi ??
I have a similar issue where my bitstream can’t be written on the ZCU102.
I copied the petalinux-bsp/meta-user/recipes-bsp/device-tree/files/system-user.dtsi file from the ZCU104 folder as it already had the setting discussed here, but after remounting the new image I get the same error.
Do I need to do anything else apart from adding the file?
I generated the bitstream on my desktop and it clearly shows that it should fit the device.
Here’s my error code:
File "/home/xilinx/zcu102/driver/driver_base.py", line 80, in __init__
super().__init__(bitfile_name, download=download, device=device)
File "/usr/local/lib/python3.6/dist-packages/pynq/overlay.py", line 355, in __init__
self.download()
File "/usr/local/lib/python3.6/dist-packages/pynq/overlay.py", line 419, in download
super().download(self.parser)
File "/usr/local/lib/python3.6/dist-packages/pynq/bitstream.py", line 187, in download
self.device.download(self, parser)
File "/usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py", line 770, in download
fd.write(bitstream.binfile_name)
OSError: [Errno 12] Cannot allocate memory
You can check if that reserved_memory node got picked up by checking if it exists in the running devicetree
ls /sys/firmware/devicetree/base/reserved-memory/
I’d also recommend to only copy segments you want included from other device trees, rather than the whole thing as that might cause some unexpected issues. Not sure that’s what’s happening in this case.
Thanks.
I’m not sure what I’m supposed to see here.
I can see linux,cma that was discussed in the added code along with #adress-cells, name, ranges, and #size-cells.
Unfortunately, even when only adding the needed file and lines the issue remains.