README.md 3.87 KB
Newer Older
Bergeron, Mario's avatar
Bergeron, Mario committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Vitis Multi-Camera FMC Platform for the zcu104 Board

This platform comes with PetaLinux and includes OpenCV. It is useful
as a platform for exercising Vitis capabilities and topologies on the zcu104 board
with the Avnet multi-camera FMC.

# Requirements

In addition to the VITIS unified development environment, 
this design requires a license (or hardware evaluation license)
for the MIPI CSI2 RX core.

# Building the Platform

**Last Tested Vivado Release: 2019.2**

The platform build process is entirely scripted. Note that as this platform
build process involves cross-compiling Linux, build of the platform is supported
on Linux environments **only** (although it is possible to build inside a VM or
Docker container).

Also note that the default PetaLinux configuration uses local scratchpad areas. This
will *not* work if you are building on a networked file system; Yocto will error out.
Update PetaLinux to change the build area to a locally-mounted hard drive (most
Xilinx internal network servers have a /scratch or /tmp area for this purpose).

After cloning the platform source, and with both Vivado and PetaLinux set up, run
`make` from the top-level platform directory.

Note that by default this Makefile will install the platform to "platform_repo/zcu104_mc4/export/zcu104_mc4/"

# Installing the Yocto SDK

A bundled Yocto SDK "sysroot" is not available with this package by default. To build
non-trivial Linux software for this platform sysroot need to be built and installed.
This can be done with command "make peta_sysroot"
It is installed to "platform_repo/sysroot" once the build completes.

To cross-compile against this platform from the command line, source the
`environment-setup-aarch64-xilinx-linux` script to set up your environment (cross
compiler, build tools, libraries, etc).

# Build instructions

This packages comes with sources to generate hardware specification file (xsa) from Vivado,
petlainux sources to generate the image.ub and platform sources to generate the Vitis platform.

Build platform from scratch:
	make all

Build a platform without modifying hardware:

	make petalinux_proj XSA_DIR=<xsa dir path>
	make pfm XSA_DIR=<xsa dir path>

	example:
		make petalinux_proj XSA_DIR=/home/user/zcu104_mc4/vivado
		make pfm /home/user/zcu104_mc4/vivado

# Running on hardware
After the platform build completes you can copy the `petalinux/images/linux/BOOT.BIN`, `petalinux/images/linux/image.ub`, 
and the sdcard directory to the root directory of a blank microSD card.  After the board boots, source the 
hdmi_display_4k30.sh script to set the display resolution to 4k30.  Once the display is set up execute 
the pass_1080p.sh script which will capture 1920x1080 frames from each camera at 30 Hz and display on a 4K HDMI 
monitor in quadrants.  

# Notes

By default the rootfs is packaged in image.ub in the generated platform. The zcu104 board is having limited
2GB DDR4 memory for PS. In case of adding more rootfs packages or running the applications that require larger
CMA memory, the recommended solution is to load the rootfs from SD card instead of from DDR.
Refer section "Configuring SD Card ext File System Boot" in page 65 of ug1144 for Petalinux 2019.2:
"https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_2/ug1144-petalinux-tools-reference-guide.pdf"

This platform is built with 2019.2 XRT tag: https://github.com/Xilinx/XRT/tree/2019.2_RC1.
To build the platforms with latest 2019.2 XRT branch, change the commit id in the following files by taking it
from https://github.com/Xilinx/XRT/tree/2019.2 and build the platform:

Xilinx_Official_Platforms/zcu104_base/petalinux/project-spec/meta-user/recipes-xrt/xrt/xrt_git.bb
Xilinx_Official_Platforms/zcu104_base/petalinux/project-spec/meta-user/recipes-xrt/zocl/zocl_git.bb

Once the Vitis platform is ready, some example applications to build with these platforms can be found here:
https://github.com/Xilinx/Vitis_Accel_Examples