PYNQ: PYTHON PRODUCTIVITY

ERROR: Failed to generate meta-plnx-generated layer

I am trying to build an image for Zedboard using PYNQ. However, I am getting the following error:

make PREBUILT=/home/nairit/Xilinx/pynq_rootfs_arm_v2.5/bionic.arm.2.5.img BOARDS=Zedboard
/opt/qemu/bin/qemu-arm-static -version | fgrep 4.0.0
qemu-arm version 4.0.0
vivado -version | fgrep 2019.1
Vivado v2019.1 (64-bit)
xsdk -version | fgrep 2019.1
****** SDK v2019.1 (64-bit)
which petalinux-config
/home/nairit/opt/Xilinx/PetaLinux/2019.1/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/home/nairit/opt/Xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/home/nairit/opt/Xilinx/PetaLinux/2019.1/tools/xsct/gnu/microblaze/lin/bin/microblaze-xilinx-elf-gcc
which ct-ng
/opt/crosstool-ng/bin/ct-ng
which python | fgrep /usr/bin/python
/usr/bin/python
sudo -n mount > /dev/null
bash /home/nairit/PYNQ/PYNQ/sdbuild/scripts/check_env.sh
Pass: Current OS is supported.
Checking system for installed bc
gperf
bison
flex
texi2html
texinfo
help2man
gawk
libtool
libtool-bin
build-essential
automake
libncurses5-dev
libglib2.0-dev
device-tree-compiler
qemu-user-static
binfmt-support
multistrap
git
lib32z1
lib32ncurses5
libbz2-1.0
lib32stdc++6
libssl-dev
kpartx
zerofree
u-boot-tools
rpm2cpio
libsdl1.2-dev
rsync
python3-pip
gcc-multilib
bash /home/nairit/PYNQ/PYNQ/sdbuild/scripts/check_mounts.sh
mkdir -p /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard
cp /home/nairit/PYNQ/PYNQ/sdbuild/boot/image_arm.its /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/image.its
rm -rf /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_bsp
mkdir -p /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_bsp
BSP=avnet-digilent-zedboard-v2019.1-final.bsp BSP_BUILD=/home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_bsp BSP_ABS=/home/nairit/PYNQ/PYNQ/sdbuild/../boards/Zedboard/avnet-digilent-zedboard-v2019.1-final.bsp BSP_PROJECT=xilinx-zedboard-2019.1 /home/nairit/PYNQ/PYNQ/sdbuild/scripts/create_bsp.sh /home/nairit/PYNQ/PYNQ/sdbuild/../boards/Zedboard zynq
+ set -e
+ board=/home/nairit/PYNQ/PYNQ/sdbuild/../boards/Zedboard
+ template=zynq
+ '[' -n avnet-digilent-zedboard-v2019.1-final.bsp ']'
+ [[ avnet-digilent-zedboard-v2019.1-final.bsp == *\:\/\/* ]]
+ cp -f /home/nairit/PYNQ/PYNQ/sdbuild/../boards/Zedboard/avnet-digilent-zedboard-v2019.1-final.bsp /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_bsp
+ cd /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_bsp
++ cut -f1 '-d '
+++ tar -xvf avnet-digilent-zedboard-v2019.1-final.bsp

...

avnet-digilent-zedboard-2019.1/.gitignore
avnet-digilent-zedboard-2019.1/config.project
avnet-digilent-zedboard-2019.1/README.hw
rm -rf /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project
cd /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard && petalinux-create -t project -s /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_bsp/xilinx-zedboard-2019.1.bsp -n petalinux_project
INFO: Create project: petalinux_project
INFO: New project successfully created in /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project
echo 'CONFIG_USER_LAYER_0="'/home/nairit/PYNQ/PYNQ/sdbuild/boot/meta-pynq'"' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/config
echo 'CONFIG_SUBSYSTEM_ROOTFS_SD=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/config
echo 'CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/config
echo 'CONFIG_SUBSYSTEM_DEVICETREE_FLAGS="-@"' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/config
echo 'CONFIG_SUBSYSTEM_DTB_OVERLAY=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/config
echo 'CONFIG_SUBSYSTEM_FPGA_MANAGER=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/config
# xrt only supports aarch64 in 2019.1; to remove in next release
if [ arm = aarch64 ]; then echo 'CONFIG_xrt=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/rootfs_config ; echo 'CONFIG_xrt-dev=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/rootfs_config ; echo 'CONFIG_zocl=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/rootfs_config ; echo 'CONFIG_opencl-headers-dev=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/rootfs_config ; echo 'CONFIG_opencl-clhpp-dev=y' >> /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project/project-spec/configs/rootfs_config ; fi
petalinux-config --silentconfig -p /home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project
[INFO] generating Kconfig for project
[INFO] silentconfig project
[INFO] sourcing bitbake
[INFO] generating plnxtool conf
[INFO] generating meta-plnx-generated layer
ERROR: Failed to generate meta-plnx-generated layer
ERROR: Failed to config project.
Makefile:324: recipe for target '/home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project' failed
make: *** [/home/nairit/PYNQ/PYNQ/sdbuild/build/Zedboard/petalinux_project] Error 255

My OS is Ubuntu 18.04.1 in a VirtualBox Version 6.1.6 with guest additions installed. I am using Vivado, SDK and Petalinux 2019.1 and latest PYNQ cloned using:

git clone https://github.com/Xilinx/PYNQ.git

I am using a prebuilt PYNQ rootfs arm v2. 5 image file and the Petalinux BSP avnet-digilent-zedboard-v2019.1-final.bsp downloaded from Xilinx.

I created a folder Zedboard inside which I put the BSP file and a Zedboard.spec file. The contents of the Zedboard.spec file are:

ARCH_Zedboard := arm
BSP_Zedboard := avnet-digilent-zedboard-v2019.1-final.bsp
BITSTREAM_Zedboard := 

STAGE4_PACKAGES_Zedboard := pynq boot_leds ethernet

I tried running the codes:

make PREBUILT=/home/nairit/Xilinx/pynq_rootfs_arm_v2.5/bionic.arm.2.5.img BOARDS=Zedboard

and

./scripts/image_from_prebuilt.sh Zedboard /home/nairit/PYNQ/PYNQ/boards/MyBoards/Zedboard/avnet-digilent-zedboard-v2019.1-final.bsp arm /home/nairit/Xilinx/pynq_rootfs_arm_v2.5/bionic.arm.2.5.img

but end up with the same error.

Can someone please help?

I set the default python to 3.6 when setting up the OS. Switching default python to 2.7 solved it.

sudo update-alternatives --config python