petalinux常用命令

配置环境变量启动petalinux

source /home/userroot/os/petalinux/settings.sh

基于bsp文件创建

petalinux-create -t project -s xilinx-zc706-v2017.4-final.bsp -n myproject

从零开始创建项目

petalinux-create -t project --template zynq  -n myproject

使用SDK中导出的HDF文件更新项目配置,一共三种方法

//1、在项目根目录下用HDF文件更新
cd <path of project>
petalinux-config --get-hw-description=<path of hdf>
//2、在HDF所在目录更新项目配置
cd <path of hdf>
petalinux-config --get-hw-description -p <path of project> (--oldconfig)
//3、在任意路径下操作
petalinux-config --get-hw-discription <path of hdf> -p <path of project>

系统配置

//全局配置
petalinux-config

//kernel配置
petalinux-config -c kernel
//保存kernel.config文件

//u-boot配置
petalinux-config -c u-boot
//保存u-boot.config文件

//文件系统配置
petalinux-config -c rootfs
//默认保存config文件

编译系统

//全局编译
petalinux-build

//u-boot编译
petalinux-build -c u-boot

//kernel编译
petalinux-build -c kernel

//文件系统编译
petalinux-build -c rootfs

制作boot.bin文件

petalinux-package --boot --fsbl zynq_fsbl.elf --fpga dma_demo.bit --u-boot u-boot.elf

QEMU模拟运行

petalinux-boot --qemu --u-boot 
petalinux-boot --qemu --kernel 

JTAG运行

//加载bitstream/fsbl
petalinux-boot --jtag --prebuilt 1
//加载u-boot
petalinux-boot --jtag --prebuilt 2
//加载kernel
petalinux-boot --jtag --prebuilt 3

petalinux-boot --jtag --u-boot
petalinux-boot --jtag --kernel

编辑,更新devicetree

petalinux-build -c device-tree -x cleanall
petalinux-build -c device-tree

重新生成image.ub

petalinux-build -x package

烧写flash程序

export PATH=$PATH:/home/userroot/os/petalinux/tools/hsm/bin/

hw_server &

//我这里是nand flash,所以flash_type选择nand_8

program_flash -f BOOT.BIN -fsbl zynq_fsbl.elf -flash_type nand_8 -blank_check -verify -cable type xilinx_tcf url tcp:localhost:3121

program_flash -f image.ub -offset 0xF20000 -fsbl zynq_fsbl.elf -flash_type nand_8 -blank_check -verify -cable type xilinx_tcf url tcp:localhost:3121

JTAG启动

petalinux-boot --jtag --bitstream BOOT.BIN --u-boot
petalinux-boot --jtag --bitstream image.ub --kernel

创建APP

petalinux-create -t apps --name myapp --enable

//指定使用语言
petalinux-create -t apps --template c++ --name myapp --enable
petalinux-create -t modules --name mymodule --enable

编译、安装APP

petalinux-build -c myapp -x clean
petalinux-build -c myapp -x install
petalinux-build -c myapp -x build

打包bsp

petalinux-package --bsp -p <plnx-proj-root> --output my.bsp

猜你喜欢

转载自blog.csdn.net/u013445609/article/details/82465058
今日推荐