PYNQ: PYTHON PRODUCTIVITY FOR ZYNQ

Issues with the PYNQ make

Hi all,

In addition to my previous post concerning the porting of petalinux meta-user layers and associated configurations I have also noticed several issues with the current PYNQ image build tools.

If I navigate to the sd build folder and enter the following

make clean
make

The PYNQ image is built, the output is shown below.

Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xecdb1c95

Device Boot Start End Sectors Size Id Type
/home/developer/PYNQ/sdbuild/output/PYNQ-pnfs-2.4.img1 * 2048 206847 204800 100M c W95 FAT
/home/developer/PYNQ/sdbuild/output/PYNQ-pnfs-2.4.img2 206848 11242159 11035312 5.3G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

  • total_size=5621080
  • truncate -s 5621080K /home/developer/PYNQ/sdbuild/output/PYNQ-pnfs-2.4.img

Now trying do it using the make BOARDDIR=<absolute_path>/myboards as described in the Readme.md file in the sdbuild directory.

developer@smoz:~/PYNQ/sdbuild$ make clean
if [ -e /home/developer/PYNQ/sdbuild/build/gcc-mb ]; then chmod u+w -fR /home/developer/PYNQ/sdbuild/build/gcc-mb; fi
rm -rf /home/developer/PYNQ/sdbuild/build/gcc-mb
rm -rf /home/developer/PYNQ/sdbuild/build
rm -rf /home/developer/PYNQ/sdbuild/output
developer@smoz:~/PYNQ/sdbuild$ make BOARDDIR=/home/developer/PYNQ/boards/PYNQ-pnfs/
which vivado | fgrep 2018.3
/tools/Xilinx/Vivado/2018.3/bin/vivado
which sdx | fgrep 2018.3
/tools/Xilinx/SDx/2018.3/bin/sdx
which petalinux-config | fgrep 2018.3
/tools/pkg/petalinux/2018.3/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/tools/pkg/petalinux/2018.3/tools/linux-i386/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/tools/pkg/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 /home/developer/PYNQ/sdbuild/scripts/check_Env.sh
bash /home/developer/PYNQ/sdbuild/scripts/check_mounts.sh

It stops after check_mounts

Okay, lets assume something is not 100% cleaned after the make clean. Next I reboot the machine, rerun the Xilinx tools setup scripts and try again.

developer@smoz:~ source /tools/Xilinx/Vivado/2018.3/settings64.sh developer@smoz:~ source /tools/Xilinx/SDx/2018.3/settings64.sh
developer@smoz:~ source /tools/pkg/petalinux/2018.3/settings.sh PetaLinux environment set to '/tools/pkg/petalinux/2018.3' INFO: Checking free disk space INFO: Checking installed tools INFO: Checking installed development libraries INFO: Checking network and other services developer@smoz:~ cd PYNQ/sdbuild/
developer@smoz:~/PYNQ/sdbuild$ make BOARDDIR=/home/developer/PYNQ/boards/PYNQ-pnfs/
which vivado | fgrep 2018.3
/tools/Xilinx/Vivado/2018.3/bin/vivado
which sdx | fgrep 2018.3
/tools/Xilinx/SDx/2018.3/bin/sdx
which petalinux-config | fgrep 2018.3
/tools/pkg/petalinux/2018.3/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/tools/pkg/petalinux/2018.3/tools/linux-i386/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/tools/pkg/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 /home/developer/PYNQ/sdbuild/scripts/check_Env.sh
bash /home/developer/PYNQ/sdbuild/scripts/check_mounts.sh
developer@smoz:~/PYNQ/sdbuild$

Fails at exactly the same place as before.

Now just do a make on its own and all is okay.

So on my system at lease there is an issue with the command make make BOARDDIR=<absolute_path>/myboards

Another issue with the build process is running make after a successful build also has the same problem. This is significant as the tools on my system don’t appear to be maintaining state and minor changes require the entire build to be re-run which takes several hours.

Has anybody else experienced these issues and does anyone know how to fix it?

Thanks,

Walter

What is your board name? Also, can you show the spec file content?

Hi Rock,

The details of the spec file and steps taken are detailed in this post

The contents of the spec file are

The content of the PYNQ-pnfs.spec file is

ARCH_PYNQ-pnfs := arm
BSP_PYNQ-pnfs := pnfs.bsp
BITSTREAM_PYNQ-pnfs := cz2_wrapper.bit
STAGE4_PACKAGES_PYNQ-pnfs := pynq boot_leds peekpoke sampleapp ethernet

pnfs.bsp is the bsp generated from executing in the associated SDK hardware directory
petalinux-package --bsp -p ~/peta-z2/pnfs/ --hwsource . --output pnfs.bsp

Note, this issue exists using the standard board files which come with the PYNQ distribution.

I will have a look at the scripts and makefiles when I have a chance to see if I can determine where the issue lies.

Regards

Walter

The problem is after a successful build, you have all the target files in your system so make won’t do anything other than checking your environment. To restart from a certain stage, you need to remove the corresponding target file. For example, if you only want to rebuild stage4 packages, just remove the final image in the output folder and run make again.

Hi Rock,

Thanks for getting back. Perhaps it might be an idea to add some more targets to the make file which support the deleting of key sections. I haven’t checked what proportion of the overall build time rebuilding the stage 4 packages would take after deleting the final image in the output folder. I will have a look. Hopefully not too long.

Regards

Walter