作者:硬码农二毛哥,本文转载自:<span id="profileBt"><a href="https://mp.weixin.qq.com/s/YbgvoG2W9SeJIR0RrDSKGA">硬码农二毛哥微信公众号</a></spa…;
<strong>1. 硬件平台构建</strong>
FZU3资料中有vivdo工程可以直接使用,顶层如下图所示。
<center><img src="http://xilinx.eetrend.com/files/2021-08/%E5%8D%9A%E5%AE%A2/100552250-21…; alt=""></center>
<strong>2. Petalinux构建软件系统</strong>
1. 导出硬件平台aa.dsa文件;
2. 创建Petalinux工程
petalinux-create--type project --template zynqMP –name <PROJECT_NAME>
<strong> 3. 导入硬件配置</strong>
petalinux-config--get-hw-description= <aa.dsa所在目录名>
path-to-directory-containinghardware description-file为aa.dsa目录
这步运行完,不做配置,退出。
<strong> 4. 设置</strong>
运行petalinux-config
进入配置界面:
在DTG Settings中设置Kernel Bootargs:
earlycon clk_ignore_unused earlyprintkroot=/dev/mmcblk1p2 rootwait cma=1024M
在ImagePackaging Configuration中设置:
Device node of SD device :/dev/mmcblk1p2
以上设置非常重要,如果配置不对系统不能正常启动。
配置SD卡ext文件系统启动:
在Rootfilesystem type中选择EXT
<strong>5. 构建系统镜像</strong>
petalinux-build
<strong>6. 生成启动镜像</strong>
petalinux-package--boot --format BIN --fsbl images/linux/zynqmp_fsbl.elf --u-boot
images/linux/u-boot.elf --pmufwimages/linux/pmufw.elf --fpga images/linux/*.bit --force
<strong> 7. 利用sd卡启动petalinux镜像</strong>
将sd进行分区,两个分区被安装到/media/BOOT 和 /media/rootfs
将 BOOT.BIN 和 image.ub 拷贝至 SD 卡的 BOOT 分区:
cpimages/linux/BOOT.BIN /media/BOOT/
cpimages/linux/image.ub /media/BOOT/
将rootfs.tar.gz 文件拷贝至 SD 卡的 RootFS 分区并提取文件系统
sudotar xvf rootfs.tar.gz -C /media/rootfs
<strong> 3 测试</strong>
以上部分完成硬件平台构建和软件系统构建,下一步可以将sd卡插入单板进行测试了。