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

**URL:** <https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243>\
**Category:** Support\
**Created:** [May 24, 2022, 10:36pm UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243 "2022-05-24T22:36:14Z")\
**Posts on this page:** 10\
**Page:** 3

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [June 1, 2022, 9:15am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/41 "2022-06-01T09:15:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Willy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/willy/32/3440_2.png) [@Willy](https://discuss.pynq.io/u/Willy)\
**Post date:** [June 1, 2022, 9:24am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/42 "2022-06-01T09:24:14Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/e/ee673c07f5831fd5650ec418e831f2ec471f009d.png)  
Just want to make sure.  
I don’t see the build/PYNQ folder, does I should create a new one and copy the build.sh into that?

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [June 1, 2022, 9:27am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/43 "2022-06-01T09:27:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Willy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/willy/32/3440_2.png) [@Willy](https://discuss.pynq.io/u/Willy)\
**Post date:** [June 1, 2022, 1:48pm UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/44 "2022-06-01T13:48:24Z")

</div>

Not yet.

1. Remove unnecessary boards. (Pynq-Z1 and ZCU104) in the build folder.
2. Remove the the lines in PYNQ/build.sh
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…  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/6/6576d9fb35a56fd6bca9f34fa4656a0e1aa72cff.png)

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

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [June 1, 2022, 8:13pm UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/45 "2022-06-01T20:13:34Z")

</div>

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/build.sh  
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.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/4/4eb75d28d46ed8e45b270442f339f5cb1ca4f934.png)

---

<div class="post-metadata">

**Author:** ![Willy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/willy/32/3440_2.png) [@Willy](https://discuss.pynq.io/u/Willy)\
**Post date:** [June 2, 2022, 12:28pm UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/46 "2022-06-02T12:28:33Z")

</div>

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/build.sh, 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:  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/0/0fd8447703cb9e3bcc3d91164ce47c340b02119a.png)

One more thanks again, briansune.  
Another question, how can we compress them into the SD card image just like the below link?  
[https://bit.ly/pynqz2\_2\_7](https://bit.ly/pynqz2_2_7)

BTW, in your post:

> [@Stuck at extract yocoto](https://discuss.pynq.io/t/stuck-at-extract-yocoto/4134/8):
>
> Unless people having hard time on setting up the environment: Vagrant is not a good method to setup the SD build environment. I have not investigate to the bottom but what previous engineer shows there might Virtual R/W issue during such setup. STEPS: I will suggest download 18.04.06 LTS Ubuntu from official website Create a virtual disk size about 200GB or more, set the CPU \>#4, RAM \>#8192 Update Ubuntu packages before setting up the PYNQ 3b) Git clone the PYNQ to /home//PYNQ 3c) sudo ch…

==================================

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**

---

<div class="post-metadata">

**Author:** ![Willy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/willy/32/3440_2.png) [@Willy](https://discuss.pynq.io/u/Willy)\
**Post date:** [June 7, 2022, 2:15am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/47 "2022-06-07T02:15:34Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/e/e501fec1953bf64a5dbf6ba3cd4c21738274f886.png)  
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

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [June 7, 2022, 2:21am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/48 "2022-06-07T02:21:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Willy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/willy/32/3440_2.png) [@Willy](https://discuss.pynq.io/u/Willy)\
**Post date:** [June 8, 2022, 8:35am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/49 "2022-06-08T08:35:44Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [June 8, 2022, 8:56am UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/50 "2022-06-08T08:56:29Z")

</div>

Willy,

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.

[Previous page](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243.md?page=2)
