Skip to content

Getting Started with Android 7 for Xilinx Zynq UltraScale MPSoC

Alexey Firago edited this page Oct 3, 2018 · 5 revisions

Introduction

Welcome to the supporting documentation for Mentor Embedded Android on Xilinx Zynq UltraScale+ MPSoC platform. This page provides brief instructions on how to build and run Android 7 on Xilinx Zynq UltraScale+ MPSoC boards. For more detailed information about this release and other Mentor Embedded offerings for Xilinx Zynq UltraScale+ MPSoC please check https://www.mentor.com/embedded-software/semiconductors/xilinx/ultrascale

Initializing Build Environment

Installing JDK

Please check AOSP: Installing the JDK and AOSP: JDK Requirements for the detailed instructions to install proper version of the JDK. Please use OpenJDK 8 to build Android 7. On Ubuntu 15.04 it can be installed with:

$ sudo apt-get install openjdk-8-jdk

Installing packages

Please follow AOSP: Installing Required Packages to initialize build environment depending on your build host. Please note that builds are tested with 64-bit Ubuntu LTS 14.04 hosts. For the Ubuntu LTS 14.04 the following packages are required:

$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip device-tree-compiler

In addition to the packages from the AOSP guide, please install the following for the SD card initialization scripts:

$ sudo apt-get install dosfstools e2fsprogs parted

Downloading the Source

Installing Repo

$ mkdir -p ~/bin  
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo    

Initializing a Repo client

  • Create an empty directory to hold your working files:

    $ mkdir WORKING_DIRECTORY
    $ cd WORKING_DIRECTORY
    
  • Configure git with your real name and email address:

    $ git config --global user.name "Your Name"
    $ git config --global user.email "you@example.com"
    
  • Initialize repo client with URL for the manifest and branch specified:

    $ repo init -u git://github.com/MentorEmbedded/mpsoc-manifest.git -b zynqmp-android_7 
    
  • The following branches are available to use with the "-b" flag:

    Branch Description
    zynqmp-android_7 Android 7 based on android-7.1.2_r11 AOSP tag
  • Pull down the source tree:

    $ repo sync -c
    

Download MALI 400 Userspace Binaries

  • Download by using "Download Mali-400 User Space Components" link from https://www.xilinx.com/products/design-tools/embedded-software/petalinux-sdk/arm-mali-400-software-download.html

  • Save it to the Android top build foder

  • Run:

    $ mkdir -p tmp_mali && tar -xf mali-400-userspace.tar -C ./tmp_mali && mkdir -p vendor/xilinx/zynqmp/proprietary && cp -r  tmp_mali/mali/Android/android-7/MALI-userspace/r7p0-00rel0/*  vendor/xilinx/zynqmp/proprietary/ && rm -rf tmp_mali/
    
  • You should have the following files after that:

    $ tree vendor/xilinx/zynqmp/proprietary/
    vendor/xilinx/zynqmp/proprietary/
    ├── lib64
    │   └── libGLES_mali.so
    └── libGLES_mali.so
    

Build the code

  • Set up build environment:

    $ source build/envsetup.sh
    
  • Choose a target:

    $ lunch ultrazed_eg_iocc-eng
    
  • The following lunch targets are supported:

    Target Description
    zcu102-eng Development configuration of Android for Xilinx ZCU102
    zcu102-userdebug Production version of Android for Xilinx ZCU102 board with root access and debuggability
    ultrazed_eg_iocc-eng Development configuration of Android for Avnet UltraZed-EG SoM with IO Carrier Card
    ultrazed_eg_iocc-userdebug Production version of Android for Avnet UltraZed-EG SoM with IO Carrier Card with root access and debuggability
    zcu106-eng Development configuration of Android for Xilinx ZCU106
    zcu106-userdebug Production version of Android for Xilinx ZCU106 board with root access and debuggability
  • Build the code:

    $ make -j8
    

Preparing SD Card

Run the following script to prepare bootable SD card. Use path to your SD card instead of /dev/mmcblk0. Use, zcu102, ultrazed_eg_iocc or zcu106 as a second argument to specify which product subfolder in out/target/product/ to use. Use third argument to specify silicon revision of the SoC on the board. Default is "es1". "es2" must be specified for zcu106 and zcu102

$ cd WORKING_DIRECTORY
$ sudo device/xilinx/common/scripts/mksdcard.sh /dev/mmcblk0 ultrazed_eg_iocc es1
or
$ sudo device/xilinx/common/scripts/mksdcard.sh /dev/mmcblk0 zcu106 es2
or
$ sudo device/xilinx/common/scripts/mksdcard.sh /dev/mmcblk0 zcu102 es2

Running the Build

Xilinx ZCU102

  • Set boot mode of the board to "SD Boot". Insert SD card to the board.
  • Connect external monitor using DisplayPort. Please note that DisplayPort must be connected before board power-on.
  • Connect USB mouse (and optionally USB keyboard) as shown below: ZCU102
  • Power on the board

Avnet UltraZed-EG with IOCC

  • Install SoM on IOCC. Check official UltraZed-EG documentation for details.
  • Use J11 to connect to USB Serial debug console. Check official UltraZed-EG documentation for details.
  • Set boot mode of the board to "SD Boot" - on SoM set SW2[1-4] to OFF-ON-OFF-ON.
  • Insert SD card to the board.
  • Connect external monitor using DisplayPort. Please note that DisplayPort must be connected before board power-on. External monitor should support 1920x1080 resolution.
  • Make sure that the following jumpers are set on IOCC - J1[2:3], J2[2:3], JP1 OFF.
  • Power on the board

Xilinx ZCU106

  • Use default ZCU106 User Guide as a reference for switches and connectors location - https://www.xilinx.com/support/documentation/boards_and_kits/zcu102/ug1182-zcu102-eval-bd.pdf
  • Set boot mode of the board to "SD Boot" - set SW6[4:1] to [off, off, off, on]
  • Use J83 to connect to USB Serial debug console. Check official ZCU106 User Guide for details.
  • Insert SD card to the board.
  • Connect external monitor using DisplayPort. Please note that DisplayPort must be connected before board power-on. External monitor should support 1920x1080 resolution.
  • Connect USB mouse and USB keyboard using USB hub to the J96
  • Power on the board