前提: petalinux开发环境安装好:
1) source命令加载成功,可利用echo $PETALINUX验证。
2) 检查统计信息是否关闭
petalinux-util --webtalk off
INFO: Turn off webtalk feature!
一、建立工程
1) 根据BSP包建立工程
在当前工程路径下有xilinx-zc706-v2016.4-final1.bsp,指定工程名为zc706
petalinux-create -t project -s xilinx-zc706-v2016.4-final1.bsp -n zc706
2) 自定义建立工程
此时需要考虑结合自己的hdf文件建立工程,有各种办法
petalinux-create -t project --template zynq -n zc706
cd <plnx-proj-root>
petalinux-config --get-hw-desription=<path of hdf file>
二、工程内的各种配置操作
切换到Petalinux工程根目录。
cd <plnx-proj-root>
登录系统顶层配置菜单,设定你想要配置。
petalinux-config
登录Linux内核配置菜单并配置
petalinux-config -c kernel
登录根文件系统配置菜单并配置
petalinux-config -c rootfs
三、编译与仿真工程
具体编译
petalinux-build -c appname -x clean
petalinux-build -c appname -x install
petalinux-build -c appname -x build
整体编译
petalinux-build
制作Bin文件
petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/system_top.bit --u-boot --force
打包
petalinux-package --prebuilt --fpga ./images/linux/system_top.bit --force
仿真
QEMU中调试Linux内核
petalinux-boot --qemu --prebuilt 3
#模拟运行u-boot,kernel,看看是不是正确
petalinux-boot --qemu --u-boot
petalinux-boot --qemu --kernel