Build Petalinux failure

Hello there,

  • I managed to setup the building environment.
  • I have my board SOC hdf file ready.

I thought the next step would be creating a myboard.bsp with petalinux and then run the image_from_prebuilt.sh letting it crunch the myBoard.bsp just created and the bionic.arm.2.4.img…
petalinux-create was OK
petalinux-config --get-hw-description=< path-to-my-hdf-folder > was OK
petalinux-build failed:
I will post on the xilinx-petallinux forum, too, as this looks PYNQ unrelated, but just in case anyone has seen this before…


Thank you

I think the right step is to get the hdf into the board folder, and then https://github.com/Xilinx/PYNQ/blob/master/sdbuild/scripts/create_bsp.sh
can take care of it. Note that before you package your bsp, you should not do petalinux build.

image_from_prebuilt.sh assumes you have the bsp ready but you need bsp built first.

For example, for our Pynq-Z1 board, we can put a single file base.hdf in boards/Pynq-Z1/petalinux_bsp/hardware_project and our makefile is able to pick the hdf up and build the image.

Hello Rock,
I have the hdf, I just need to create this folder:
mkdir <PYNQ_repository>/myboards/myboardname/petalinux_bsp/hardware_project
stuff the hdf in it and run:
make BOADDIR=<PYNQ_repository>/myboards/myboardname
is that all?

It didn’t fail, but it doesn’t seem it goes very far…

Ok. It is:
make BOADDIR=<PYNQ_repository>/myboards
Now it runs a little longer… but still fails short
terminal output is below:
vagrant@ubuntu-xenial:/pynq/sdbuild$ make BOARDDIR=/pynq/myboards
/opt/qemu/bin/qemu-arm-static -version | fgrep 2.8.0
qemu-arm version 2.8.0
which vivado | fgrep 2018.3
/sdbuild/Vivado/Vivado/2018.3/bin/vivado ****
which sdx | fgrep 2018.3
/sdbuild/Vivado/SDx/2018.3/bin/sdx
which petalinux-config | fgrep 2018.3
/sdbuild/petalinux/2018.3/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/sdbuild/petalinux/2018.3/tools/linux-i386/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/sdbuild/petalinux/2018.3/tools/linux-i386/microblaze-xilinx-elf/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 /pynq/sdbuild/scripts/check_Env.sh
bash /pynq/sdbuild/scripts/check_mounts.sh
mkdir -p /pynq/sdbuild/build/Ax
cp /pynq/sdbuild/boot/image_arm.its /pynq/sdbuild/build/Ax/image.its
rm -rf /pynq/sdbuild/build/Ax/petalinux_bsp
mkdir -p /pynq/sdbuild/build/Ax/petalinux_bsp
BSP= BSP_BUILD=/pynq/sdbuild/build/Ax/petalinux_bsp BSP_ABS= BSP_PROJECT=xilinx-ax-2018.3 /pynq/sdbuild/scripts/create_bsp.sh /pynq/myboards/Ax zynq
+ set -e
+ board=/pynq/myboards/Ax
+ template=zynq
+ ‘[’ ‘!’ -z ‘’ ‘]’
+ cp -rf /pynq/myboards/Ax/petalinux_bsp/hardware_project /pynq/sdbuild/build/Ax/petalinux_bsp
+ cd /pynq/sdbuild/build/Ax/petalinux_bsp/hardware_project
+ ‘[’ -e makefile ‘]’
+ cd /pynq/sdbuild/build/Ax/petalinux_bsp
+ petalinux-create --type project --template zynq --name xilinx-ax-2018.3
INFO: Create project: xilinx-ax-2018.3
INFO: New project successfully created in /pynq/sdbuild/build/Ax/petalinux_bsp/xilinx-ax-2018.3
+ cd xilinx-ax-2018.3
+ petalinux-config --get-hw-description=/pynq/sdbuild/build/Ax/petalinux_bsp/hardware_project --oldconfig
INFO: Getting hardware description…
INFO: Rename ax_top_bd_wrapper.hdf to system.hdf
[INFO] generating Kconfig for project
[INFO] oldconfig project
[INFO] sourcing bitbake
ERROR: Failed to source bitbake
ERROR: Failed to config project.
ERROR: Get hw description Failed!.
Makefile:298: recipe for target ‘/pynq/sdbuild/build/Ax/petalinux_bsp/xilinx-ax-2018.3.bsp’ failed
make: *** [/pynq/sdbuild/build/Ax/petalinux_bsp/xilinx-ax-2018.3.bsp] Error 255
vagrant@ubuntu-xenial:/pynq/sdbuild$

This is weird. How did you generate the hdf? Which version of vivado?

I have googled it around. Maybe this post can help?
https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2017-2-Failed-to-source-bitbake/td-p/796848

I have not seen this error before. Maybe you can find some log message (build.log) there?

btw, you can use markdown for code highlighting.

make BOARDDIR=/pynq/myboards

Vivado 2018.3, Petalinux 2018.3
The complete config.log highlighting more info on the error is now attached.
I’ll check your link and see if I can come out of the hole
Thank you
config.log.txt (16.5 KB)

This thread suggests to not build on shared folder… but vagrant sets up the VM with the github pynq repository seen specifically as a shared folder… how am I supposed to build in another folder?!? And how come it works for everybody else?!?

Hi, It seems that the Petalinux is not installed correctly, please check if you can find bitbake file in the Petalinux installation folder. If you can not find the file, please re-install the Petalinux software.


Please take note that Petalinux need to be installed as a non-root user. Please use sudo chown command to give access to current user if you want to install petalinux to a folder that current user has no access, for example /opt/petalinux folder.

1 Like

It must be a path issue, then…


petalinux was installed as vagrant user, because the VM was built running “vagrant up” as instructed in the documentation. Btw I do not have root credentials on the VM
Best regards

Based on you thread, it might be better to just install petalinux inside the /opt folder?

If I knew the path was significant, I would have done so… unfortunately now the VM has sucked all the 100GB I painfully freed in my host disk and I have no breathing space left.
Probably I will delete and recreate the VM and reinstall SDx and petalinux. To be honest, as mentioned in another thread, I already created another, huger, VM in the cloud, and tried to build the SD there, but failed miserably nevertheless :disappointed:
It failed much further down the line, though


I have also encountered with the issue as you, it was resolved after reinstallation of the petalinux software.

can u send me comlete procedure with images to build pynq image for other boards

Is it a mistake to do “petalinux-build” that prohibits correct image creation (as in “one MUST NOT do it”)
or
does it just waste time, because pynq’s “make BOARD=…” only needs the output of “petalinux-package --bsp …”?

I’m still searching for a more in-depth description of the custom board build process and possible caveats.

It is the latter. The make process takes bsp as an input.