0% found this document useful (1 vote)
364 views5 pages

Building Ubuntu For Ultra-96 FPGA

This document provides instructions for building an Ubuntu root filesystem for the Ultra-96 FPGA board using PetaLinux. It describes downloading an Ubuntu rootfs tarball, copying it to an SD card, configuring it using chroot, and modifying the PetaLinux project to use the new rootfs. Additional packages like X11 and drivers can be installed before building a bootable SD card image with PetaLinux that provides the full Ubuntu environment and development tools on the Ultra-96 board.

Uploaded by

ksajj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
364 views5 pages

Building Ubuntu For Ultra-96 FPGA

This document provides instructions for building an Ubuntu root filesystem for the Ultra-96 FPGA board using PetaLinux. It describes downloading an Ubuntu rootfs tarball, copying it to an SD card, configuring it using chroot, and modifying the PetaLinux project to use the new rootfs. Additional packages like X11 and drivers can be installed before building a bootable SD card image with PetaLinux that provides the full Ubuntu environment and development tools on the Ultra-96 board.

Uploaded by

ksajj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Building Ubuntu for Ultra-96 FPGA

Introduction
The standard PetaLinux setup comes with a limited set of tools and often in order to debug or
modify applications, complete system build is required. Making the development process
painstakingly slow and error-prone. So in this tutorial, we will learn how to build Ubuntu rootfs
for Ultra-96 board such that all the standard Linux development tools are available. Allowing us
to build applications on board as well as sophisticated driver and application set from Ubuntu for
our FPGA.

Before starting, you should complete the following:

1. Set up your shell environment with PetaLinux tools in your PATH environment variable.
2. Create and cd into a working directory.
3. Create a new PetaLinux project targeting a BSP that corresponds to the type of board you
are targeting:

petalinux-create –t project -n < project_name > -s <path_to_base_BSP>

4. Obtain a copy of the hardware handoff file (.hdf) from the Vivado project for your hardware
platform.
5. Install Qemu for cross compiling

apt-get install qemu-user-static

Building the PetaLinux Image

1. Download Ubuntu rootfs:

For Ubuntu 16.04

wget http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-
16.04.3-base-arm64.tar.gz

OR For Ubuntu 18.04


wget http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-
18.04.1-base-arm64.tar.gz

2. Copy ubuntu rootfs to SD Card:

sudo tar xfvp ./ubuntu-base-16.04.3-base-arm64.tar.gz -C /media/<USER>/rootfs/

3. Well use chroot to further setup our filesystem.

sudo cp -av /usr/bin/qemu-aarch64-static /media/<USER>/rootfs/usr/bin

4. Then we need to copy resolv.conf from our host machine for internet connection to
/media/<USER>/rootfs/etc/:

# If your host is Ubuntu 17.10


sudo cp -av /run/systemd/resolve/stub-resolv.conf /media/<USER>/rootfs/etc/resolv.conf

# For Ubuntu 16.04.3 below


sudo cp -av /run/resolvconf/resolv.conf /media/<USER>/rootfs/etc/resolv.conf

5. Enter chroot environment:

sudo chroot /media/<USER>/rootfs/

6. Now that you’re in the chroot environment, we can now add an admin user with sudo
permission.

useradd -G sudo -m -s /bin/bash u96


echo u96:u96 | chpasswd

7. Change root password with these command:

passwd root

8. Fetch the latest package lists from server then upgrade:

apt-get update
apt-get upgrade
apt-get -y install sudo
apt-get -y install kmod

9. Fix the terminal endpoint difference between zynq and ubuntu:


ln -s /lib/systemd/system/[email protected]
/etc/systemd/system/getty.target.wants/[email protected]

10. Exit from chroot

exit

11. Configure PetaLinux with the HDF derived earlier for the associated platform:

petalinux-config -p < petalinux_project > --get-hw-description= <HDF path>

● Set the Boot-args to be same as in device-tree (DTG Settings → Kernel Bootargs


→ Auto generated bootargs):
Turn off auto generation

console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio


clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait sdhci.debug_quirks=64
cpuidle.off=1

● Set uboot to load from SD Card: Image Packaging Configuration > Root
filesystem type > SD Card
● Exit and Save configuration

12. Go into project directory and build the PetaLinux image:

petalinux-build

13. Create BOOT.BIN and Image:

cd images/linux
petalinux-package --boot --fsbl zynqmp_fsbl.elf --fpga system.bit --u-boot --force

14. Copy BOOT.BIN and Image to SD Card:

cp BOOT.BIN /media/<USER>/boot
cp image.ub /media/<USER>/boot
sync

15. Put SD Card on board and make sure the boot mode is set to sd_card (Ultra96: OFF
ON) look at output on UART

sudo screen /dev/ttyUSB1 115200


16. login with user: “u96” password: “u96”

Additional packages
Graphics with X11:

sudo apt-get -y install xorg


sudo apt-get -y install openbox

Ubuntu with GUI:

sudo apt-get install ubuntu-desktop

For modprobe, insmod etc:

apt-get -y install kmod

Drivers for NTFS (windows) drives:

sudo apt-get -y install ntfs-3g


Error fixes
If you encounter error “cannot create /dev/null: Permission denied”,
use the following command before chroot:

sudo mount --bind /proc /media/<USER>/rootfs/proc


sudo mount --bind /tmp /media/<USER>/rootfs/tmp
sudo mount --bind /sys /media/<USER>/rootfs/sys
sudo mount --bind /dev /media/<USER>/rootfs/dev
sudo mount --bind /home /media/<USER>/rootfs/home
sudo mount --bind /dev/pts /media/<USER>/rootfs/dev/pts

Links

PetaLinux:
https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug1144-petalinux-
tools-reference-guide.pdf

Ultra 96 (board files, BSP and tutorials):


http://zedboard.org/support/design/24166/156

Ubuntu:
http://cdimage.ubuntu.com/ubuntu-base/releases/

You might also like