FPGA zynq ultrascale petalinux

详细的安装步骤参考:petalinux安装步骤

编译petalinux

运行环境

source ~/petalinux/settings.sh

创建项目

petalinux-create -t project --template zynqMP --name h1_petalinux_test

导入硬件配置

cp XXX.hdf h1_petalinux_test/
cd h1_petalinux_test
petalinux-config --get-hw-description=.

配置和编译

petalinux-config -c kernel
petalinux-config -c u-boot   
petalinux-config -c rootfs
petalinux-build  //编译

生成BOOT.BIN

cd image/linux
petalinux-package --boot --format BIN --fsbl zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga *.bit --force

添加驱动模块

在文件系统中添加编译好的app

petalinux-create -t apps --template install --name myapp --enable
cd project-spec/meta-user/recipes-apps/myapp/files/
rm myapp
cp /XXX/myapp myapp // myapp 为应用程序的可执行文件
petalinux-build

可在/usr/bin下看到自己的应用程序(板卡运行)

板卡运行

cd image/linux/

拷贝BOOT.BIN image.ub 到SD卡中

应用程序编译

/home/ubuntu1604/petalinux/tools/linux-i386/aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc

petalinux 自动登录

petalinux-config
Select Yocto-settings > Enable debug-tweaks
Save the configuration and exit
petalinux-build

应用程序自启动

petalinux-create -t apps --template install -n myapp-init --enable
cd project-spec/meta-user/recipes-apps/myapp-init/

修改 myapp-init.bb文件

#
# This file is the myapp-init recipe.
#
SUMMARY = "Simple myapp-init application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://myapp-init \
 "
S = "${WORKDIR}"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
inherit update-rc.d
INITSCRIPT_NAME = "myapp-init"
INITSCRIPT_PARAMS = "start 99 S ."
do_install() {
 install -d ${D}${sysconfdir}/init.d
 install -m 0755 ${S}/myapp-init ${D}${sysconfdir}/init.d/myapp-init
}
FILES_${PN} += "${sysconfdir}/*"
cd files

修改文件 myapp-init

/usr/bin/myapp

文章参考:ug1144-petalinux-tools-reference-guide.pdf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值