Error in bionic.arm.stage2.img

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

...
...
sigrok-cli configuration summary:

  - Package version: 0.5.0
  - Prefix: /opt/sigrok
  - Building on: armv7l-unknown-linux-gnueabihf
  - Building for: armv7l-unknown-linux-gnueabihf

Detected libraries:

  - (REQUIRED) glib-2.0 >= 2.28.0: yes (2.56.1)
  - (REQUIRED) libsigrok >= 0.3.0: yes (0.3.0)
  - (REQUIRED) libsigrokdecode >= 0.3.0: yes (0.3.0)

+ make -j 4
make[1]: Entering directory '/root/sigrok_build/sigrok-cli-0.5.0'
/usr/bin/make  all-am
  CC       show.o
  CC       device.o
  CC       session.o
  CC       main.o
  CC       input.o
  CC       decode.o
  CC       parsers.o
  CC       anykey.o
  CCLD     sigrok-cli
make[1]: Leaving directory '/root/sigrok_build/sigrok-cli-0.5.0'
+ make install
make[1]: Entering directory '/root/sigrok_build/sigrok-cli-0.5.0'
 /bin/mkdir -p '/opt/sigrok/bin'
  /bin/bash ./libtool --silent  --mode=install /usr/bin/install -c sigrok-cli '/opt/sigrok/bin'
 /bin/mkdir -p '/opt/sigrok/share/man/man1'
 /usr/bin/install -c -m 644 doc/sigrok-cli.1 '/opt/sigrok/share/man/man1'
make[1]: Leaving directory '/root/sigrok_build/sigrok-cli-0.5.0'
+ cd ..
+ echo 'PATH=/opt/sigrok/bin:$PATH'
+ cd ..
+ rm -rf sigrok_build
+ rm -f /libsigrokdecode.diff
+ rm /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/qemu.sh
+ '[' -e /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/packages/sigrok/post.sh ']'
+ unmount_special
+ for fs in '$fss'
+ sudo umount -l /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/proc
+ for fs in '$fss'
+ sudo umount -l /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/run
+ for fs in '$fss'
+ sudo umount -l /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/dev
+ sudo umount -l /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/ccache
+ rmdir /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/ccache
/home/nairit/PYNQ/PYNQ_v2.3/sdbuild/scripts/unmount_image.sh /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm.stage2.img
+ set -e
+ target=/home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm
+ image_file=/home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm.stage2.img
+ sudo umount /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm/boot
+ sudo umount /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm
+ sleep 5
+ sudo kpartx -d /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/bionic.arm.stage2.img
loop deleted : /dev/loop0
git clone ../ /home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/PYNQ
fatal: repository '../' does not exist
Makefile:57: recipe for target '/home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/PYNQ' failed
make: *** [/home/nairit/PYNQ/PYNQ_v2.3/sdbuild/build/PYNQ] Error 128
nairit@nairit-VirtualUbuntu:~/PYNQ/PYNQ_v2.3/sdbuild$ 

I am using Vivado, SDK and Petalinux 2018.2 and PYNQ v2.3 downloaded from Branch: image_v2.3 at GitHub - Xilinx/PYNQ: Python Productivity for ZYNQ

I am not using any prebuilt image file and using only the Petalinux BSP avnet-digilent-zedboard-v2018.2-final.bsp download 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-v2018.2-final.bsp
BITSTREAM_Zedboard := 

STAGE4_PACKAGES_Zedboard := pynq boot_leds ethernet

After I got this error the first time, I deleted the bionic.arm.stage2.img file and ran

make BOARDDIR=/home/nairit/PYNQ/PYNQ_v2.3/boards/MyBoards

again but with the same resulting error.

I tried solution for SLEEP as well from Rebuild Pynq image failed but with no success.

Can someone please help?

The Makefile expects to be run from inside a git repository rather than the downloaded source files. Can you try cloning the repository, checkout out the branch you want and then running make?

Peter

1 Like

Thanks Peter. Can I copy the contents of my old sdbuild folder to the new cloned repo and start the make process again?? Both are v2.3

We have limited data connectivity here and it takes hours just to download the files need for the build process.

That should work out

Peter

One thing that might be of interest to you is the PYNQ_UBUNTU_REPO environment variable. We don’t really document it as it’s more for internal use but you can use that to pull the Ubuntu packages from a local repository rather than the internet.

We internally have our own build of the Ubuntu packages which sit in a folder in a manner like this which then get used by setting PYNQ_UBUNTU_REPO="copy://path/to/repo". This might help your bandwidth usage.

Peter

Thank you very much Peter.

I am running the build process again.

Having the ubuntu repo in a local folder seems like e good idea. I am new to Linux platform. So don’t know how to set environment variables in linux. May be will learn with time.

Thanks Peter. Cloning from git repo solved it. I can access the zedboard via ethernet.

However, I now get errors in python when running the jupyter notebooks. When I run the cell:

from pynq import PL
from pynq import Overlay

ol = Overlay(PL.bitfile_name)

I get the following error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-86472a2f9022> in <module>()
----> 1 from pynq import PL
      2 from pynq import Overlay
      3 
      4 ol = Overlay(PL.bitfile_name)

/usr/local/lib/python3.6/dist-packages/pynq/__init__.py in <module>()
     43 from .overlay import DefaultHierarchy
     44 from .overlay import DefaultIP
---> 45 from .pmbus import get_rails
     46 from .pmbus import DataRecorder
     47 from . import lib

/usr/local/lib/python3.6/dist-packages/pynq/pmbus.py in <module>()
     29 
     30 import cffi
---> 31 import pandas as pd
     32 import threading
     33 import time

ModuleNotFoundError: No module named 'pandas'

I upgraded pip from 9.x.x to 20.0.2. Then ran:

!pip3 install pandas

But again this error:

Collecting pandas
  Using cached https://files.pythonhosted.org/packages/2f/79/f236ab1cfde94bac03d7b58f3f2ab0b1cc71d6a8bda3b25ce370a9fe4ab1/pandas-1.0.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-fuaso9hi/pandas/setup.py", line 757, in <module>
        ext_modules=maybe_cythonize(extensions, compiler_directives=directives),
      File "/tmp/pip-build-fuaso9hi/pandas/setup.py", line 512, in maybe_cythonize
        f"Cannot cythonize with old Cython version ({_CYTHON_VERSION} "
    RuntimeError: Cannot cythonize with old Cython version (0.26.1 installed, needs 0.29.13)
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fuaso9hi/pandas/

I tried upgrading Cython:

!pip3 install --upgrade

But again got this error:

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting Cython
  Using cached Cython-0.29.17-py2.py3-none-any.whl (971 kB)
Installing collected packages: Cython
  Attempting uninstall: Cython
    Found existing installation: Cython 0.26.1
ERROR: Cannot uninstall 'Cython'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

The version of pandas we use on our images is 0.22. We’ve hard-coded this in newer versions of sdbuild to avoid these problems. Try running

sudo pip3 install pandas==0.22.0

Peter

1 Like

Thanks Peter. I did as you suggested. But I am stuck in the installation process. Been more than an hour now.

Did I do something wrong?

UPDATE: It completed installation of pandas after a couple of hours.