PYNQ2.6.0 petalinux2020.1 vivado2020.1 for zcu102

PYNQ2.6.0     petalinux2020.1  vivado2020.1  vitis2020.1 for  zcu102     failed   

1、设置相关环境

        git clone https://github.com/Xilinx/PYNQ.git
        cd PYNQ
        git checkout v2.6.0
        git checkout -b ZCU102

        source ./sdbuild/scripts/setup_host.sh

        设置环境:

source /media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/xilinx/Vivado/2020.1/settings64.sh
source /media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/xilinx/Vitis/2020.1/settings64.sh
source /media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/xilinx/Petalinux/2020.1/settings.sh
export PATH=/opt/qume/bin:/opt/crosstool-ng/bin:$PATH

相关环境都设置完毕,执行 make checkenv 查看,通过。

/opt/qemu/bin/qemu-aarch64-static -version | fgrep 4.0.0
qemu-aarch64 version 4.0.0
/opt/qemu/bin/qemu-arm-static -version | fgrep 4.0.0
qemu-arm version 4.0.0
vitis -version | fgrep 2020.1
****** Vitis v2020.1 (64-bit)
vivado -version | fgrep 2020.1
Vivado v2020.1 (64-bit)
#vitis -version | fgrep 2020.1
which petalinux-config
/media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/xilinx/Petalinux/2020.1/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/xilinx/Vitis/2020.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/xilinx/Petalinux/2020.1/tools/xsct/gnu/microblaze/lin/bin/microblaze-xilinx-elf-gcc
which ct-ng
/opt/crosstool-ng/bin/ct-ng
which python | fgrep /home/ccpiot/anaconda3/bin/python
/home/ccpiot/anaconda3/bin/python
sudo -n mount > /dev/null
bash /media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/projects/petalinux_work/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
libidn11
curl
524288
Set inotify max_user_watches to 524288

2、把bionic.aarch64.2.6.0_2020_10_19.img  放在prebuild文件夹下

3、在PYNQ/boards下建立ZCU102文件夹,包含xilinx-zcu102-v2020.1-final.bsp和ZCU102.spec

        ZCU102.spec里的内容如下:

ARCH_ZCU102 := aarch64
BSP_ZCU102 := xilinx-zcu102-v2020.1-final.bsp


STAGE4_PACKAGES_ZCU102 := pynq ethernet 

4、在sdbuild文件夹下执行以下命令:

     make BOARDS=ZCU102 PREBUILD=./prebuilt/bionic.aarch64.2.6.0_2020_10_19.img   

        似乎上个命令不行,换成下面的命令:        

make PREBUILT=/media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/projects/petalinux_work/PYNQ/sdbuild/prebuild/bionic.aarch64.2.6.0_2020_10_19.img BOARDDIR=/media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/projects/petalinux_work/PYNQ/myboards

把 “3、在PYNQ/boards下建立ZCU102文件夹,“换成在PYNQ下建立myboards文件夹,把ZCU102文件夹复制到这个下面

5、编译遇到的问题(已解决)

1、vitis等工具的版本匹配问题,主机如果安装多个版本的vitis等工具,只source用到的版本的settings64.sh就可以

2、主机的python位置问题,查看sdbuild下的Makefile文件中的以下句子,查看主机中执行which python命令,python位置是否与后面的匹配
which python | fgrep /home/ccpiot/anaconda3/bin/python

3、使用crosstool-ng来制作编译工具链时需要下载多个压缩文件,下不下来会出错
需要的文件下载到/media/ccpiot/cfd852b5-0a53-4e35-8317-4213d7cceef1/projects/petalinux_work/PYNQ/sdbuild/build/gcc-mb/.build/tarballs   路径下,自己手动下载,放到此文件夹下


4、编译过程中,在编译镜像时会下载python 各种包 可能会出现包之间版本冲突,在 PYNQ/sdbuild/packages/python_packages_bionic下的qemu.sh文件,内容如下

export HOME=/root

set -x
set -e


cat > requirements.txt <

6、上边的问题解决,编译接着进行,但是后续编译过程出现以下错误,(没有解决)

 running build_ext
  make PYNQ_BUILD_ARCH=aarch64 -C pynq/lib/_pynq/_displayport/
  make[1]: Entering directory '/tmp/pip-req-build-lgrfpic9/pynq/lib/_pynq/_displayport'
  /usr/lib/ccache/g++ -fPIC -I=/usr/include/libdrm -c -g -std=c++11 displayport.cpp
  displayport.cpp: In member function ‘void pynqvideo::device::enumerate_modes()’:
  displayport.cpp:334:69: warning: narrowing conversion of ‘(uint32_t)mode._drmModeModeInfo::vrefresh’ from ‘uint32_t {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       m_modes.push_back(video_mode{mode.hdisplay, mode.vdisplay, mode.vrefresh});
                                                                  ~~~~~^~~~~~~~
  /usr/lib/ccache/g++ -shared -fPIC -rdynamic displayport.o  -ldrm -o libdisplayport.so
  rm *.o
  make[1]: Leaving directory '/tmp/pip-req-build-lgrfpic9/pynq/lib/_pynq/_displayport'
  copying pynq/lib/_pynq/_displayport/libdisplayport.so -> build/lib/pynq/lib/video
  make PYNQ_BUILD_ARCH=aarch64 -C pynq/lib/_pynq/_xhdmi/
  make[1]: Entering directory '/tmp/pip-req-build-lgrfpic9/pynq/lib/_pynq/_xhdmi'
  make -C .. -f embeddedsw_lib.mk
  make[2]: Entering directory '/tmp/pip-req-build-lgrfpic9/pynq/lib/_pynq'
  make[2]: *** No rule to make target 'embeddedsw', needed by '_xhdmi/libxhdmi.so'.  Stop.
  make[2]: Leaving directory '/tmp/pip-req-build-lgrfpic9/pynq/lib/_pynq'
  Makefile:7: recipe for target 'all' failed
  make[1]: *** [all] Error 2
  make[1]: Leaving directory '/tmp/pip-req-build-lgrfpic9/pynq/lib/_pynq/_xhdmi'
  error: command 'make' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for pynq

你可能感兴趣的:(PYNQ,fpga开发)