Android 4.2.2 On Zynq Getting Started Guide

This page details the steps necessary to run Android 4.2.2 on ZC702 evaluation board. All commands displayed on this page are executed on an Ubuntu 10.04 x86_64 Linux system.

PLEASE NOTE: Some steps are known to be out-of-date. We are working on updates.

Table of Contents



This solution is not directly supported by Xilinx. For questions and help about this solution, please contact iVeia at http://git.iveia.com/support\

Overview

Android 4.2.2 (aka JellyBean) is supported on ZC702 evaluation board. The Android BSP is developed and maintained by iVeia. The Android GUI is supported through two interfaces on ZC702:
  • The on-board HDMI interface connector.
  • A Digilent FMC-HMI adapter board which contains an LCD. The Digilent FMC-HMI adapter board has the following interfaces:
  • A touchscreen interface - NOT SUPPORTED IN THIS RELEASE
  • A WVGA (800x480) resolution LCD display (resistive touchscreen NOT SUPPORTED IN THIS RELEASE).
  • An audio interface - NOT SUPPORTED IN THIS RELEASE.
  • A vertically mounted camera - NOT SUPPORTED IN THIS RELEASE.
Only one of the above interfaces is supported at a time, and different binary images are used in each case.


Binaries

The Android OS requires a set of binaries to be installed on an SD card. A pre-built set of binaries can be downloaded from the support site, at:
http://git.iveia.com/support

The Linux and Android binaries can be rebuilt from source with the instructions on the lower portion of this page - Building Android BSP on Zynq ZC702. The other binaries can be rebuilt from source provided by the vendors listed below:
Filename as downloadedFilename on SD cardDescriptionVendor
BOOT_FMC.BIN & BOOT_HDMI.BINBOOT.BINCreated using the EDK bootgen tool - contains the FSBL (First Stage Boot Loader), the FPGA bit-stream, and the U-Boot bootloaderXylon
uImageuImageThe Linux kerneliVeia
devicetree_fmc.dtb & devicetree_hdmi.dtbdevicetree.dtbThe Device Tree BlobXylon (with modifications by iVeia)
uramdisk.image.gzuramdisk.image.gzThe Linux ramdisk (u-boot wrapped), modified from the Xilinx's ZC702 release to run init.sh on boot and modify mount directories.Xylon (with modifications by iVeia)
init.shinit.shA script run at the end of boot (used to start Android)iVeia
root_fs.tar.gzN/AThe Android Root FilesystemiVeia
BOOT.BIN and devicetree.dtb have two versions, one for the FMC-HMI LCD (labelled FMC) adapter, and one for the on-board HDMI (labelled HDMI). The correct files must be copied except root_fs.tar.gz to the SD card and renamed as shown in the table.


Preparing the SD card

The external SD card should contain all the images required for Android boot. The SD card must have the first partition formatted with a FAT32 file system. Aa second EXT4 formatted filesystem is utilized by Android as the root filesystem. A third and final EXT4 partition is used by android as external storage; some media applications require external storage to load/save data files.

Partitions on the SD card should be structured as follows:
1. FAT32-formatted partition, large enough to contain all boot files.
2. EXT4 formatted partition, used by Android as a root filesystem.
3. EXT4 formatted partition, used by Android as external storage.
NOTE: The ZC702 bootloader will not boot from the SD card if any partitions formatted incorrectly.

The following console output details the steps necessary to partition an SD card using "`fdisk`" and format the partitions using "`mkdosfs`" (assumes the SD card is assigned device node "`/dev/sdb`"):

Command (m for help): p

Disk /dev/sdb: 7948 MB, 7948206080 bytes
255 heads, 63 sectors/track, 966 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x87f6d5f9

Device Boot Start End Blocks Id System

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-15523839, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15523839, default 15523839): +1G

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 2):
Using default value 2
First sector (2099200-15523839, default 2099200):
Using default value 2099200
Last sector, +sectors or +size{K,M,G} (2099200-15523839, default 15523839): +4G

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 83

