Xilinx Petalinux scripts for building, deploying, debugging etc..
This following cheat-sheet includes common commands used in PetaLinux based projects.
chmod 755 ./petalinux-v2022.2-final-installer.run
sudo chmod 755 ./petalinux-v2022.2-final-installer.run
./petalinux-v2022.2-final-installer.run --dir ~/../petalinux/2022.2/
source ../../../../petalinux/2022.2/settings.sh
petalinux-package --boot --u-boot ./images/linux/u-boot.elf
petalinux-package --boot --fsbl zynqmp_fsbl.elf --pmufw pmufw.elf --atf bl31.elf --u-boot u-boot.elf
petalinux-config --get-hw-description=/../zc102_demo_wrapper.xsa
petalinux-build -x package
petalinux-build -c kernel
petalinux-build -x mrproper
petalinux-config -c rootfs
petalinux-config -c uboot
petalinux-create -t project -s ../xilinx-zcu102-v2022.2-10141622.bsp
dd bs=8192 status=progress if=~/../rootfs.ext4 of=/dev/sdc2
fsck /dev/sde2
minicom -D /dev/ttyUSBX -b 115200
dtc -I dtb -O dts system.dtb -o /tmp/tmp.dts
the_ROM_image:
{
[bootloader, destination_cpu=a53-0] zynqmp_fsbl.elf
[pmufw_image] pmufw.elf
[destination_device=pl] pre-built/linux/implementation/download.bit
[destination_cpu=a53-0, exception_level=el-3, trustzone] bl31.elf
[destination_cpu=a53-0, load=0x00100000] system.dtb
[destination_cpu=a53-0, exception_level=el-2] u-boot.elf
}
petalinux-boot --jtag --u-boot --fpga --bitstream system.bit
> pxe get
> pxe boot
Make sure the TFTP server is up and the images are located in /srv/tfpboot
directory.
# Initialize SPI flash
sf probe 0 0 0
# Erase SPI flash (for a 128MiB flash size)
sf erase 0 0x8000000
# Write BOOT.BIN into Flash
tfpboot 0x80000 BOOT.BIN
sf write 0x80000 0x0 <0xfile_size>
# Write image.ub into Flash
tfpboot 0x80000 image.ub
sf write 0x80000 <0ximage_flash_address> <0xfile_size>
# Write boot.scr into Flash
tfpboot 0x80000 boot.scr
sf write 0x80000 <0xboot_scr_flash_address> <0xfile_size>
# Reset board in QSPI mode
# Set environment variables
setenv bootargs console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait
# Load the image from QSPI flash into memory
sf probe 0; sf read ${loadaddr} 0x100000 0x800000
# Boot the image
bootm ${loadaddr}
mkimage -C none -A arm -T script -d boot.txt boot.scr