PYNQ V2.7 SD image build fail for board PYNQ-Z2

I use default path, it will install to the /tools/Xilinx.
Just want to comfirm, should I check the Vitis option during the installation guide or chose Vivado??

Vitis otherwise Vitis will not be install.

I need more details on each step
path you place and installed access right.
Follow the setup step and place the path location accordingly
Meantime CPU# and ram are enough?


  1. Install Vitis (contains Vivado) in /tools/Xilinx (2020.2 without other updates)
  2. Install y2k22_patch
  3. chmod privilege to 777


  1. chmod 777 for petalinux
    location: /home/willy/petalinx

cd ~/PYNQ/sdbuild
Got the same error:

WARNING: [Vivado 12-8222] Failed run(s) : ‘pynqz2_ps7_0_synth_1’, ‘pynqz2_rst_ps7_0_fclk0_0_synth_1’, ‘pynqz2_rst_ps7_0_fclk1_0_synth_1’, ‘pynqz2_rst_ps7_0_fclk2_0_synth_1’
wait_on_run: Time (s): cpu = 00:00:00.02 ; elapsed = 00:00:46 . Memory (MB): peak = 2624.980 ; gain = 0.000 ; free physical = 1476 ; free virtual = 1905
INFO: [Vivado 12-4895] Creating Hardware Platform: /home/willy/PYNQ/sdbuild/build/Pynq-Z2/petalinux_bsp/hardware_project/pynqz2.xsa …
INFO: [Project 1-655] Project does not have Board Part set. Board related data may be missing or incomplete in the generated Hardware Platform.
WARNING: [Project 1-646] Board name, vendor and part not set in Hardware Platform.
WARNING: [Project 1-645] Board images not set in Hardware Platform.
INFO: [Hsi 55-2053] elapsed time for repository (/tools/Xilinx/Vivado/2020.2/data/embeddedsw) loading 0 seconds
WARNING: [BD 41-2589] Platform should have atleast one axi memory mapped master interface. Enable a master AXI interface as platform AXI_PORT.
INFO: [Project 1-1042] Successfully generated hpfm file
write_project_tcl: Time (s): cpu = 00:00:16 ; elapsed = 00:00:11 . Memory (MB): peak = 2624.980 ; gain = 0.000 ; free physical = 2000 ; free virtual = 3521
ERROR: [Common 17-70] Application Exception: Need an implemented design open to write bitstream. Aborting write_hw_platform…
INFO: [Common 17-206] Exiting Vivado at Wed Jun 1 15:22:22 2022…
makefile:13: recipe for target ‘bitstream’ failed
make[1]: *** [bitstream] Error 1
make[1]: Leaving directory ‘/home/willy/PYNQ/sdbuild/build/Pynq-Z2/petalinux_bsp/hardware_project’
Makefile:343: recipe for target ‘/home/willy/PYNQ/sdbuild/build/Pynq-Z2/petalinux_bsp/xilinx-pynqz2-2020.2.bsp’ failed
make: *** [/home/willy/PYNQ/sdbuild/build/Pynq-Z2/petalinux_bsp/xilinx-pynqz2-2020.2.bsp] Error 2

make clean
make PREBUILT=focal.aarch64.2.7.0_2021_11_17.tar.gz BOARDS=Pynq-Z2
The error happen again.

VM memory: 4G
Processor: 4
BTW, I am using VirtualBox 6.1

I will suggest 8192 RAM.
Meantime I am also using VirtualBox 6.1
Try enlarge a bit ram clean and see

You got it. I change the VM’s RAM to 8G, the build error seems gone.
The building process is keep going.
So far I found a fail message as below:
Do you meet the same problem before?

BTW, could you help to comment below questions:

  1. what’s the board-agnostic stage??
  2. If we want to study the FSBL(first stage bootloader), and second stage boot loader (uboot), Could I find the source code about them in the sdbuild folder?

U didn’t setup the tftp and source of the petalinux with below settings?
source /Vitis/2020.2/
source /petalinux-2020.2-final/
petalinux-util --webtalk off

I had setup the source of petalinux, vitis, and vivado in bashrc:

source /tools/Xilinx/Vivado/2020.2/
source /tools/Xilinx/Vitis/2020.2/
source /home/willy/petalinux/

I follow your steps to setup the tftp, but I’m not sure it is working.
I open the terminal and show below image, I don’t see the tftp related error:

