petalinux-config:系统级别的 menuconfig。后续不断完善petalinux系统的命令
一,uboot
1,以fsbl/fs-boot为例生成源码
petalinux-config -c bootloader
2,
# 以内核为例
petalinux-config -c kernel --defconfig xilinx_zynq_base_trd_defconfig
# 以 uboot 为例
petalinux-config -c u-boot --defconfig xilinx_zynqmp_zcu102_defconfig
二,内核
1,Parse the configuration onto Kconfig 没有opening the GUI配置组件(--oldconfig), for the root filesystem(-c rootfs):
petalinux-config -c rootfs --oldconfig
这样的配置文件需要存在于kernel或者uboot的源码树中,不能额外指定外部文件。
否则会报错:ERROR: linux-xlnx-4.14-xilinx-v2018.3+gitAUTOINC+eeab73d120-r0 do_kernel_metadata: A KBUILD_DEFCONFIG 'xxx' was specified, but not present in the source tree
2,强制构建内核:
petalinux-build -c kernel -f
3,强制编译内核
petalinux-build -c u-boot -x cleansstate
三,设备树
四,根文件
五,petalinux-build
1,清理/删除build目录,保留images目录
petalinux-build -x distclean
## 慎用
petalinux-build -x mrproper
2,build整个工程
petalinux-build -c all
3,创建一个更新的FIT image,package-产生image.ub
petalinux-build -x package
4,清除所有U-Boot组件相关的
petalinux-build -c u-boot -x clean
六,打包:
petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga --u-boot --force
七,烧录:
1,下载并生成比特流(以及适用于Zynq-7000或Zynq UltraScale的FSBL+MPSoC)通过JTAG下载:
petalinux-boot --jtag --prebuilt 1
2,通过JTAG下载并SDK生成建的U-boot elf到板子:petalinux-boot --jtag --prebuilt 2
3,通过JTAG下载并引导预构建的内核图像到板子:petalinux-boot --jtag --prebuilt 3
对于Zynq-7000,下载:
bitstream pre-built/linux/implementation/download.bit
fsbl pre-built/linux/images/zynq_fsbl.elf
DTB pre-built/linux/images/system.dtb
kernel pre-built/linux/images/zImage
对于Zynq UltraScale+ MPSoC下载:
bitstream pre-built/linux/implementation/download.bit
fsbl pre-built/linux/images/zynqmp_fsbl.elf
kernel pre-built/linux/images/Image
DTB pre-built/linux/images/system.dtb
ATF pre-built/linux/images/bl31.elf
pmufw pre-built/linux/images/pmufw.elf)
4,通过JTAG下载U-boot映像到板子:petalinux-boot --jtag --u-boot
对于Zynq-7000,下载:
fsbl images/linux/zynq_fsbl.elf
U-Boot images/linux/u-boot.elf.
对于Zynq UltraScale+ MPSoC下载:
fsbl images/linux/zynqmp_fsbl.elf
U-Boot images/linux/u-boot.elf
ATF images/linux/bl31.elf
pmufw images/linux/pmufw.elf
5,通过JTAG下载内核到板子:petalinux-boot --jtag --kernel
For Zynq-7000, it boots:
- fsbl images/linux/zynq_fsbl.elf
- DTB images/linux/system.dtb
- kernel images/linux/zImage
For Zynq UltraScale+ MPSoC, it boots:
- fsbl images/linux/zynqmp_fsbl.elf
- kernel images/linux/Image
- DTB images/linux/system.dtb
- ATF images/linux/bl31.elf
- pmufw images/linux/pmufw.elf