PYNQ2.7 Custom Board Build Error - PYNQ_SDIST

Hi all,

I am attempting to build an image for PYNQ 2.7 for a custom board.

I am using the image_v2.7 branch on the GitHub repository.

I have the correct version of tools setup (2020.2 with the y2k22 patch), and I am providing PYNQ_SDIST as well as PREBUILT variables to the make command as follows:

make PYNQ_SDIST=/home/Osama/prebuilt/pynq-2.7.0.tar.gz PREBUILT=/home/Osama/prebuilt/focal.arm.2.7.0_2021_11_17.tar.gz BOARDDIR=/home/Osama/PYNQ/boards/ BOARDS=7z045

My .spec file looks like the following:

ARCH_7z045 := arm
BSP_7z045 := 
FPGA_MANAGER_7z045 := 0
STAGE4_PACKAGES_7z045 := xrt pynq ethernet pynq_peripherals precached_metadata

My board directory contains an .xsa file in petalinux_bsp/hardware_project directory, which the build flow should utilize for the bitstream and base PetaLinux project (from what I understand).

The issue I’m facing is that the build flow attempts to rebuild bitstreams for all boards. I found that this happens when the PYNQ source distribution is being re-compiled, but this shouldn’t happen since I am providing the path to the correct PYNQ_SDIST file.

Taking a look at the makefile present on the image_v2.7 branch, I do not see the PYNQ_SDIST term defined anywhere. Am I supposed to use some different makefile in order to use that functionality?


Are you sure you read the build guide?

Make sure yourself read the:

Using the prebuilt board-agnostic image

Re-use the PYNQ source distribution tarbal

If you understand the following guide I cannot see this will be the question you are referring.


Yes, I have gone through that documentation. I want to re-use the PYNQ source distribution tarbal that is provided on the PYNQ website for the 2.7 version, and I am following the steps as mentioned in the documentation.

I do not want to build bitstreams for the other boards (PYNQ-Z1, Z2, etc.), and so I am trying to directly use the PYNQ_SDIST parameter. Even after adding this parameter and pointing to the right directory, the make script attempts to rebuild bitstreams for the other boards, whereas it should NOT do this if I understand everything correctly.

I would greatly appreciate if others in this forum could guide as well.


As yourself mentioned you had read carefully:
So I cannot see the build script nor the tarball is faulty.

Re-use the PYNQ source distribution tarball

To avoid rebuilding the PYNQ source distribution package, and consequently bypass the need to build bitstreams (except for external boards) and MicroBlazes’ bsps and binaries, a prebuilt PYNQ sdist tarball can be reused by specifying the PYNQ_SDIST variable when invoking make. The tarball specific to the target PYNQ version will be distributed when a new version is released on GitHub.

cd /sdbuild/

Please also refer to the sdbuild readme on our GitHub repository for more info regarding the image-build flow.


I found all of this in the documentation already, and it still attempts to build bitstreams for the default boards, which is why I created this thread.

Could you try running the script on your end on a fresh clone of the image_v2.7 branch for some custom board? It will still attempt to rebuild the bitstreams, even after the PYNQ_SDIST variable is pointing to the correct prebuilt PYNQ source distribution file.


The guide is referring A | B NOT A & B.
While the board you are using is custom so modulator also have no obligation to make it able to build.
While I had compile xc7z100 custom board successfully (MANY TIMES).
Using make Prebuilt=XXXX BOARDS=XXXX

Build guide 2.7 & 3.0:

Could help a bit a better explanation about the TWO make command.

Thank you

Hi Osama,

There are a couple ways you can do this, I can’t recall with v2.7 if you could just empty all contents of (found under the PYNQ git repo).

Back then before I knew about clearing the contents I would just git rm -rf the board folders under PYNQ_REPO_ROOT/boards/ .

You will need to do a local commit of those changes because when PYNQ builds it re-clones what you have local. If you don’t commit the changes it will ignore them and use the last true commit.

It’s the same game for the Ultra96 PYNQ builds. I didn’t want to wait to have Vivado build a bunch of unused bitstreams. You can look at the script, it is simple. GitHub - Avnet/Ultra96-PYNQ: Board files to build Ultra 96 PYNQ image. See the image_v2.7 branch and v3.0, currently the latest commit for the master branch is v3.0.