Command (m for help): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 3):
Using default value 3
First sector (10487808-15523839, default 10487808):
Using default value 10487808
Last sector, +sectors or +size{K,M,G} (10487808-15523839, default 15523839):
Using default value 15523839

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 83

Command (m for help): v
Partition 1: previous sectors 2099199 disagrees with total 2098565
Partition 2: previous sectors 10487807 disagrees with total 10476633
Partitions 3: cylinder 967 greater than maximum 966
Partition 3: previous sectors 15523839 disagrees with total 15521165
Remaining 2047 unallocated 512-byte sectors

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

$ mkfs.vfat -F 32 -n boot /dev/sdb1
$ mkfs.ext4 -L root /dev/sdb2
$ mkfs.ext4 -L root /dev/sdb3


After formatting the card, copy all files listed in the Binaries section above to the first partition of the SD card except the root filesystem. It will be extracted to the second partition next. Be sure to select and rename the correct set of files for either the on-board HDMI or FMC-HMI LCD interface.

The root filesystem of Android now needs to be copied to the second partition. To do this, first extract the filesystem out of root_fs.tar.gz to a local directory (in the Example case: tmp_mnt/). The root user must then copy all of the files in the mount directory over to the second partition of the sd card (named part2 in the example).

Example:

sudo cp -r tmp_mnt/* /media/part2


This completes the preparation of the sd card. You are now ready to run it.


Running


Boot

To boot the ZC702 and run Android, follow these steps:
  • Format and Prepare SD card, according to the Installing section above. Be sure to select and rename the correct set of files for either the on-board HDMI or FMC-HMI LCD interface.
  • Insert the SD card into the ZC702's SDIO slot.
  • Ensure that the ZC702 board jumpers (shunts) are configured as follows:
    • Required for boot from SD:
      • J27: 1-2, J28: 1-2, J21: 2-3, J20: 2-3, J22: 1-2, J25: 1-2, J26: 2-3
    • Required for FMC-HMI touchscreen:
      • J37: 1-2, J38: 2-3, J70: 2-3, J65: 1-2, J8: open, J9: 1-2
    • Other jumpers that may be required:
      • J30: 1-2, J43: 1-2, J15: 1-2, J53: 1-2, J34: 1-2, J36: 1-2, J35: 1-2JJ7: 1-2, J33: 2-3
    • All other jumpers are open.
  • Connect the display:
    • To use the FMC-HMI adapter:
      • Connect the FMC-HMI adapter to the ZC702's FMC1 connector, J3.
      • Connect a ribbon cable between the FMC-HMI adapter's J4 and the ZC702's J40.
    • To use the on-board HDMI:
      • Connect the HDMI output, P1, to a display, e.g., an LCD monitor.
      • Both on-board HDMI and FMC-HMI adapter may be connected, but only one interface can be used at a time - this is selected by using the correct binaries (see the Binaries section above).
    • Connect a USB Hub, PC Mouse, or PC keyboard to the ZC702's USB OTG port (J1). This will generally require a USB A-to-A adapter and a USB A to micro-B cable.
    • To view boot/console output, connect the ZC702's USB UART port (J17) to a PC/laptop using a compatible USB cable, configured at 115200 bps.
  • Connect the DC power adapter to the ZC702 power connector (J60).
  • Power on the ZC702 using the power switch (SW11).

Expected Output

Example Linux and Android console output is listed here on the iVeia support site http://git.iveia.com/support
within the release file : android-output.txt
Android prints most of its output to a log file. To view the logfile during boot, you can use the "`logcat`" command.
Note: Once logcat is run, you will not be able to return to the Linux command-line, and logcat will continue to dump any newly logged information. To run logcat to show only the current log and then return to the command-line, run "`logcat -d`".

Android Navigation

Navigation within Android is accomplished via the USB-connected PC keyboard and USB-connected mouse.

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy