Difference between revisions of "RowboatAndroid"

From Gumstix User Wiki
Jump to: navigation, search
 
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
To get started with Android on Gumstix, have a look at https://github.com/gumdroid/manifest which makes some use of the Rowboat project.
 +
 
== Android on Overo ==
 
== Android on Overo ==
 
There are several ports of Android to Overo; one port is based off the Rowboat-Android project.  This project is focused on creating a port of Android for the TI OMAP processors such as the OMAP3503 and OMAP3530 used on the Gumstix Overo boards.  The steps described below explain how to get Android Froyo (2.2) running on an Overo.  At the current time, there is no support for the DSP but the SGX drivers are supported.
 
There are several ports of Android to Overo; one port is based off the Rowboat-Android project.  This project is focused on creating a port of Android for the TI OMAP processors such as the OMAP3503 and OMAP3530 used on the Gumstix Overo boards.  The steps described below explain how to get Android Froyo (2.2) running on an Overo.  At the current time, there is no support for the DSP but the SGX drivers are supported.
Line 6: Line 8:
  
 
=== Checkout Sources ===
 
=== Checkout Sources ===
Repo is a tool to manage multiple Git repositories. You can install it wherever you like but if you have admininstrator rights, you might find this convenient:
+
Repo is a tool to manage multiple Git repositories. You can install it wherever you like but if you have administrator rights, you might find this convenient:
 
<code>
 
<code>
  $ sudo curl http://android.git.kernel.org/repo > /usr/bin/repo
+
  $ sudo curl http://android.git.kernel.org/repo > repo
  $ sudo chmod a+x /usr/bin/repo
+
  $ sudo chmod a+x repo
 +
$ sudo mv repo /usr/bin/repo
 
</code>
 
</code>
 
With Repo installed, grab the manifest file that describes all the git repositories we wish to fetch and then use 'repo sync' to get the latest and greatest source:
 
With Repo installed, grab the manifest file that describes all the git repositories we wish to fetch and then use 'repo sync' to get the latest and greatest source:
Line 21: Line 24:
  
 
=== Build a Kernel ===
 
=== Build a Kernel ===
 +
This would be a good time to apply any kernel patches.
 +
<code>
 +
$ cd ~/rowboat-android/kernel
 +
$ patch -p1 < ~/0001-added-palo43-pushbutton-and-led-support.patch
 +
