moerjielovecookie

Sawen_Blog

一个普通工科牲的博客网站
x
github
follow
email

Petalinux

Petalinux 命令#

image
參考《UG 1157 PetaLinux 命令行參考指南》

//創建petalinux工程
petalinux-create -t project --template zynq -n <name> 

//配置工程
cd 上一步的工程
petalinux-config --get-hw-description ../xsa_folder/

//配置Linux內核
petalinux-config -c kernel

//配置Linux根文件系統
petalinux-config -c rootfs

//編譯
petalinux-build

//製作BOOT.Bin
petalinux-package --boot --fsbl --fpga --u-boot --force

//掛載NFS
mount -t nfs -o nolock 192.168.0.1:/home/moerjie/work /mnt

Petalinux 設置本地編譯#

Xilinx 下載中心
首先在下載中心下載 petalinux 對應版本的 "arm sstate-cache" 和 "download" 包。
image
image
將下載好的文件解壓到 /opt/pkg/tools/ 文件路徑下,使用 petalinux-config 配置工程。配置過程可見《領航者 ZYNQ 之嵌入式 Linux 開發指南 V 3.2》6.4 節。

與正點原子教程不同的地方#

正點原子的修改 project-spec/meta-user/conf/petalinuxbsp. Conf 的代碼如下:

PREMIRRORS_prepend = " \
git://.*/.* file:///mnt/hgfs/share18/downloads/downloads \n \
gitsm://.*/.* file:///mnt/hgfs/share18/downloads/downloads \n \
ftp://.*/.* file:///mnt/hgfs/share18/downloads/downloads \n \
http://.*/.* file:///mnt/hgfs/share18/downloads/downloads \n \
https://.*/.* file:///mnt/hgfs/share18/downloads/downloads \n"

但是 2023.2 版本的 petalinux 不支持這個語法,需改為:

PERMIRRORS:prepend = "\
git://.*/.* file:///opt/downloads/downloads \n \
gitsm://.*/.* file:///opt/downloads/downloads \n \
ftp://.*/.* file:///opt/downloads/downloads \n \
http://.*/.* file:///opt/downloads/downloads \n \
https://.*/.* file:///opt/downloads/downloads \n"
pre-mirror: file:///opt/downloads/downloads
sstate: /opt/sstate/arm/
載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。