1、配置环境变量
source /opt/petalinux/setting.sh
其中/opt/petalinux/setting.sh 为petalinux的安装路径
2、新建工程
对于Zynq UltraScale+MPSoc 系列,命令如下
petalinux-creat -t project -n <PROJECT_NAME> --template zynqMP
3、导入硬件描述文件
首先cd <PROJECT_NAME>
然后执行(其中path-to-dirextory 为.xsa 文件所在的路径)
petalinux-config --get-hw-description=<path-to-dirextory>
4、进行内核配置
petalinux-config -c kernel
在内核配置中基本保持默认配置,重点关注自己需要的驱动
5、配置跟文件系统
配置完成后记得保存退出
petalinux-config -c rootfs
6、编译系统镜像
petalinux-build
7、生成uImag
petalinux-package --image -c kernel --format uImage
8、生成启动镜像
petalinux-package --boot --format BIN --fsbl image/linux/zynqmp_fsb1.elf --u-boot images/linux/u-boot.elf --pmufw image/linux/pmufw.elf --fpga image /linux/*.bit