petalinux快速开始
搭建环境
- 查看文档:ug1144-petalinux-tools-reference-guide201901.pdf
- 下载有关PetaLinux源码和工具:https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
- Open Components Source Code (TAR/GZIP - 6.25 GB)
- Installer (TAR/GZIP - 7.14 GB):
- apt-get install 必须得软件
- ug1144-petalinux-tools-reference-guide201901.pdf的"Quick Installation of Packages"这一节会用到
- 执行命令: “./petalinux-v2019.1-final-installer.run /opt/pkg/petalinux/2019.1” 安装PetaLinux Tools到/opt/pkg/petalinux/2019.1目录下
出现错误:/tmp/tmp.rlFbcgKOQZ/petalinux-env-check: No such file or directory。
执行:sudo apt install gawk
- BSP( board support packages)
- BSP是别人已经打包好了的工程(针对某一个板子),已经包含了配置、源码、环境、还有一些FPGA的输出文件等。
- 有很多个版本可以下载,不知道需要安装哪个?
创建工程
-
petalinux-create -t project -s
-
petalinux-config --get-hw-description= 需要一个.hdf的文件,用Eclipse IDE生成
-
配置petalinux-config --get-hw-description=
-
petainux-config
- petalinux-config -c kernel
- petalinux-config -c u-boot
- petalinux-config -c rootfs
-
petalinux-build:编译生成PetaLinux System Image。[17:03 - ]
- 会生成device tree DTB file,first stage bootloader (if selected), U-Boot, the Linux kernel, and a root filesystem image
- 会cp images/linux/* /tftpboot
-
petalinux-package --prebuilt --fpga ,这一步是启动虚拟机qemu的必要步骤。
- petalinux-package --prebuilt --fpga images/linux/system.bit
-
petalinux-boot --qemu --prebuilt 3
启动qemu虚拟机运行编译的linux -
petalinux-package --boot --format BIN --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --u-boot --force
- 生成BOOT.BIN,用作SD卡启动