This is a step-by-step guide to setting up and running Kuiper Linux on the ZCU102 FPGA board, helping developers configure, deploy, and troubleshoot Linux on Zynq UltraScale+ MPSoC devices. It covers building the Linux kernel and device tree from the source, enabling users to understand the boot process, customize the kernel, and resolve common issues. The guide ensures proper hardware integration and system optimization for specific applications. Developers can efficiently set up Linux and enhance their FPGA-based projects following these steps. This resource is valuable for beginners and experienced engineers working with Zynq UltraScale+ MPSoC.
Step-By-Step Guide: Building ZynqPM/MPSoC Linux Kernel and Device Tree from Source
Step # 1: Building ZynqPM/MPSoC Linux Kernel
Let’s dive in and get started.
1. Clone the local ADI’s kernel tree or download the Linux tree:
git clone https://github.com/analogdevicesinc/linux.git
2. Checkout the Master Branch:
git checkout master
3. Ensure you are on the master branch:
Already on 'master'
Your branch is up-to-date with 'origin/master'.
4. Add aarch64-linux-gnu-gcc to PATH:
export PATH=$PATH:/tools/Xilinx/Vitis/2021.2/gnu/aarch64/lin/aarch64-Linux/bin
Step# 2: Using the Linaro Toolchain
1. Download the latest Linaro toolchain GCC from:
https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/
2. Installation Steps:
uname -a # Check your system architecture
tar -xvf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar
cd gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu
vim ~/.bashrc
3. Add the following line at the end of .bashrc:
export PATH=$PATH:/home/xee/Downloads/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin
4. Save and apply the changes:
source ~/.bashrc
Step # 3: After Installation
1. Build the kernel:
cd linux
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make distclean
make adi_zynqmp_defconfig
make -j5 Image UIMAGE_LOADADDR=0x8000
The image file will be generated at linux/arch/arm64/boot.
Step # 4: Building the Device Tree from Source
1. Navigate to the Linux directory:
cd linux/arch/arm64/boot/dts/Xilinx
2. Locate your device tree file and copy the name.
3. Build the device tree:
cd linux
make xilinx/ zynqmp-zcu102-rev10-adrv9002.dtb
mv zynqmp-zcu102-rev10-adrv9002.dtb system.dtb
Step # 5: Building U-Boot
1. Clone the Xilinx U-Boot repository:
git clone https://github.com/Xilinx/u-boot-xlnx.git
2. Navigate to the U-Boot directory:
cd u-boot-xlnx/
export ARCH=aarch64
export CROSS_COMPILE=aarch64-linux-gnu-
make distclean
make xilinx_zynqmp_virt_defconfig
export DEVICE_TREE="zynqmp-zcu102-rev1.0"
make
The u-boot.elf file will be created.
Note: This step is essential, you can use the default u-boot.elf from default zcu102 image file
Step # 6: Building the ZynqMP Boot Image (BOOT.BIN)
Required Files:
- system_top.xsa (Generated after bitstream export)
- u-boot.elf (Use the U-Boot from default SD-card works perfectly or can use the built one but this one may create problem sometimes)
- build_zynqmp_boot_bin.sh (Available online on AMD site)
- Image
- system.dtb
Steps:
- Place all required files in the same directory.
- Run the following commands:
source /tools/Xilinx/Vivado/2021.2/settings.sh
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu
chmod +x build_zynqmp_boot_bin.sh
./build_zynqmp_boot_bin.sh system_top.xsa u-boot.elf download output-archive
Step # 7: SD Card Setup
- Use a 16GB SD card.
- Format it using SD Card Formatter software.
- Burn the default ADI image onto the SD card using Win32DiskImager.
- Delete all files from the boot partition.
- Copy BOOT.BIN, Image, and system.dtb to the SD card.
- The SD card is now ready for mounting on adrv9002_zcu102.
Step # 8: Mounting and Booting from SD Card on adrv9002_zcu102
- Insert the SD card into the board.
- If Display Does Not Work
Option 1: Edit Xorg Configuration
1. Run the following command:
printf "Section \"Device\"\n Identifier \"myfb\"\n Driver \"fbdev\"\n Option \"fbdev\" \"/dev/fb0\"\nEndSection\n" > /etc/X11/xorg.conf
2. Verify:
cat /etc/X11/xorg.conf
3. Reboot:
reboot
Figure 1: ZCU102 ADI-Kuiper-Linux Display via HDMI
Success! You Did It!
Congratulations! Following this guide, you have successfully set up and run Kuiper Linux on the ZCU102 FPGA board, including kernel compilation, SD card setup, and driver configuration. As you can see, the process wasn’t as complicated as it might have seemed at first. You have a working Linux system on your FPGA, ready for further customization and development. Enjoy running Linux on your FPGA system!
Read more: The complete "Technology for eXtreme Optimization and Real-Time" blog series.