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
————————————————
版权声明:本文为优快云博主「u013445609」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/u013445609/article/details/82465058

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值