PetaLinux Build Guide for Ultra96-V2 Avnet out of box BSP 2021.1

System Requirements
Host OS: Ubuntu 18:04 LTS
CPU: 4 core or more recommended
RAM: Minimum 8GB
Storage: 30GB or more
Internet Connection
Download Required Files
Download petalinux 2021.1 installer
https://www.xilinx.com/member/forms/download/xef.html?filename=petalinux-v2021.1-final-installer.run
Download Avnet out of box BSP 2021.1
Prepare ubuntu build environment.
Install dependent packages
sudo apt-get install gawk xvfb chrpath socat autoconf libtool git texinfo zlib1g-dev gcc-multilib libsdl1.2-dev libglib2.0-dev
Install Library
sudo apt-get install libncurses5-dev libncursesw5-dev libssl-dev zlib1g:i386
Install PetaLinux SDK
Run the installer:
./petalinux-v2021.1-final-installer.run -d <install-directory-of-choice>/peta
Accept License Agreements when prompted.
Done!
/home/jimmy/software/avnet/2021.1/petalinux-v2021.1-final-installer.run -d peta INFO: Checking installation environment requirements... INFO: Checking free disk space INFO: Checking installed tools INFO: Checking installed development libraries INFO: Checking network and other services INFO: Checking installer checksum... INFO: Extracting PetaLinux installer... LICENSE AGREEMENTS PetaLinux SDK contains software from a number of sources. Please review the following licenses and indicate your acceptance of each to continue. You do not have to accept the licenses, however if you do not then you may not use PetaLinux SDK. Use PgUp/PgDn to navigate the license viewer, and press 'q' to close Press Enter to display the license agreements Do you accept Xilinx End User License Agreement? [y/N] > Do you accept Xilinx End User License Agreement? [y/N] > y Do you accept Webtalk Terms and Conditions? [y/N] > y Do you accept Third Party End User License Agreement? [y/N] > y INFO: Installing PetaLinux... INFO: Checking PetaLinux installer integrity... INFO: Installing PetaLinux SDK to "/home/jimmy/petalinux/2021.1.1/peta/." INFO: Installing buildtools in /home/jimmy/petalinux/2021.1.1/peta/./components/yocto/buildtools INFO: Installing buildtools-extended in /home/jimmy/petalinux/2021.1.1/peta/./components/yocto/buildtools_extended INFO: PetaLinux SDK has been installed to /home/jimmy/petalinux/2021.1/peta/. |
Build The PetaLinux Distribution
Create a new project
Setup PetaLinux Environment
cd ~petalinux-install-directory
source peta/settings.sh
source peta/settings.sh PetaLinux environment set to '/home/jimmy/petalinux/2021.1/peta' INFO: Checking free disk space INFO: Checking installed tools INFO: Checking installed development libraries INFO: Checking network and other services |
Create Project from Ultra96 BSP
petalinux-create -t project -s <path-to>/u96v2_sbc_base_2021_1.bsp
petalinux-create -t project -s /home/jimmy/software/avnet/2021.1/u96v2_sbc_base_2021_1.bsp INFO: Create project: INFO: Projects: INFO: * u96v2_sbc_base_2021_1 INFO: Has been successfully installed to /home/jimmy/petalinux/2021.1/ INFO: New project successfully created in /home/jimmy/petalinux/2021.1/ |
Start the Build
cd u96v2_sbc_base_2021_1
petalinux-build -c avnet-image-full
petalinux-build -c avnet-image-full [INFO] Sourcing buildtools [INFO] Building avnet-image-full [INFO] Sourcing build environment [INFO] Generating workspace directory INFO: bitbake avnet-image-full NOTE: Started PRServer with DBfile: /home/jimmy/petalinux/2021.1.1/u96v2_sbc_base_2021_1/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 37903, PID: 31211 Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:01 Loaded 5139 entries from dependency cache. Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:01 Parsing of 3514 .bb files complete (3504 cached, 10 parsed). 5149 targets, 227 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:18 Checking sstate mirror object availability: 100% |###########################################################################################################################################| Time: 0:00:16 Sstate summary: Wanted 665 Found 164 Missed 501 Current 4018 (24% match, 89% complete) NOTE: Executing Tasks NOTE: Tasks Summary: Attempted 12776 tasks of which 12356 didn't need to be rerun and all succeeded. INFO: Successfully copied built images to tftp dir: /tftpboot [INFO] Successfully built avnet-image-full |
Create BOOT.BIN
petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --fpga images/linux/system.bit --pmufw images/linux/pmufw.elf --u-boot
Flash micro-SD Card
**All files required for this step will be present at /images/linux/ once the build is completed**
1st method. Flash ultra96-V2 Factory image. please Download following instruction
Write the Ultra96-V2 Factory Image to microSD Card
2nd method. Format the SD Card with the following layout. To do this you can use tools such as fdisk, GParted, gnome-disks etc.
Partition 1:
Format: FAT32
Size: 1GB
Label: boot
Partition 2:
Format: ext4
Size: 7GB or more
Label: rootfs
Copy Boot files
cd ~/project-dir//images/linux/
cp BOOT.BIN <mount-point-for-boot>
cp image.ub <mount-point-for-boot>
cp boot.scr <mount-point-for-boot>
Flash rootfs Partition
1st method
sudo tar -xf rootfs.tar.gz -C /media/rootfs/
sync
2nd method
sudo dd if=rootfs.ext4 of=/dev/sdX2
sync