Build PYNQ-2.4 SD card Image for Zedboard v2018.3

While following the provided tutorial from the official website of pynq, I have met a lot of errors and failed to build pynq image for zedboard. So, I would like to write down this for others as a reference for newbie. To download those mentioned files, checkout the download links below.


I’m using WSL2 (Ubuntu 16.04.7 LTS) as the environment, petalinux-2018.3 and SDx-2018.3 from Xilinx to build the image. The petalinux and SDx are installed in the following path of my WSL:


After you have installed petalinux and SDx, you need to source it:

source /tools/Xilinx/SDK/2018.3/
source /tools/Xilinx/SDx/2018.3/
source /tools/Xilinx/Vivado/2018.3/
source ~/petalinux/2018.3/
petalinux-util --webtalk off

Download PYNQ-2.4 and prebuild image

I’m using an older release of PYNQ to build the image, because I don’t want to download other version of Xilinx software (SDx file is really big and it takes a lot of time to install it). The following commands are to download the pynq-2.4 repository and the prebuild image Pynq-Z1 v2.4 from github and extract it.

cd ~/Documents
tar -xf v2.4.tar.gz
cd ./PYNQ-2.4

Since line 57 in ~/PYNQ-2.4/sdbuild/Makefile will use git command and PYNQ-2.4 is extracted from a tar file, currently it is not a git repository. So, we need to initialize it as a local git repository. Otherwise, the error would occur during the runtimen.

cd ~/Documents/PYNQ-2.4
git init
git add .
git commit -m "init"

Build Image

Before that, I was following the tutorial of official website to build pynq sd card for other board, and I get into a lot of error and trouble, then here comes to this tutorial in the forum of building the image for custom board from prebuilt image. However, I still get into the errors, and I think its because I’m using WSL2.

Install the dependencies for pynq:

cd ~/Documents/PYNQ-2.4/sdbuild/script
sudo ./

Then, create your board specification:

mkdir ~/Documents/boards
mkdir ~/Documents/boards/zedboard
touch ~/Documents/boards/zedboard/zedboard.spec

Copy and paste the following zedboard specification into the file “~/Documents/boards/zedboard/zedboard.spec”. Then, save and close it.

ARCH_zedboard = arm
BSP_zedboard = avnet-digilent-zedboard-v2018.3-final.bsp
STAGE4_PACKAGES_zedboard = boot_leds ethernet pynq jupyter pandas

Download zedboard bsp v2018.3 and put it into the folder “~/Documents/boards/zedboard/”. Which the path of the bsp file would look like this:


Start to build your image:

cd ~/Documents/PYNQ-2.4/sdbuild
make BOARDDIR=~/Documents/boards PREBUILD=~/Documents/pynq_z1_v2.4.img

Wait and you might get this kind of error then I ignore it :stuck_out_tongue: I didn’t research into /dev/mapper stuff.

+ sudo chroot / mkfs -t fat /dev/mapper/loop5p1
mkfs.fat 3.0.28 (2015-05-16)
/dev/mapper/loop5p1: No such file or directory
Makefile:299: recipe for target '/home/yang/Documents/PYNQ-2.4/sdbuild/build/bionic.arm.stage1.img' failed
make: *** [/home/yang/Documents/PYNQ-2.4/sdbuild/build/bionic.arm.stage1.img] Error 1

You might get this error as well :smiley: (This is caused by the pynq makefile script doesn’t make the folder “proc”). Ignore it too :stuck_out_tongue:

QEMU_EXE=/opt/qemu/bin/qemu-arm-static PYNQ_BOARDDIR=/tmp/tmp.iC2pP0Gx9E/zedboard PYNQ_BOARD=zedboard ARCH= PACKAGE_PATH=/tmp/tmp.iC2pP0Gx9E/zedboard/packages /home/yang/Documents/PYNQ-2.4/sdbuild/scripts/ /home/yang/Documents/PYNQ-2.4/sdbuild/build/bionic.zedboard
+ target=/home/yang/Documents/PYNQ-2.4/sdbuild/build/bionic.zedboard
+ shift
+ fss='proc run dev'
+ for fs in '$fss'
+ sudo mount -o bind /proc /home/yang/Documents/PYNQ-2.4/sdbuild/build/bionic.zedboard/proc
mount: mount point /home/yang/Documents/PYNQ-2.4/sdbuild/build/bionic.zedboard/proc does not exist
Makefile:298: recipe for target '/home/yang/Documents/PYNQ-2.4/sdbuild/output/zedboard-2.4.img' failed
make: *** [/home/yang/Documents/PYNQ-2.4/sdbuild/output/zedboard-2.4.img] Error 32
Make failed

Makesure the following files are existed, they are important. If no, please go to forum to ask for help.


Burnt image to SD card

I follow this tutorial to write the SD card:

After burning it, your SD card will become like this:

However, you still need to replace the BOOT.BIN and image.ub files in the F:\ drive with the following files:


Here you go! Your PYNQ SD card for Zedboard is done.

Download links


1 Like