1 安装petalinux

使用如下链接在Ubuntu16.04上安装了petalinux-2018.3:

https://blog.csdn.net/qq_37110215/article/details/90250867?spm=1001.2014.3001.5506

在petalinux2018.3安装完成之后,就开始进行配置和编译工作

从其他同事那里拿到了一份hdf文件,使用如下命令创建工程:

petalinux-create --type project --template zynqMP  --name  test_project

cd test_project

petalinux-config --get-hw-description=/home/user/hdf_folder

其中,/home/user/hdf_folder是hdf文件所在的路径,此处只需要提供hdf所在的路径,不需要填写hdf文件名称,petalinux会在该路径中自动搜索hdf文件

执行这条配置命令之后,会弹出配置窗口,直接按下ESC,如果提示是否写入,选择yes

然后执行以下命令,进行编译:

petalinux-build

2. 编译问题:找不到"psu_init.h"文件

然后,遇到如下问题:

| xfsbl_handoff.c:58:10: fatal error: psu_init.h: No such file or directory
|  #include "psu_init.h"
|           ^~~~~~~~~~~~
| compilation terminated.
| make: *** [Makefile:34: xfsbl_handoff.o] Error 1
| WARNING: /home/certusnet/work/test/platform_peta/build/tmp/work/plnx_zynqmp-xilinx-linux/fsbl/2018.3+gitAUTOINC+56f3da2afb-r0/temp/run.do_compile.15749:1 exit 2 from 'make'
| ERROR: Function failed: do_compile (log file is located at /home/certusnet/work/test/platform_peta/build/tmp/work/plnx_zynqmp-xilinx-linux/fsbl/2018.3+gitAUTOINC+56f3da2afb-r0/temp/log.do_compile.15749)
ERROR: Task (/home/certusnet/xilinx/petalinux/2018.3/components/yocto/source/aarch64/layers/meta-xilinx-tools/recipes-bsp/fsbl/fsbl_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3073 tasks of which 2255 didn't need to be rerun                                                                         and 1 failed.

这个问题,通过以下链接成功解决:

https://support.xilinx.com/s/article/71921?language=en_US

其实,就是要为bitbake创建一个bbapend文件:

$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend

找到工程中的以上路径,创建文件:fsbl_%.bbappend

注意:最后的文件名称,就是"fsbl_%.bbappend",不要认为"%"是通配符,自己修改这个文件名称,比如修改成:"fsbl_test.bbappend",这样是错误的,这个文件的名称,必须为:"fsbl_%.bbappend"

该文件的内容:

do_compile_prepend(){

   install -m 0644 ${TOPDIR}/../project-spec/hw-description/psu_init.c ${B}/fsbl/psu_init.c

   install -m 0644 ${TOPDIR}/../project-spec/hw-description/psu_init.h ${B}/fsbl/psu_init.h

}

以上命令,其实就是在编译之前,将${TOPDIR}/../project-spec/hw-description/psu_init.c拷贝到${B}/fsbl/psu_init.c

创建该文件之后,执行以下命令:

petalinux-build -c fsbl -x cleanall

petalinux-build -c fsbl

3. 编译问题:ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64)

继续执行编译命令:petalinux-build

然后,遇到如下问题:

ERROR: petalinux-user-image-1.0-r0 do_rootfs: [log_check] petalinux-user-image: found 1 error message in the logfile:
[log_check] ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

ERROR: petalinux-user-image-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/certusnet/work/xilinx-zc706-2018.3/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/petalinux-user-image/1.0-r0/temp/log.do_rootfs.21087
ERROR: Task (/home/certusnet/work/xilinx-zc706-2018.3/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3061 tasks of which 2246 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/certusnet/work/xilinx-zc706-2018.3/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb:do_rootfs
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project

这个问题,参考了以下链接:

https://blog.csdn.net/wz1hrt08/article/details/114035689?spm=1001.2014.3001.5506

问题的根源还是安装petalinux2018.3之前的依赖库有问题,但是按照这个文档中给出的安装命令,是无法直接安装上这些依赖库的,会与已有依赖库产生冲突,所以修改之后,利用命令aptitude,该命令能够自动解决依赖和冲突的问题,使用如下命令安装:

sudo aptitude install -y python tofrodos iproute2 gawk xvfb gcc git net-tools libncurses5-dev tftpd 3. zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential libsdl1.2-dev libglib2.0-dev

安装完成之后,继续使用编译命令:petalinux-build

最后,编译成功:
INFO: Copying Images from deploy to images
INFO: Creating images/linux directory
[INFO] successfully built project

GitHub 加速计划 / li / linux-dash
12
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