Android - Getting Started Guide

Getting Started with Android on the Xilinx ZC702

Introduction

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

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 2.3 (aka Gingerbread) 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 onboard HDMI interface connector.
  • A Digilent FMC-HMI adapter board which contains an LCD and touchscreen interface. The Digilent FMC-HMI adapter board has the following interfaces:
    • A WVGA (800x480) resolution LCD display with resistive touchscreen.
    • 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 this page - android-on-zynq-building-bsp. The other binaries can be rebuilt from source provided by the vendors listed below:

Filename as downloaded Filename on SD card Description Vendor
BOOT_FMC.BIN & BOOT_HDMI.BIN BOOT.BIN Created using the EDK bootgen tool - contains the FSBL (First Stage Boot Loader), the FPGA bit-stream, and the U-Boot bootloader Xylon
zImage zImage The Linux kernel iVeia
devicetree_fmc.dtb & devicetree_hdmi.dtb devicetree.dtb The Device Tree Blob iVeia
ramdisk8M.image.gz ramdisk8M.image.gz The Linux ramdisk, modified from the Xilinx's ZC702 release to run startup.sh on boot Xylon (with modifications by iVeia)
startup.sh startup.sh A script run at the end of boot (used to start Android) iVeia
root.img root.img The Android Root Filesystem iVeia

Both BOOT.BIN and devicetree.dtb have two versions, one for the FMC-HMI LCD (labelled FMC) adapter, and one for the onboard HDMI (labelled HDMI). The correct files must be copied 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 FAT file system. An optional second, FAT-formatted filesystem can be utilized 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. FAT-formatted partition, large enough to contain all boot files.
1. (optional) FAT-formatted partition, used by Android as external storage.

NOTE: The ZC702 bootloader will not boot from the SD card if any partitions are marked bootable, or if any partitions have a non-FAT format.

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`"):

 $ sudo /sbin/fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 4124 MB, 4124049408 bytes
255 heads, 63 sectors/track, 501 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         350     2811343+   b  W95 FAT32
/dev/sdb2             351         501     1212907+   b  W95 FAT32

Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Selected partition 2

Command (m for help): p

Disk /dev/sdb: 4124 MB, 4124049408 bytes
255 heads, 63 sectors/track, 501 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-501, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-501, default 501): 250

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
 1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx
 5  Extended        42  SFS             86  NTFS volume set da  Non-FS data
 6  FAT16           4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS       4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility
 8  AIX             4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt
 9  AIX bootable    50  OnTrack DM      93  Amoeba          e1  DOS access
 a  OS/2 Boot Manag 51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O
 b  W95 FAT32       52  CP/M            9f  BSD/OS          e4  SpeedStor
 c  W95 FAT32 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs
 e  W95 FAT16 (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  GPT
 f  W95 Ext'd (LBA) 55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 61  SpeedStor       a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    64  Novell Netware  af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 65  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  70  DiskSecure Mult b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 75  PC/IX           bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 80  Old Minix       be  Solaris boot    ff  BBT
1e  Hidden W95 FAT1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): p

Disk /dev/sdb: 4124 MB, 4124049408 bytes
255 heads, 63 sectors/track, 501 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         250     2008093+   b  W95 FAT32

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (251-501, default 251):
Using default value 251
Last cylinder, +cylinders or +size{K,M,G} (251-501, default 501):
Using default value 501

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): b
Changed system type of partition 2 to b (W95 FAT32)

Command (m for help): p

Disk /dev/sdb: 4124 MB, 4124049408 bytes
255 heads, 63 sectors/track, 501 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         250     2008093+   b  W95 FAT32
/dev/sdb2             251         501     2016157+   b  W95 FAT32

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.

 $ sudo partprobe /dev/sdb
 $ sudo /sbin/mkdosfs -F 32 -n "ANDROID" /dev/sdb1
 $ sudo /sbin/mkdosfs -F 32 -n "EXTERNAL" /dev/sdb2

After formatting the card, copy all files listed in the Binaries section above to the first partition of the SD card. Be sure to select and rename the correct set of files for either the onboard HDMI or FMC-HMI LCD interface.

Running

Boot

To boot the ZC702 and run Android, follow these steps:

  • Format and SD card, and copy and rename files onto the card according to the Installing section above. Be sure to select and rename the correct set of files for either the onboard 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-2
          • J7: 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 onboard HDMI:
          • Connect the HDMI output, P1, to a display, e.g., an LCD monitor.
      • Both onboard 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 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.
  • Optionally, connect an ethernet cable from the ZC702's ethernet port (P2) to a PC/laptop. The ethernet connection is necessary only if you wish to use Android Debug Bridge (ADB) with the ZC702. In this case, you will need to manually configure the ethernet adapter for ADB. For example, you might use:
$ ifconfig eth0 192.168.1.99 up

where the IP address above would be specific to your PC/laptop and network.
  • 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 - [http://wiki.xilinx.com/local--files/android-on-zynq-getting-started-guide/android-console-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 onboard pushbuttons.

Keyboard assignments are:

Android Keyboard Notes
Home Home
Back Escape
Menu F1 F10 also
Enter Enter
Up,Down,Left,Right Arrow Keys
D-Pad Center Backtick (`) Required to select links in the Browser

Pushbutton assignments are:

Android ZC702 silkscreen label
Back SW14
Menu SW13
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License