$ patch -p1 < ~/[http://groups.google.com/group/rowboat/browse_thread/thread/adf23db34979817f/bfd1f0f7a13691c6?lnk=gst&q=IGEPv2+ADB#bfd1f0f7a13691c6 0001-Enable-ADB-on-IGEPv2-board.patch]
 +
</code>
 +
 
To build a kernel, follow [http://code.google.com/p/rowboat/wiki/ConfigureAndBuild#Build_kernel these] steps; you can use ''overo_android_defconfig'' to configure the kernel. E.g.
 
To build a kernel, follow [http://code.google.com/p/rowboat/wiki/ConfigureAndBuild#Build_kernel these] steps; you can use ''overo_android_defconfig'' to configure the kernel. E.g.
 
<code>
 
<code>
Line 37: Line 47:
 
  $ make TARGET_PRODUCT=overo -j8
 
  $ make TARGET_PRODUCT=overo -j8
 
</code>
 
</code>
After a bit of a wait (read: an hour or two depending on your machine), you should have the ''root' and ''system'' directories in the ''out/target/product/overo'' directory; we can combine these to make our final root file system:
+
After a bit of a wait (read: an hour or two depending on your machine), you should have the ''root'' and ''system'' directories in the ''out/target/product/overo'' directory; we can combine these to make our final root file system:
 
<code>
 
<code>
 
  $ cd ~/rowboat-android/out/target/product/overo
 
  $ cd ~/rowboat-android/out/target/product/overo
Line 61: Line 71:
 
  $ ./OMAP35x_Android_Graphics_SDK_setuplinux_3_01_00_03.bin
 
  $ ./OMAP35x_Android_Graphics_SDK_setuplinux_3_01_00_03.bin
 
</code>
 
</code>
At this point, you will be prompted to agree to the software license and asked where to unpack the source files (something like ~/rowboat-android/ is probably appropriate). Now navigate to this directory and edit the user-modifiable fields in the Rules.make file.  Here are some suggested values:
+
At this point, you will be prompted to agree to the software license and asked where to unpack the source files (something like ~/rowboat-android/ is probably appropriate). Now navigate to this directory and edit the user-modifiable fields in the ''Rules.make'' file.  Here are some suggested values:
 
<code>
 
<code>
HOME=/home/<username>/rowboat-android/out/target/product/overo
+
HOME=/home/<username>/rowboat-android/out/target/product/overo
GRAPHICS_INSTALL_DIR=/home/<username>/rowboat-android/OMAP35x_Android_Graphics_SDK_3_01_00_03
+
GRAPHICS_INSTALL_DIR=/home/<username>/rowboat-android/OMAP35x_Android_Graphics_SDK_3_01_00_03
ANDROID_ROOT=$(HOME)/android_rootfs
+
ANDROID_ROOT=$(HOME)/android_rootfs
CSTOOL_DIR=/home/<username>/rowboat-android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/
+
CSTOOL_DIR=/home/<username>/rowboat-android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/
KERNEL_INSTALL_DIR=/home/<username>/rowboat-android/kernel
+
KERNEL_INSTALL_DIR=/home/<username>/rowboat-android/kernel
 
</code>
 
</code>
 
Finally, we can build and install this code (N.B. these command are issued from the directory where we unpacked the source):
 
Finally, we can build and install this code (N.B. these command are issued from the directory where we unpacked the source):
Line 78: Line 88:
 
=== DSP Support ===
 
=== DSP Support ===
 
Currently, this version does not support the C64+ DSP found on Overo boards with a OMAP3530 processor (FE, Fire, Water).  To get this working, these two pages may be helpful:
 
Currently, this version does not support the C64+ DSP found on Overo boards with a OMAP3530 processor (FE, Fire, Water).  To get this working, these two pages may be helpful:
* http://code.google.com/p/rowboat/wiki/DSP
+
* http://code.google.com/p/rowboat/wiki/DSP
* http://code.google.com/p/rowboat/wiki/DSPCodecs
+
* http://code.google.com/p/rowboat/wiki/DSPCodecs
  
 
== Install ==
 
== Install ==
 +
'''Method 1'''
 +
 +
Included with the TI images is a mkmmc-android.sh script that will do the heavy lifting for you. It will make a bootable micoSD card, format it appropriately then copy the images in the required order to the correct partitions on the card. Download as part of the TI Development Package or as a standalone script [http://gitorious.org/rowboat/mk-mmc/blobs/master/mkmmc-android.sh here].
 +
 +
'''Method 2'''
 +
 
It is easiest to boot Android from a microSD card.  Follow the instructions [http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Creating-a-bootable-microSD-card/111.html here] to create a bootable microSD card with a recent MLO and U-boot from [http://www.sakoman.com/feeds/omap3/glibc/images/overo/ gumstix]. Also copy over the Android kernel and untar the root file system (requires root permissions) you have created:
 
It is easiest to boot Android from a microSD card.  Follow the instructions [http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Creating-a-bootable-microSD-card/111.html here] to create a bootable microSD card with a recent MLO and U-boot from [http://www.sakoman.com/feeds/omap3/glibc/images/overo/ gumstix]. Also copy over the Android kernel and untar the root file system (requires root permissions) you have created:
 
<code>
 
<code>
 
  $ cd ~/rowboat-android
 
  $ cd ~/rowboat-android
 
  $ cp kernel/arch/arm/boot/uImage /media/boot
 
  $ cp kernel/arch/arm/boot/uImage /media/boot
  $ sudo tar xaf out/product/overo/rootfs.tar.bz2 --numeric-owner -C /media/rootfs
+
  $ sudo tar xaf out/target/product/overo/rootfs.tar.bz2 --numeric-owner -C /media/rootfs
 
</code>
 
</code>
 
NOTE: this assumes the FAT partition of your bootable microSD card is mounted at /media/boot and that the EXT3 partition is mounted at /media/rootfs---adjust as appropriate.
 
NOTE: this assumes the FAT partition of your bootable microSD card is mounted at /media/boot and that the EXT3 partition is mounted at /media/rootfs---adjust as appropriate.
Line 112: Line 128:
 
NOTE:
 
NOTE:
 
If you are using a 4.3" LCD panel (Chestnut43, Palo43), use ''defaultdisplay=lcd43''; for a 3.5" LCD panel (Palo35), use ''defaultdisplay=lcd35''; for an external DVI monitor (Tobi, Summit), use ''defaultdisplay=dvi''.  Even if you are using an LCD panel, it is not necessary to change the ''omapfb.mode'' as this just sets up the framebuffer in the case that an external DVI monitor is used.
 
If you are using a 4.3" LCD panel (Chestnut43, Palo43), use ''defaultdisplay=lcd43''; for a 3.5" LCD panel (Palo35), use ''defaultdisplay=lcd35''; for an external DVI monitor (Tobi, Summit), use ''defaultdisplay=dvi''.  Even if you are using an LCD panel, it is not necessary to change the ''omapfb.mode'' as this just sets up the framebuffer in the case that an external DVI monitor is used.
 +
 +
== Using Android ==
 +
For touchscreen displays, you might like to replace the ''pointercal'' file found in ''~/rowboat-android/devices/gumstix/overo'' with one specific to the display you are using.  To do this, boot your Gumstix + touchscreen with the standard Angstrom build, do the touchscreen calibration step, and then grab the ''/etc/pointercal'' file from the root file system.
 +
 +
A mouse with a scroll-wheel can be attached to the USB Host port via a USB hub and used as buttons:
 +
* Right-click---back to home screen
 +
* Middle(scroll)-click---options
 +
* Scroll---scrolls
 +
Note that the mouse doesn't function like a regular pointer.
 +
 +
Please help out by listing features that are not (and, equally important, '''are''' working):
 +
 +
=== Unknown ===
 +
'''Palo35 & Palo43 - USB OTG'''
 +
  '''USB Flash Drive'''
 +
  '''USB Ethernet'''
 +
  '''USB Hub'''
 +
  '''USB Camera'''
 +
 +
'''Palo35 & Palo43 - USB Host'''
 +
  '''USB ADB'''
 +
  '''USB Mass Storage Device'''
 +
 +
'''Palo35 & Palo43 - Full Serial Communication'''
 +
 +
=== Known Working ===
 +
'''Palo35 & Palo43 - Sound''' is confirmed working with Android 2.2 on the Palo43 and Palo35 boards from Gumstix.
 +
'''Palo35 & Palo43 - LCD''' is confirmed working only when you build from rowboat source code. The pre-built images provided by gumstix DO NOT work.
 +
'''Palo35 & Palo43 - Touchscreen''' is confirmed working with patches. See Known Failing below.
 +
'''Palo45 - LED's & Buttons''' are confirmed working using pre-built images as well as building from rowboat source.
 +
'''Palo35 - LED's''' are confirmed working when built from source and kernel patches to board-overo.c applied
 +
 +
=== Known Failing ===
 +
'''Palo35 & Palo43 - Touchscreen ''' coordinates are inverted. When building from rowboat source, you need to edit kernel/input/touchscreen/ads7846.c at line 634 (just ouside the #endif) add:
 +
x = pdata->x_max - x;
 +
y = pdata->y_max - y;
 +
'''Palo35 - Buttons''' do not work at this time even with the aforementioned patches applied.
 +
 +
In palo35 interface board running with an overo fire,the gpio buttons does work using the patch, also you need to configure the .configue file to enable the keyboard gpio.
  
 
== Help and Help Out ==
 
== Help and Help Out ==
 
These steps have mostly been taken from (and would hopefully be integrated with :)) the [[http://code.google.com/p/rowboat/wiki/Main rowboat-android]] wiki; look here for additional information. Other useful links include:
 
These steps have mostly been taken from (and would hopefully be integrated with :)) the [[http://code.google.com/p/rowboat/wiki/Main rowboat-android]] wiki; look here for additional information. Other useful links include:
* http://omapzoom.org/wiki/OMAP_Android_Main
+
* http://omapzoom.org/wiki/OMAP_Android_Main
 
The mailing list for this project is quite valuable; check the archives for rowboat@googlegroups.com.
 
The mailing list for this project is quite valuable; check the archives for rowboat@googlegroups.com.
  
 
Patches, suggestions and improvements are most welcome---please send to ash (at) gumstix.com.
 
Patches, suggestions and improvements are most welcome---please send to ash (at) gumstix.com.

Latest revision as of 15:22, 1 April 2016

To get started with Android on Gumstix, have a look at https://github.com/gumdroid/manifest which makes some use of the Rowboat project.

Android on Overo

There are several ports of Android to Overo; one port is based off the Rowboat-Android project. This project is focused on creating a port of Android for the TI OMAP processors such as the OMAP3503 and OMAP3530 used on the Gumstix Overo boards. The steps described below explain how to get Android Froyo (2.2) running on an Overo. At the current time, there is no support for the DSP but the SGX drivers are supported.

Setup

This section explains how to download the required code and build a kernel and root file system.

Checkout Sources

Repo is a tool to manage multiple Git repositories. You can install it wherever you like but if you have administrator rights, you might find this convenient:

$ sudo curl http://android.git.kernel.org/repo > repo
$ sudo chmod a+x repo
$ sudo mv repo /usr/bin/repo

With Repo installed, grab the manifest file that describes all the git repositories we wish to fetch and then use 'repo sync' to get the latest and greatest source:

$ mkdir ~/rowboat-android
$ cd ~/rowboat-android
$ repo init -u git://gitorious.org/~ashcharles/rowboat/gumstix-manifest.git
$ repo sync

This (default) manifest pulls most of the repositories directly from the rowboat-android project but a few specific repositories (ahem, the kernel) have been cloned from this project and tweaked for the Overo.

Build a Kernel

This would be a good time to apply any kernel patches.

$ cd ~/rowboat-android/kernel
$ patch -p1 < ~/0001-added-palo43-pushbutton-and-led-support.patch
$ patch -p1 < ~/0001-Enable-ADB-on-IGEPv2-board.patch

To build a kernel, follow these steps; you can use overo_android_defconfig to configure the kernel. E.g.

$ cd ~/rowboat-android
$ export PATH=${PWD}/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH
$ cd kernel
$ make ARCH=arm overo_android_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-eabi- uImage -j8

You should now have a shiny new 2.6.32 Overo kernel here arch/arm/boot/uImage.

Build a Root File System

Follow these instructions to build a root file system using TARGET_PRODUCT=overo as the argument for make. E.g.

$ cd ~/rowboat-android
$ make TARGET_PRODUCT=overo -j8

After a bit of a wait (read: an hour or two depending on your machine), you should have the root and system directories in the out/target/product/overo directory; we can combine these to make our final root file system:

$ cd ~/rowboat-android/out/target/product/overo
$ mkdir android_rootfs
$ cp -r root/* android_rootfs
$ cp -r system android_rootfs

NOTE: Users wanting support for SGX hardware should skip to that section now before packaging their root file system.

We use the built-in mktarball.sh utility to package our android_rootfs directory into a tarball wherein the files have appropriate (i.e. root) permissions; this means you need root permissions for this next step:

$ cd ~/rowboat-android/out/target/product/overo
$ sudo ../../../../build/tools/mktarball.sh ../../../host/linux-x86/bin/fs_get_stats android_rootfs . rootfs rootfs.tar.bz2

You should now have a root file system tarball sitting here ~/rowboat-android/out/target/product/overo/rootfs.tar.bz2.

Getting SGX (Optional)

The PowerVR SGX hardware found on Overo boards with a OMAP3530 processor (FE, Fire, Water) provides integrated graphics support; in particular, it seems to reduce flicker on displays attached to the Overo. It is necessary to add some extra libraries and drivers to the root file system to make use of this hardware. Grab the required code and build it:

$ cd ~/rowboat-android
$ git clone git://gitorious.org/rowboat/ti_android_sgx_sdk.git
$ cd ti_android_sgx_sdk
$ ./OMAP35x_Android_Graphics_SDK_setuplinux_3_01_00_03.bin

At this point, you will be prompted to agree to the software license and asked where to unpack the source files (something like ~/rowboat-android/ is probably appropriate). Now navigate to this directory and edit the user-modifiable fields in the Rules.make file. Here are some suggested values:

HOME=/home/<username>/rowboat-android/out/target/product/overo
GRAPHICS_INSTALL_DIR=/home/<username>/rowboat-android/OMAP35x_Android_Graphics_SDK_3_01_00_03
ANDROID_ROOT=$(HOME)/android_rootfs
CSTOOL_DIR=/home/<username>/rowboat-android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/
KERNEL_INSTALL_DIR=/home/<username>/rowboat-android/kernel

Finally, we can build and install this code (N.B. these command are issued from the directory where we unpacked the source):

$ make -j8
$ make install OMAPES=3.x

More complete instructions are available here.

DSP Support

Currently, this version does not support the C64+ DSP found on Overo boards with a OMAP3530 processor (FE, Fire, Water). To get this working, these two pages may be helpful:

Install

Method 1

Included with the TI images is a mkmmc-android.sh script that will do the heavy lifting for you. It will make a bootable micoSD card, format it appropriately then copy the images in the required order to the correct partitions on the card. Download as part of the TI Development Package or as a standalone script here.

Method 2

It is easiest to boot Android from a microSD card. Follow the instructions here to create a bootable microSD card with a recent MLO and U-boot from gumstix. Also copy over the Android kernel and untar the root file system (requires root permissions) you have created:

$ cd ~/rowboat-android
$ cp kernel/arch/arm/boot/uImage /media/boot
$ sudo tar xaf out/target/product/overo/rootfs.tar.bz2 --numeric-owner -C /media/rootfs

NOTE: this assumes the FAT partition of your bootable microSD card is mounted at /media/boot and that the EXT3 partition is mounted at /media/rootfs---adjust as appropriate.

HINT: The commands to package the root file system, install the SGX (if desired), and copy these over to a microSD card are readily script-able; if you plan on doing this more than once...

Boot

The Android kernel requires some special parameters on boot. I have set these up in u-boot as follows (though this is certainly not the only way to do it):

# setenv anddisplay 'vram=8M omapfb.mode=dvi:1024x768MR-16@60 omapdss.def_disp=lcd43'
# setenv andconsole 'console=ttyS2,115200n8 console=tty0 androidboot.console=ttyS2'
# setenv androot 'root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait init=/init'
# setenv andbootargs 'setenv bootargs mpurate=500 ${andconsole} ${androot} ${anddisplay}'
# setenv andbootcmd 'mmc init; fatload mmc 0 ${loadaddr} uImage; run andbootargs; bootm ${loadaddr}'
# saveenv

To boot Android, just type run andbootcmd at the u-boot prompt.

If you always want to boot into android, set and save ${andbootcmd} as your boot command i.e.

# setenv bootcmd ${andbootcmd}
# saveenv

NOTE: If you are using a 4.3" LCD panel (Chestnut43, Palo43), use defaultdisplay=lcd43; for a 3.5" LCD panel (Palo35), use defaultdisplay=lcd35; for an external DVI monitor (Tobi, Summit), use defaultdisplay=dvi. Even if you are using an LCD panel, it is not necessary to change the omapfb.mode as this just sets up the framebuffer in the case that an external DVI monitor is used.

Using Android

For touchscreen displays, you might like to replace the pointercal file found in ~/rowboat-android/devices/gumstix/overo with one specific to the display you are using. To do this, boot your Gumstix + touchscreen with the standard Angstrom build, do the touchscreen calibration step, and then grab the /etc/pointercal file from the root file system.

A mouse with a scroll-wheel can be attached to the USB Host port via a USB hub and used as buttons:

  • Right-click---back to home screen
  • Middle(scroll)-click---options
  • Scroll---scrolls

Note that the mouse doesn't function like a regular pointer.

Please help out by listing features that are not (and, equally important, are working):

Unknown

Palo35 & Palo43 - USB OTG
  USB Flash Drive
  USB Ethernet
  USB Hub
  USB Camera
Palo35 & Palo43 - USB Host
  USB ADB
  USB Mass Storage Device
Palo35 & Palo43 - Full Serial Communication

Known Working

Palo35 & Palo43 - Sound is confirmed working with Android 2.2 on the Palo43 and Palo35 boards from Gumstix.
Palo35 & Palo43 - LCD is confirmed working only when you build from rowboat source code. The pre-built images provided by gumstix DO NOT work.
Palo35 & Palo43 - Touchscreen is confirmed working with patches. See Known Failing below.
Palo45 - LED's & Buttons are confirmed working using pre-built images as well as building from rowboat source.
Palo35 - LED's are confirmed working when built from source and kernel patches to board-overo.c applied

Known Failing

Palo35 & Palo43 - Touchscreen  coordinates are inverted. When building from rowboat source, you need to edit kernel/input/touchscreen/ads7846.c at line 634 (just ouside the #endif) add:
x = pdata->x_max - x;
y = pdata->y_max - y;
Palo35 - Buttons do not work at this time even with the aforementioned patches applied.

In palo35 interface board running with an overo fire,the gpio buttons does work using the patch, also you need to configure the .configue file to enable the keyboard gpio.

Help and Help Out

These steps have mostly been taken from (and would hopefully be integrated with :)) the [rowboat-android] wiki; look here for additional information. Other useful links include:

The mailing list for this project is quite valuable; check the archives for rowboat@googlegroups.com.

Patches, suggestions and improvements are most welcome---please send to ash (at) gumstix.com.