The make processing is done, and get below message which contains the tftp relative error:

[INFO] : Bootimage generated successfully

INFO: Binary is ready.
WARNING: Unable to access the TFTPBOOT folder /tftpboot!!!
WARNING: Skip file copy to TFTPBOOT folder!!!
cp -f /home/willy/PYNQ/sdbuild/build/Pynq-Z1/petalinux_project/images/linux/BOOT.BIN /home/willy/PYNQ/sdbuild/output/boot/Pynq-Z1
mkimage -c none -A arm -T script -d /home/willy/PYNQ/sdbuild/build/Pynq-Z1/petalinux_project/project-spec/meta-user/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.default /home/willy/PYNQ/sdbuild/build/Pynq-Z1/petalinux_project/images/linux/boot.scr && cp -f /home/willy/PYNQ/sdbuild/build/Pynq-Z1/petalinux_project/images/linux/boot.scr /home/willy/PYNQ/sdbuild/output/boot/Pynq-Z1/boot.scr
Image Name:
Created: Wed Jun 1 17:05:34 2022
Image Type: ARM Linux Script (gzip compressed)
Data Size: 1572 Bytes = 1.54 KiB = 0.00 MiB
Load Address: 00000000
Entry Point: 00000000
Image 0: 1564 Bytes = 1.53 KiB = 0.00 MiB
mkdir -p /home/willy/PYNQ/sdbuild/build/ZCU104
cp /home/willy/PYNQ/sdbuild/boot/image_aarch64.its /home/willy/PYNQ/sdbuild/build/ZCU104/image.its
rm -rf /home/willy/PYNQ/sdbuild/build/ZCU104/petalinux_bsp
mkdir -p /home/willy/PYNQ/sdbuild/build/ZCU104/petalinux_bsp
BSP=xilinx-zcu104-v2020.2-final.bsp BSP_BUILD=/home/willy/PYNQ/sdbuild/build/ZCU104/petalinux_bsp BSP_ABS=/home/willy/PYNQ/sdbuild/…/boards/ZCU104/xilinx-zcu104-v2020.2-final.bsp BSP_PROJECT=xilinx-zcu104-2020.2 /home/willy/PYNQ/sdbuild/scripts/ /home/willy/PYNQ/sdbuild/…/boards/ZCU104 zynqMP

  • set -e
  • board=/home/willy/PYNQ/sdbuild/…/boards/ZCU104
  • template=zynqMP
  • ‘[’ -n xilinx-zcu104-v2020.2-final.bsp ‘]’
  • [[ xilinx-zcu104-v2020.2-final.bsp == :// ]]
  • cp -f /home/willy/PYNQ/sdbuild/…/boards/ZCU104/xilinx-zcu104-v2020.2-final.bsp /home/willy/PYNQ/sdbuild/build/ZCU104/petalinux_bsp
    cp: cannot stat ‘/home/willy/PYNQ/sdbuild/…/boards/ZCU104/xilinx-zcu104-v2020.2-final.bsp’: No such file or directory
    Makefile:343: recipe for target ‘/home/willy/PYNQ/sdbuild/build/ZCU104/petalinux_bsp/xilinx-zcu104-2020.2.bsp’ failed
    make: *** [/home/willy/PYNQ/sdbuild/build/ZCU104/petalinux_bsp/xilinx-zcu104-2020.2.bsp] Error 1

I checked the build/PYNQ-Z2: it contains
image.its petalinux_bsp petalinux_project system.dtb zImage
Does it means compiler is PASS now?

Willy I see u had passed the Pynq-Z2 build so dont make clean go to the build/PYNQ/ and remove those lines and make again you are set.

Just want to make sure.
I don’t see the build/PYNQ folder, does I should create a new one and copy the into that?

did you clean?
if not, remove the line from ~/PYNQ see if this pass?

Not yet.

  1. Remove unnecessary boards. (Pynq-Z1 and ZCU104) in the build folder.
  2. Remove the the lines in PYNQ/
  3. Back to sdbuild folder and execute command:
    make BOARDS=Pynq-Z2
    It download and install a lot of packages and create a folder “focal.arm” in the build folder.
    I guess it is creating the board-agnostic image…

Anyway, It seems have different behavior for the command: “make” and “make BOARDS=Pynq-Z2”

Willy you need to read document or open Makefile to understand what it is doing.
I am confuse what actually you are trying to build here if image of Pynq-Z2 it can download wo building yourself. If you want a different base-overlay then thats the case.
If you need bsp and driver control changes then make if what you need.

Btw, I had install and build the board Pynq-Z2 from scratch and same behavior remove lines in build/PYNQ/
make BOARDS=xxx PREBUILT=xxxx and success not issue and just need to make fail on other boards stop and remove line and make again (no clean) all done.

I suffer some permission related issues. So I unisntall Vitis & Vivado again, and install them without using root permission and put their location at ~/Xilinx just like your suggestion.

  1. cd ~/PYNQ/sdbuild
  2. make PREBUILT=focal.aarch64.2.7.0_2021_11_17.tar.gz BOARDS=Pynq-Z2
  3. Build a lot of time, it will fail at board ZCU104
    makefile:16: recipe for target ‘bitstream’ failed
    make[1]: *** [bitstream] Error 137
    make[1]: Leaving directory ‘/home/willy/PYNQ/sdbuild/build/PYNQ/boards/ZCU104/base’

  • unmount_special
  • for fs in $fss
  • sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/proc
    [sudo] password for willy:
    Sorry, try again.
    [sudo] password for willy:
  • for fs in $fss
  • sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/run
  • for fs in $fss
  • sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/dev
  • sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/ccache
  • rmdir /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/ccache
    Makefile:343: recipe for target ‘/home/willy/PYNQ/sdbuild/build/Pynq-Z2.tar.gz’ failed
    make: *** [/home/willy/PYNQ/sdbuild/build/Pynq-Z2.tar.gz] Error 2
  1. Remove lines in build/PYNQ/, and execute make again:
    make PREBUILT=focal.aarch64.2.7.0_2021_11_17.tar.gz BOARDS=Pynq-Z2
    Finally, I got the success result:

One more thanks again, briansune.
Another question, how can we compress them into the SD card image just like the below link?

BTW, in your post:


Step 10 update a bit:
apt-get install tftpd tftp openbsd-inetd
gedit /etc/inetd.conf
(add this) tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftproot
mkdir /tftproot
chmod 777 /tftproot
/etc/init.d/openbsd-inetd restart
netstat -an | more | grep udp

The “tftproot” should be corrected to “tftpboot”, because the make script use “tftpboot” not “tftproot”.
INFO: Failed to copy built images to tftp dir: /tftpboot

1 Like

I have a question about the prebuilt board-agnostic image.
For the PYNQ-Z2 board, does I should use the “arm” not "aarch64 ".

Why I can build pass when using the command:

  1. make PREBUILT=focal.aarch64.2.7.0_2021_11_17.tar.gz BOARDS=Pynq-Z2

You should uese ARM as ARM7l in ZYNQ is a 32bit processor.

What I understand is that if you got more experience on PetaLinux boot and root.
Boot is a boot loader and driver list and bsp and elf preload files that located in which similar to where I am going to find my OS (root location).

So you are pointing to root about the question you trying to ask,
Root is just a ext4 partition that copy onto. does it mount and check I am not sure but as it is using a pre-built image I will expect it is just a copy and merge + zip action.

So the major differences are only the boot and the root is from the gz file.

However, what happen when you boot your OS with a incompatible core architecture I had no idea.

@briansune Thanks for your answer.
I’m not familiar to the PetaLinux. I will study how the Petalinux working.
I would like to understand how the FSBL, uboot, and kernel building. It seems the make in the sdbuild folder is simply to process of them.


For my limited understanding.
I don’t have much detail reading on the sdbuild for my case, unless I had some custom driver or communication needed I will not investigate much.
But I do had a little experience on custom PetaLinux + Ubuntu ARM build (Not PYNQ).
So what I understand is both PYNQ and custom build are so similar control and setup are all following the same backend settings (It will not become other build tool as all relying PetaLinux so far).

Now back to the question:
FSBL - my experience told me if you had a complete standalone ZYNQ design (No OS) and you are going to boot from other location i.e. DDR /NAND the first thing you would need is to tell the ARM to use bar bar bar so FSBL=First Stage Bootloader I will think as very first stage of BIOS? (Maybe I am wrong).
After that it will start setup more things and seek boot bar bar bar.
Things getting so complex maybe open a new post for other to answer this more deeply.

But as an user + developer + engineer why spend so much time to understand all…llllllll details when the top idea could support you enough to develop.