Using Pynq with ZCU216

Hi PYNQ team,

I am trying to use PYNQ with the ZCU216 and have had a very hard time. I want to start by linking the core resource for this topic which is a repo here: GitHub - sarafs1926/ZCU216-PYNQ: Board repo for the ZCU216 RFSOC

I can discuss in extreme detail my experience with this repo and tyring to use it as it is within a docker container, trying to use a prebuilt image linked in an issue on the repo, and (most recently) trying to update the repo to use newever ZCU216 BSP and pynq rootfs files. I believe it my initial post should describe the big picture problem.

There doesn’t seem to be any easy way to create a PYNQ SD card image for the ZCU216

Rather than describing specific issues with libraries I would challenge anyone reading this to use what is in the linked github repo or any other open source code to create an sd card image for the zcu216.

I would greatly appreciate support in trying to get an image that works with the RFSoC notebooks here: GitHub - strath-sdr/RFSoC-Book: Companion Jupyter Notebooks for the RFSoC-Book.

Here are further links to forums I have found with people struggling in creating a pynq image for the zcu216 in one way or another. Everyone resorts to using the prebuilt image provided here and many of these posts involve that.

Crashing when running RFSoC book notebooks on the prebuilt image

Somehow someone ran the RFSoC notebooks but didn’t state how they got the PYNQ image

Strange behhavior of lights on board using prebuilt image

A reoccuring dependency problem I have consistently encounterd. No good solution

More on that dependency problem

Thank you for any help

Please look at my fork here:
schelleg/ZCU216, v2.7

I was able to build with prebuilts (the preferred way to do it - saves you hours of rebuilding things already in binary format) and also from scratch ( see build_ZCU216.noprebuilt.sh ) - I don’t have a ZCU216 to validate the image.

I updated the build scripts there … I can’t guarantee it will work in docker - that would be a great contribution! For context, I had to patch the PYNQ submodule due to v2.7 being a bit old now and some dependencies do move (e.g. the accepted PR#1454 )

Let everyone know if that resolves the issue - perhaps some host machine issues still unresolved, but the script worked at least on my setup.

1 Like

Just to confirm, what versions of ubuntu and vivado/vitis/petalinux did you use? If your following sarah’s approach it must be 20.04 with all the tools on the 2020.2 version?

Also could you somehow give the community access to the image you built?

Thank you for your time and effort.

I used Ubuntu 18.04 and 2020.2 tools.

I need to go through some internal processes to broadly share an sdcard binary (like we do with other PYNQ sdcard images that we build/provide) … let me see what’s possible there.

Have you talked to the GitHub owner to see if they have prebuilt sdcard images?

1 Like

I am running this in an ubuntu 18.04 docker file and failing on the wic create command deep into the build. I believe I am close but would love your expertise on what may be wrong here:

Checking sstate mirror object availability: 100% |#############################################################################################################################| Time: 0:00:00 

Sstate summary: Wanted 33 Found 33 Missed 0 Current 71 (100% match, 100% complete) 

NOTE: Executing Tasks 

NOTE: Setscene tasks completed 

NOTE: Tasks Summary: Attempted 523 tasks of which 502 didn't need to be rerun and all succeeded. 

INFO: Extracting rootfs, This may take time! 

INFO: Creating wic image... 

INFO: wic create /tmp/work/PYNQ/sdbuild/boot/image.wks --rootfs-dir /tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/build/wic/rootfs --bootimg-dir /tmp/work/PYNQ/sdbuild/build/focal.ZCU216 --kernel-dir /tmp/work/PYNQ/sdbuild/build/focal.ZCU216 --outdir /tmp/tmp.SxHlZ5azZA -n /tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/build/tmp/work/aarch64-xilinx-linux/wic-tools/1.0-r0/recipe-sysroot-native 

INFO: Creating image(s)... 

  

WARNING: bootloader config not specified, using defaults 

  

Traceback (most recent call last): 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 36, in get_block_size 

    binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0)) 

OSError: [Errno 22] Invalid argument 

  

During handling of the above exception, another exception occurred: 

  

Traceback (most recent call last): 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 95, in __init__ 

    self.block_size = get_block_size(self._f_image) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 38, in get_block_size 

    raise IOError("Unable to determine block size") 

OSError: Unable to determine block size 

  

During handling of the above exception, another exception occurred: 

  

Traceback (most recent call last): 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/wic", line 525, in <module> 

    sys.exit(main(sys.argv[1:])) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/wic", line 520, in main 

    return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/help.py", line 83, in invoke_subcommand 

    subcmd[0](args, usage) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/wic", line 220, in wic_create_subcommand 

    native_sysroot, options) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/engine.py", line 189, in wic_create 

    plugin.do_create() 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/plugins/imager/direct.py", line 87, in do_create 

    self.assemble() 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/plugins/imager/direct.py", line 187, in assemble 

    self._image.assemble() 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/plugins/imager/direct.py", line 594, in assemble 

    sparse_copy(source, self.path, seek=part.start * self.sector_size) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 550, in sparse_copy 

    fmap = api(src_fname) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 532, in filemap 

    return FilemapFiemap(image, log) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 350, in __init__ 

    _FilemapBase.__init__(self, image, log) 

  File "/tmp/work/PYNQ/sdbuild/build/ZCU216/petalinux_project/components/yocto/layers/core/scripts/lib/wic/filemap.py", line 98, in __init__ 

    % (self._image_path, err)) 

wic.filemap.Error: cannot get block size for '/tmp/tmp.SxHlZ5azZA/tmp.wic.k_vvapn_/rootfs_PYNQ.1.vfat': Unable to determine block size 

ERROR: Failed to create wic image 

Makefile:343: recipe for target '/tmp/work/PYNQ/sdbuild/output/ZCU216-2.7.0.img' failed 

make: *** [/tmp/work/PYNQ/sdbuild/output/ZCU216-2.7.0.img] Error 255 

labuser01-ubuntu@c1fdd5951e02:/tmp/work$  

The only “improvised” assumption I made in this build is that i do not need gcc-arm-linux-gnueabihf so I commented out the check for this from a make file (I refuse to believe anyone who built any pynq image has had both of these on thier system at the same time: incase your interested). I do not think that is causing this though.

What is wrong here and how can I fix it?

does this help: