DPU (3.0) TRD for ZCU106

The DPU (3.0) TRD for ZCU106 with VIVADO/Petalinux 2019.1, which is similar as the DPU (3.0) TRD for ZCU104.

Here are the major steps on developing the DPU TRD for ZCU106 MPSoC Boards [we assumed that you already have VIVADO/Petalinux 2019.1 on Linux/Ubuntu machine which have 8GB+RAM and 4+ Core CPU].

Part A: VIVADO Development

  1. First of all download the ZCU106 BSP [1.26 GB in size] from the Petalinux Website-Xilinx
  2. Download the ZCU102 DPU TRD from Edge AI-Xilinx: zcu102-dpu-trd-2019-1-190809.zip
  3. Extract the DPU TRD of ZCU102 and create the project using the Tcl file as mentioned at DPU Product Guide (PG338 v3.0).
  4. Copy the ZCU106 Tcl file [which we have provided] into the “/pl” directory and goto ZCU102 VIVADO project, there on the tcl console enter: source </pl_directory>/zcu106_dpu_trd.tcl
  5. Above Tcl script only create the project for ZCU106, now run the synthesis, implementation and bitstream generation or directly click on “bitstream generation”. This will take some 2-3 hours on 16GB-RAM+ I5 CPU machine or depends on the machine config.
  6. After bitstream generation completes, recheck the timing , it must have meet or “no negative” on WNS/TNS/WHS.
  7. Now export the design from “file–>export design” , which creates the “sdk” directory on the “ZCU106_DPU_TRD” project directory.

Part B: Petalinux Development

We also have provided all the necessary sources for the Petalinux on the attachment, please download those [please mail us for the “Zip file of sources” at info@logictronix.com]. And for Petalinux Desktop version we also have separate tutorial at Hackster, please have a look.

  1. Now first of all source petalinux 2019.1 from your installed directory
% source <path/to/petalinux-installer>/Petalinux-v2019.1/petalinux-v2019.1-final/settings.sh
  1. Create new project in Petalinux, here we are going to use the ZCU106 BSP file which we downloaded from the petalinux xilinx download page. Copy that BSP inside zcu102-dpu-trd-2019-1-190809/apu/ and then run,
% cd <path/to/ZCU106-BSP>/
% petalinux-create -t project -s xilinx-zcu106-v2019.1-final.bsp
% cd zcu106-v2019.1
  1. Copy recipes to the Petalinux project

Now download the “File_Send_March3_2020_ZCU106_DPU_TRD.zip” , extract it and follow these steps. Now you are assumed to be inside the

  1. 1. Copy dnndk to recipes-apps
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/dnndk/ project-spec/meta-user/recipes-apps/
  1. 2. Copy recipes modules to meta-user
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/recipes-modules project-spec/meta-user
  1. 3. Copy autostart to recipes-apps
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/autostart/ project-spec/meta-user/recipes-apps/
  1. 4. Copy base files to recipes-core
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/base-files/
  1. 5. Copy recipes support to meta-user which is for OpencV
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/recipes-support project-spec/meta-user
  1. Configure PetaLinux-image-full.bbappend to install the dnndk files
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/petalinux-image-full.bbappend project-spec/meta-user/recipes-core/images/
  1. Config petalinux with directory of own “top_wrapper.hdf” which is inside “zcu106_dpu_trd.sdk”.
% petalinux-config ––get-hw-description=$TRD_HOME/pl/prj/zcu106_dpu_trd.sdk

This command will need to run with full screen of the terminal. This command will open up the petalinux configuration window. From there, check the following settings:

 DTG Settings -> MACHINE_NAME = zcu106-reva

From the config menu enable this:

Image Packaging Configuration-->Root Filesystem
type-->SD Card

Now save and exit the config menu!

This command create the “BOOT.BIN” , “image.ub” and “rootfs.tar.gz”. Now, save the setting of “Petalinux-config” and exit.

  1. Configure rootfs

For rootfs enter following command

petalinux-config -c rootfs
  1. 1. Enable each item listed below: Note: Do not enable the dev or dbg packages.

Petalinux Package Groups ->

  • gstreamer
  • matchbox
  • opencv
  • v4lutils
  • x11

Apps ->

  • autostart

Filesystem Packages ->

  • libs->libmali-xlnx->libmali-xlnx

· misc->packagegroup-core-buildessentialà packagegroup-core-buildessential

Modules ->

  • dpu

User Packages ->

  • dnndk
  • gstreamer-vcu-examples
  • packagegroup-petalinux-audio
  • packagegroup-petalinux-v4utils
  1. Changing the device tree

For our petalinux development we have to update the DPU Core interrupts as the vivado design. The interrupt and interrupt-values is also been discussed well at DPU Integration guide.

At the bottom of project-spec/meta-user/recipes-bsp/device-tree/files/ you will have to copy the given dpu.dtsi and system-user.dtsi.

Here are the commands:

cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/dpu.dtsi project-spec/meta-user/recipes-bsp/device-tree/files/
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/system-user.dtsi project-spec/meta-user/recipes-bsp/device-tree/files/
cp -rp ../File_Send_March3_2020_ZCU106_DPU_TRD/device-tree.bbappend project-spec/meta-user/recipes-bsp/device-tree/
  1. Update the project-spec/meta-user/conf/petalinuxbsp.conf file with the given petalinuxbsp.conf
  1. Goto
project-config -c kernel 

Go to

Device Drivers / Generic Driver options

Make sure the following settings are met:

o DMA Contiguous Memory Allocator: True
o Size in Mega Bytes: 1000
  1. Build the petalinux design: Now run the command
% petalinux-build
  1. Create BOOT.BIN for petalinux
% cd images/linux
% petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga system.bit --force

Now you will get the “BOOT.BIN”, “Image.ub”, “rootfs.tar.gz” file inside “/images/linux”.

Part C: Testing BOOT System on ZCU106 FPGA Board

  1. First, Partitioned the SD card with two partition as shown in Page 64 of UG1144 (v2019.1) May 22, 2019 . The “Preparing the SD Card”, shows the complete step for how to format the SD card with two partition as one in fat32 and another in ext4. We use gparted at Ubuntu for formatting and preparing the SD Card.
  1. Copy the BOOT files including the rootfs.tar.gz as shown in following pictures [taken from UG1144 (v2019.1) May 22, 2019, Page 65]:
Picture: Ttaken from UG1144 (v2019.1) May 22, 2019, Page 65
  1. Copy the “resnet50” folder to BOOT partition
$ cp resnet50 /media/BOOT
  1. Set the ZCU104 board in the SD Boot mode, plug the card, connect the UART with the FPGA board [baud rate is 115200] and power cycle [power the board].
  2. Now you must see the boot sequence in the terminal.
  3. The login for the root is “root” and password is also “root”.
  4. Now goto
% cd /media/card/resnet50/ 
  1. Now you will get the output of the resnet50 application run on given set of images [10 images].
Picture: output of DPU(3.0) TRD on ZCU106 with demo of resnet50 application


Tutorial ends here, if you want to follow or test this DPU(3.0) TRD for ZCU106 then please let us know. We will send you the “Zip file of sources” which is been used in this tutorial.

And we can also send you the already tested BOOT System or files for ZCU106, so you can also test it directly.

We send the BOOT system of DPU TRD for ZCU106 on email request, please write us at: info@logictronix.com

#DPU #TRD #ZCU106 #FPGA #Machine #Learning #Acceleration #Object #Recognition #Computer #Vision #LogicTronix