本文主要是介绍zynq linux编译,Zynq之petalinux安装和编译,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
先下载petalinux-v2015.4-final-installer-dec.run,去xilinx官网或者我的网盘下载http://pan.baidu.com/s/1gf11UGr
$ mkdir /opt/pkg
$ ./petalinux-v2015.4-final-installer-dec.run /opt/pkg
可以关闭,此用于xilinx统计信息
$ petalinux-util --webtalk off
更改权限所有者
gsc@gsc-250:/opt/pkg$ sudo chown -R gsc:gsc petalinux-v2015.4-final/
可选(前置条件安装git),这样在修改文件源码时,可以记录跟踪信息
gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git init gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git add .gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git commit -m "init add"gsc@gsc-250:/opt/pkg/petalinux-v2015.4-final/components$ git logcommit 0efa3e70d0ba244ff4143f3e024e2bc6c27bb4b9Author: shichaoge Date: Wed Apr 6 14:47:57 2016 +0800 init add 设置环境变量,并echo值如下
gsc@gsc-250:~/zynzq7000/peta_zed$ source /opt/pkg/petalinux-v2015.4-final/settings.sh
gsc@gsc-250:~/zynzq7000/peta_zed$ echo $PETALINUX/opt/pkg/petalinux-v2015.4-final
接下来就是创建工程,工程模板下载地址 http://pan.baidu.com/s/1dF7BAA9 ,基于zedboard
gsc@gsc-250:~/zynzq7000/peta_zed$ petalinux-create -t project -s Avnet-Digilent-ZedBoard-v2015.4-final.bsp
INFO: Create project:
INFO: Projects:
INFO: * Avnet-Digilent-ZedBoard-2015.4
INFO: has been successfully installed to /home/gsc/zynzq7000/peta_zed/
INFO: New project successfully created in /home/gsc/zynzq7000/peta_zed/
配置工程
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$ petalinux-config
INFO: Checking component...
INFO: Config linux
****** hsi v2015.4 (64-bit)
**** SW Build 1412921 on Wed Nov 18 09:44:32 MST 2015
** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.
source /home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/build/linux/hw-description/hw-description.tcl -notrace
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:16 2016...
[INFO ] config linux
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
[INFO ] generate DTS to /home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/subsystems/linux/configs/device-tree
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
WARNING: ps7_ethernet_0: No reset found
WARNING: ps7_usb_0: No reset found
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:31 2016...
[INFO ] generate BSP for zynq_fsbl
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:47 2016...
INFO: Config linux/kernel
[INFO ] oldconfig linux/kernel
INFO: Config linux/rootfs
[INFO ] oldconfig linux/rootfs
INFO: Config linux/u-boot
[INFO ] generate linux/u-boot configuration files
[INFO ] generate linux/u-boot board header files
INFO: [Hsi 55-1698] elapsed time for repository loading 0 seconds
INFO: [Common 17-206] Exiting hsi at Wed Apr 6 14:55:59 2016...
[INFO ] oldconfig linux/u-boot
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$
编译这个工程
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$ petalinux-build
编译的最后几行如下
[INFO ] package rootfs.cpio to /home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux
[INFO ] Update and install vmlinux image
[INFO ] vmlinux linux/kernel
[INFO ] install linux/kernel
[INFO ] package zImage
[INFO ] zImage linux/kernel
[INFO ] install linux/kernel
[INFO ] Package HDF bitstream
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$
生成BOOT.BIN
gsc@gsc-250:~/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4$ petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/download.bit --u-boot --force
INFO: File in BOOT BIN: "/home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux/zynq_fsbl.elf"
INFO: File in BOOT BIN: "/home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux/download.bit"
INFO: File in BOOT BIN: "/home/gsc/zynzq7000/peta_zed/Avnet-Digilent-ZedBoard-2015.4/images/linux/u-boot.elf"
INFO: Generating zynq binary package BOOT.BIN...
INFO: Binary is ready.
镜像目录文件如下
将BOOT.BIN和image.ub拷贝到SD,并从SD卡启动,则有如下信息输出:
到这里基本验证完毕了安装是否正确。
这篇关于zynq linux编译,Zynq之petalinux安装和编译的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!