PetaLinux step-by-step guide.

Other operating systems
Post Reply
Administrator
Site Admin
Posts: 81
Joined: 26-Feb-2014, 17:54

PetaLinux step-by-step guide.

Post by Administrator » 11-Feb-2024, 21:59

0) Download BSP-files, install and configure PetaLinux.
1)
Set Up PetaLinux Working Environment
source ~/PetaLinux/settings.sh
Test: echo $PETALINUX
2) Create project from BSP named: MyLinux.
Change current directory to ~/PetaLinux$
petalinux-create -t project -n MyLinux -s mz7010_fmccc_2020_1.bsp
INFO: Create project: MyLinux
INFO: New project successfully created in /home/mkm/PetaLinux/MyLinux
or
Creating an Empty Project
petalinux-create --type project --template <PLATFORM> --name <PROJECT_NAME>
--template <PLATFORM> - The following platform types are supported:
  • versal (for Versal adaptive SoC)
  • zynqMP (for Zynq UltraScale+ MPSoC)
  • zynq (for Zynq 7000 devices)
  • microblaze (for MicroBlaze processor)
3) Configuring and Building
cd MyLinux
petalinux-config --get-hw-description=./hardware/MZ7010_FMCCC_2020_1

Note: Warning about version! Answer 'y'.
Screenshot_20240211_215756.png
Screenshot_20240211_215756.png (15.48 KiB) Viewed 4747 times
petalinux-config --get-hw-description <PATH-TO-XSA-FILE/DIR>
Ensure DTG Settings > (template) MACHINE_NAME is selected (ZEDBOARD).
.
PetaLinux-qspi-partition.png
PetaLinux-qspi-partition.png (24.56 KiB) Viewed 227 times
PetaLinux QSPI Partition map.

4) Managing Image Size
petalinux-config -c rootfs
and
petalinux-config -c kernel

Note: 2020.1 can halt with error on UART port. Select 'manual' in the Serial settings.

If the kernel or the root file system size increases and is greater than 128 MB, make the following changes in <plnx-proj-root>/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg:
#define CONFIG_SYS_BOOTM_LEN <value greater than image size>
and
Undef CONFIG_SYS_BOOTMAPSZ
PetaLinux-Config-RootFS.png
PetaLinux-Config-RootFS.png (15.3 KiB) Viewed 4418 times
5) Building a System Image
cd MyLinux
petalinux-build


6) Packaging and Booting
Create BOOT.BIN file
petalinux-package --boot --u-boot
PetaLinux-Build-Boot.png
PetaLinux-Build-Boot.png (21 KiB) Viewed 4420 times

Post Reply