petalinux

一、配置petal inux运行环境
1、 source settings.sh
2、 PATH
二、petalinux设计流程介绍
1、搭建vivado.工程,导出hdf文件
2、创建一个petalinux工程
3、需要将hdf文件导入到petalinux.工程(将vivado设 计应用到petalinux工程)
4、配置petalinux.工程(其中就包括配置内核、配置U-Boot以及根文件系统)
5、编译petalinux.工程(U-Boot镜像、 内核镜像以及rootfs,bitstream, fsbl镜像文件)
6、启动开发板.
三、petalinux使用实战
petalinux-boot 启动开发板
petalinux-build 编译
petalinux-config 配置
petalinux-create 创建项目
petalinux-package 打包
petalinux-util 没用过、不知道干嘛的
注意:每个命令的查询与帮助 eg:petalinux-config --help

1)、导入hdf 文件:
petalinux-config --get-hw-description ~ /hdf/Navigator_ 7020.sdk (路径)
导入hdf文件后,就会打开配置界面
2)、单独打开petalinux工程的配置界面:
petalinux-config
u-boot配置:
petalinux-config -C u-boot
Linux内 核配置:
petalinux-config -C kernel
rootfs (根文件系统)配置:
petalinux-config -C rootfs
3)、 编译:

  1. 编译整个petalinux工程(U-boot、 kernel和设备树、rootfs、 fsbl、 bit文件)
    petalinux-build
  2. 单独编译U-boot、kernel、 rootfs
    petalinux-build -C u-boot #编译U-boot
    petalinux-build -C kernel #编译内核
    petalinux-build -C rootfs #编译根文件系统rootfs
    四、创建功能模块或者APP
    EXAMPLES:
Create project from PetaLinux Project BSP:
  $ petalinux-create -t project -s <PATH_TO_PETALINUX_PROJECT_BSP>

Create project from template:
For microblaze project,
  $ petalinux-create -t project -n <PROJECT> --template microblaze
For zynq project,
  $ petalinux-create -t project -n <PROJECT> --template zynq
For zynqMP project,
  $ petalinux-create -t project -n <PROJECT> --template zynqMP
For versal project,
  $ petalinux-create -t project -n <PROJECT> --template versal


Create an app and enable it:
  $ petalinux-create -t apps -n myapp --enable
The application "myapp" will be created with c template in:
  <PROJECT>/project-spec/meta-user/recipes-apps/myapp


Create an module and enable it:
  $ petalinux-create -t modules -n mymodule --enable
The module "mymodule" will be created with template in:
  <PROJECT>/project-spec/meta-user/recipes-modules/mymodule