OMAP Pandroid Main

From OMAPpedia

Jump to: navigation, search
The Pandroid project has been retired after the last stable Gingerbread based release.
PandaBoard community efforts on Android port are now consolidated in Linaro's Android Evaluation Builds.
Android Open Source Project aka Upstream has support for PandaBoard and you can get started here

Contents

[edit] Latest Revisions

Check the OMAPpedia Release_Notes for the latest Pandroid revisions (listed as PandaBoard Release Notes / Android). As of this writing, L27.10.2 for Froyo and L27.12.2 for Gingerbread are current.

[edit] Pandroid

Pandroid is the port of Android on PandaBoard, the OMAP4 platform. More details on the Pandroid project are at http://pandroid.org . The PandaBoard details are available at http://pandaboard.org . The site also has downloads of pre-built binaries and the Issues list.

[edit] Source

Pandroid dev trees are located at: http://gitorious.org/pandroid and http://gitorious.org/pandaboard

Android file system can be taken from git.omapzoom.org . Please refer to http://omappedia.org/wiki/Android_source_code_versions for Android source code.

[edit] Pre-built Binaries

For instructions on how to format the SD card and copy the pre-built binaries, refer to Android_Pre-built_Binaries_Guide

Below video shows Pandroid(Port of Android) bootup on PandaBoard:

[edit] Using L27.8.2 AFS

There are some limitations and known issues with L27.8.2 AFS. Please follow the below instructions to use this release.

setenv bootargs 'console=ttyO2,115200n8 mem=463M root=/dev/mmcblk0p2 rw rootdelay=2 init=/init vram="32M" omapfb.vram="0:24M"' mmcinit 0;fatload mmc 0 0x80000000 uImage; bootm 80000000

You can refer to Release Notes for more details on this release

[edit] Getting Started

This section provides general instructions on how to get the PandaBoard started.

You will need to set up your MMC card. Use the shell script provided to simplify things.

Once the MMC card is set up, there are two ways to continue.

  1. Use a set of prebuilt binaries to boot up.
  2. Build your own binaries. Click here

You will then need to copy u-boot.bin, MLO and uImage (that you just built or downloaded) to the boot partition of the MMC card.

Next you will need a file system. To use a minimal file system, try this link. Others can be found here. Once you've downloaded the tar ball, you can extract it into the second partition on the MMC card.

Also, you will need a HDMI to DVI cable in case you are hooking a DVI monitor to the PandaBoard. Read this to learn more. What this means is you might have to add a few boot arguments while booting the PandaBoard (read on!)

Using a Serial A-to-B connector, connect the PandaBoard to the Serial Port on your PC. Follow this to setup your PC. (This is generally COM1).

On Windows, you should use Hyperterminal and on linux, Minicom to connect to the serial port (COM1). If all is well, when you insert the MMC card into its slot on the PandaBoard and power up your system, you should see the bootloader starting up and a prompt to hit a key to stop autoboot on the termianal in your PC. Now, hit a key to stop autoboot. This should lead to a "PANDA" prompt.

You will need to use boot arguments to load the kernel and start it up with the file system. Read here.

If all this worked, with the minimal filesystem, you will see a root prompt ("/ #") on the terminal and with other distros, the display should have booted up. You are now ready to go!

[edit] Selecting a Release

The example below shows the instructions for building L27.5.2 release. Please refer to for update on latest releases.

Latest release - L27.8.2

[edit] Tools and Dependencies

Please refer to Release Notes for the tools needed for compiling the source.

For more instructions on setting up the Host environment and tools, please refer to Building_Android

[edit] Building bootloader and kernel

[edit] Bootloader

Start with building the bootloader. To learn more about the bootloader process or to clarify details, look in here

Use the link above for commands on how to build u-boot and MLO. Use the parameters provided below with those commands

Once you have cloned a git source, you will need to switch to a branch indicated below (for bootloader or kernel).

/* This command lists the various branches to switch to and the current branch on*/
git branch -a
/*This command switches HEAD to a particular branch*/ 
git checkout -b  

u-boot

source: git://gitorious.org/pandaboard/u-boot.git
branch: origin/omap4_panda_es2.0
board config: omap4430panda_config

xloader

source: git://gitorious.org/pandaboard/x-loader.git
branch: origin/omap4_panda_L24.9
board config: omap4430panda_config

[edit] Kernel

Once done building the bootloader, copy u-boot.bin and mkimage to a PATH folder and build the kernel. (Additional details can be found at here)

source: git://gitorious.org/pandroid/kernel-omap
branch: origin/L27.5.2_panda
board config: android_4430panda_defconfig

Latest release

source: git://gitorious.org/pandroid/kernel-omap
branch: origin/L27.8.2_panda
board config: android_panda_defconfig

[edit] Android filesystem

The filesystem that is being used on PandaBoard is the reference file system from TI OMAP4 releases. These are referred with L27x tags. Pandroid releases are rebased almost once a month. Please refer to the for latest update on releases.

The below example shows the instructions for the Froyo release from L27.5.2. You can refer to the details on the release and the build instructions from http://omappedia.org/wiki/L27.INC1.5.2_Froyo_ES2_Release_Notes

[edit] Get Reference Source

You can get the Android source for this release by doing:

git clone git://git.omapzoom.org/platform/omapmanifest.git
cd omapmanifest
git reset --hard RLS27.5.2_Froyo
export MANIFEST=`pwd`
mkdir -p 27.5.2/mydroid; cd 27.5.2/mydroid
export MYDROID=`pwd`
repo init -u $MANIFEST
repo sync

Note: The manifest for some releases also contains the Bootloader. Ignore these as they are meant for the Blaze platform. Build them from the PandaBoard projetc in gitorious.

[edit] Add Pandroid features

Pandroid provides a desktop like environment with the use of HDMI display and USB keyboard and mouse. To enable mouse cursor support and some PandaBoard specific features, please apply the following patches on top of your filesystem source.

Thanks to rowboat project from where we can cherry pick these patches.

Add rowboat git tree as a remote to cherry pick the patches. The patches are to be applied in frameworks/base.

After cloning (repo sync) the TI Blaze release, perform the following.

 cd frameworks/base
 git remote add rowboat git://gitorious.org/rowboat/frameworks-base.git
 git fetch rowboat
 git branch -a
 git cherry-pick 24117ce3ae32c40798d2d9bda80675814f76730d
 git cherry-pick ac82681dffdba3ad0b93ed3558365bac1dacbcd1
 git cherry-pick b0f60c6
 git cherry-pick afee303
 git cherry-pick 64d7c77

[edit] Building Android Filesystem (AFS)

cd $MYDROID
cp -Rfp device/ti/blaze/buildspec.mk.default buildspec.mk

Building AFS with Android Codecs Edit: “device/ti/blaze/BoardConfig.mk”: Uncomment “USE_CAMERA_STUB := true” Comment “BOARD_USES_TI_CAMERA_HAL := true” Comment "HARDWARE_OMX := true”

Note: No change in BoardConfig.mk to use TI Codecs

On step below use the number of cores you have available; i.e. -j4 or -j12:

make clean (required for rebuild only) make -j4 2>&1 |tee $MYDROID/logs/android_make.out

[edit] Preparing Android binaries

For Gingerbread and onwards, the default build system generates eMMC based binaries, making Android eMMC Booting as default.

The following steps will prepare a directory, called myfs, containing all necessary Android files that you must include within your SD card.

cd $YOUR_PATH
mkdir myfs
cd myfs

cp -Rfp $MYDROID/out/target/product/blaze/root/* .
cp -Rfp $MYDROID/out/target/product/blaze/system/ .
cp -Rfp $MYDROID/out/target/product/blaze/data/ .
cp -Rfp $MYDROID/device/ti/blaze/init.omap4sdp.rc init.rc

==== Copy BT drivers and firmware ====
cp -Rfp /drivers/misc/ti-st/bt_drv.ko .
cp -Rfp /drivers/misc/ti-st/st_drv.ko .
cp -Rfp TIInit_7.2.31.bts system/etc/firmware

==== Copy WLAN drivers and firmware ===
cp -Rfp $MYDROID/hardware/ti/wlan/wl1271/platforms/os/linux/tiwlan_drv.ko system/etc/wifi
cp -Rfp firmware.bin system/etc/wifi

Next, modify the following file in the android file system created - tiwlan.ini file in directory system/etc/wifi.

    Change the line 193
    FROM:
       STRFRefClock = 1 # Unit: Options 5'bXX000 : Bit 0,1,2 - (0: 19.2MHz; 1: 26MHz; 2: 38.4MHz  (Default); 3: 52MHz;  4: 38.4MHz XTAL) ; 
     TO:
       STRFRefClock = 2 # Unit: Options 5'bXX000 : Bit 0,1,2 - (0: 19.2MHz; 1: 26MHz; 2: 38.4MHz  (Default); 3: 52MHz;  4: 38.4MHz XTAL) ; 

Only change the STRFRefClock value from 1 to 2. The default tiwlan.ini is preset for the Blaze and the Pandaboard requires a different value.

[edit] Additional Changes

Once you have created the Android filesystem (AFS), please make the below changes. Currently, PandaBoard is using the product spec from Blaze (another OMAP4 dev platform) and hence some changes are needed.

In "init.rc" file, diable the secondary display (comment out the below 4 lines)

# Enable secondary display on Blaze
 #  write /sys/devices/platform/omapdss/display1/enabled 1
 #  write /sys/devices/platform/omapdss/overlay1/enabled 0
 #  write /sys/devices/platform/omapdss/overlay1/manager "2lcd"
 #  write /sys/devices/platform/omapdss/overlay1/enabled 1

To mount the SD card, update "vold.fstab" file in system/etc/ to indicate 'mmc1' instead of 'mmc0'

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
 Change
 dev_mount sdcard /mnt/sdcard auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
 To
 dev_mount sdcard /mnt/sdcard auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc0

Note: Media clips are copied in the 1st partition (boot) for them to be detected by Gallery app. If your SD card is not getting mounted, you could try through "Media Scanner" app.

[edit] A minimal FileSystem

You could also try the following minimal filesystem.

wget http://www.elinux.org/images/b/bd/Minimal-rootfs.tar.gz
add init=/linuxrc to the bootargs

[edit] Bootargs

setenv bootargs 'console=ttyO2,115200n8 mem=463M root=/dev/mmcblk0p2 rw rootdelay=2 init=/init vram="32M" omapfb.vram="0:24M"'
mmcinit 0;fatload mmc 0 0x80000000 uimage; bootm 80000000

[edit] Features

Below sections will show you how to enable certain feature on the Pandroid port & filesystem.

[edit] HDMI to DVI

Using a DVI to HDMI cable, if plugged into the HDMI port a DVI display works at resolutions up to 1920x1080p-60.

[edit] USB Mouse

USB mouse with mouse cursor has been verified by using the following patch (thanks to Android port on x-86) on L27.5.2.

http://git.android-x86.org/?p=platform/frameworks/base.git;a=commit;h=d717a9fa9f0571cfd10a1fbed19605b4c0f01ccf

http://git.android-x86.org/?p=platform/frameworks/policies/base.git;a=commit;h=8ac8b68ccd55d63c4648006d4ad6c1177c62d1b4

Features - Mouse cursor movement, Scroll, Left Button Click - Selection, Middle Button - Menu, Right Button - Back

[edit] Graphics Accelerator Drivers

[edit] Source

The Android file system and kernel require changing to fold in the GFX libraries.

The GFX libraries can be downloaded from https://gforge.ti.com/gf/project/omapgraphics/frs/

Make sure the Linux kernel is correct. The kernel source git repository is located and can be cloned at:

    git clone git://gitorious.org/pandroid/kernel-omap.git -b L27.5.2_panda

Note the tag used to pull the source. L27.5.2_panda is the mainline tag for Pandroid.

The pre-built binaries (including the Android file system) can be downloaded at:

    

[edit] Build Instructions

Run the menuconfig facility in your downloaded kernel.

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig

Select the menu Device Driver, then select Graphics Support. Next, select the PowerVR SGX menu item for it to be built into the kernel. The SGX revision (Revision 1.2.0 - Omap 4430 ES2) and PowerVR build type menu items will appear after selection.

The first menu item, SGX revision, is a TI internal option and can be safely ignored. The second menu item leverages debug facilities in the GFX libraries. Selecting DEBUG versus RELEASE is unlikely to help during the build process, but may be helpful during application development.

Once the menuconfig is set, make the kernel uImage using the command:

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage

After the uImage is compiled, set up the boot partition as normal and the kernel part will be complete.

Next, the Android file system needs to be addressed. Go to the top level directory of the GFX libs install. For example:

    cd GFX_Binaries_Froyo_L27.5.2/
    user@ccdm64:~/GFX_Binaries_Froyo_L27.5.2$ ls
    data  system  uninstall

The data and system directories correspond directly to the Android file system's /system and /data directories respectively. Ignore the uninstall file. Next, copy the files into the target Android file system. The commands below assume you have already prepared your Android root file system with a partition label ROOTFS on a SD card. If your setup is different paste the commands into an editor and modify accordingly. It is also assumed root permissions are required on the Android file system target. If not necessary, do not use sudo for copying.

    sudo cp data/app/*        /media/ROOTFS/data/app
    sudo cp system/bin/*      /media/ROOTFS/system/bin
    sudo cp system/lib/egl/*  /media/ROOTFS/system/lib/egl
    sudo cp system/lib/hw/*   /media/ROOTFS/system/lib/hw
    sudo cp system/lib/lib*   /media/ROOTFS/system/lib

No changes are necessary for /init.rc on the Android root file system. One of the GFX files copied was an egl.cfg. This file will be recognized by the kernel (remember the menuconfig steps?),and commands already located in the init.rc will load the correct GFX libs.


A video tutorial on using GFX on Pandroid can be found below :

[edit] How to Test

Once the Panda has finished booting, there are three approaches for verifying the install. The first is to review the logcat output from the console. The second is to run example programs there were among the files copied onto the Android file system. The third is to run the tests from the Android desktop via mouse (See YouTube video).

The logcat command will show whether the kernel was able to load the GFX libraries. If the libraries failed to load, logcat will indicate a kernel fault with the addresses where the fault occurred.

The other approach is to run the Android package programs from the console. In the /data/app/ there are the following test programs:

    /data/app# ls
    eglinfo.apk  gles1test1.apk  gles1_texture_stream.apk  gles2test1.apk  gles2_texture_stream.apk  launcher.apk

Each program can be run from the Android desktop display or the serial console. For instance, in the program gles1test1, there will appear two rotating triangles. Other programs are based on the same images and animation but have different execution behaviors. Below are commands for running the test programs in the order of the above listing.

    am start -a android.intent.action.MAIN -n com.imgtec.powervr.ddk.eglinfo/com.imgtec.powervr.ddk.eglinfo.EGLInfo
    am start -a android.intent.action.MAIN -n com.imgtec.powervr.ddk.gles1test1/com.imgtec.powervr.ddk.gles1test1.GLES1Test1
    am start -a android.intent.action.MAIN -n com.imgtec.powervr.ddk.gles1_texture_stream/com.imgtec.powervr.ddk.gles1_texture_stream.GLES1TextureStream
    am start -a android.intent.action.MAIN -n com.imgtec.powervr.ddk.gles2test1/com.imgtec.powervr.ddk.gles2test1.GLES2Test1 
    am start -a android.intent.action.MAIN -n com.imgtec.powervr.ddk.gles2_texture_stream/com.imgtec.powervr.ddk.gles2_texture_stream.GLES2TextureStream
    am start -a android.intent.action.MAIN -n com.imgtec.powervr.ddk.launcher/com.imgtec.powervr.ddk.launcher.Launcher

If the program runs without crashes indicated by the desktop or logcat, chances are the GFX libraries are working fine.

NOTE: There is an environment issue with Pandroid where the apk exits after a few frames when run from the console. The pageflipping feature in Android disrupts the GFX test. A workaround is actually using a smaller omapfb.vram value, making Android pageflipping impossible. Use the bootargs below as only a guide for testing the above apk programs. It is best to increase the vram and omapfb.vram back to the suggested size, once testing is complete.

     setenv bootargs 'console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootdelay=3 mem=463M init=/init omapfb.vram="0:9M" vram=9M  androidboot.console=ttyO2 earlyprintk omapdss.debug=1 loglevel=8'
     mmcinit 0; fatload mmc 0 0x80000000 uImage;bootm 80000000'

[edit] WiLink Connectivity

[edit] Release Package

Connectivity release package contains the Init scripts, Firmware.bin and any other patches that may be needed to enable WLAN and BT on Pandroid. Download the package and copy the files in the appropriate folders as per isntructions.

[edit] Bluetooth

[edit] Source

The kernel source git repository for Pandroid is located and can be cloned from:

    git clone git://gitorious.org/pandroid/kernel-omap.git -b L27.5.2_Panda_new

Note the tag used to pull the source. L27.5.2_Panda_new is the branch that has support for BT and WLAN for Pandroid.

[edit] Build Instructions

BT is built as a module in kernel. After building the kernel, make sure to build the modules.

make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm modules

This will generate bt_drv.ko and st_drv.ko.

[edit] How to Enable/Test Bluetooth

Ensure following before starting the BT validation

1) Please follow the steps mentioned in "Preparing Android binaries" section to copy BT driver (bt_drv.ko and st_drv.ko) to file system (root folder)http://omappedia.org/wiki/OMAP_Pandroid_Main#Android_filesystem

2) Copy TIInit_7.2.31.bts (BT init script for WL127x) from the Download the WLAN 1271 Connectivity Package.
to system/etc/firmware while preparing file system (SDCARD).


Important Notes

The UIM service (in init.rc - uim /dev/ttyO2...) loads st_drv.ko and bt_drv.ko. The BT and ST moudles should not be manually loaded.

To check whether the modules are inserted into kernel or not, issue the following command ‘$ lsmod’ this will list all the modules inserted in the kernel.

Below is a video example on how to enable and use Bluetooth on Pandroid :

Test BT from Android UI

1. Go to Settings, Wireless and Network
2. Select "Bluetooth". This will show "Turning On..."
3. Once BT is turned On, click Bluetooth Settings.
4. Select "Scan for Devices". This should start scanning other BT enabled devices around and list them.
5. For Panda to be seen by other devices, you'll have to turn the "Discoverable" option "On".
6. You can change the "Device Name" to identify your PandaBoard
7. Once "Discoverable" mode has been enabled, you can initiate Pairing with other devices.

Object transfer through Gallery app

1. Go to Gallery menu, choose any file
2. Long press on the file
3. Green color tick mark symbol is seen on the right hand corner of that file
4. Go to shareBluetoothchoose the remote device to transfer the files

NB:- Make sure the remote device should discoverable and paired.

Test BT config from command prompt

To turn on BT, execute "hciconfig hci0 up &" command on terminal

The expected (typical) output would be:

    <6>kim kim: firmware: requesting TIInit_7.2.31.bts
    kim kim: firmware: requesting TIInit_7.2.31.bts
    <3>init: untracked pid 1018 exited
    init: untracked pid 1018 exited
    [1]   Done                    hciconfig hci0 up

To check the status of BT, execute "hciconfig -a"

The expected (typical) output would be:

       hci0:   Type: UART
       BD Address: 00:23:D4:50:37:F9 ACL MTU: 1021:4 SCO MTU: 180:4
       UP RUNNING
       RX bytes:702 acl:0 sco:0 events:23 errors:0
       TX bytes:102 acl:0 sco:0 commands:23 errors:0
       Features: 0xff 0xff 0x2d 0xfe 0x9b 0xff 0x79 0x83
       Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
       Link policy:
       Link mode: SLAVE ACCEPT
       Name: 
       Class: 0x001f00
       Service Classes: Unspecified
       Device Class: Invalid Device Class!
       HCI Ver: 2.1 (0x4) HCI Rev: 0x0 LMP Ver: 2.1 (0x4) LMP Subver: 0x1d1f
       Manufacturer: Texas Instruments Inc. (13)

To discover/scan BT devices in range, execute "hcitool scan" command in termial

The expected (typical) output would be:

       Scanning ...
       00:24:7D:09:E2:58       Ignatius N5800
       00:1B:11:6F:A4:16       test1
       00:1E:3A:7C:E0:39       N 95
       00:16:38:3A:6C:E2       MINX0132901

[edit] WLAN

[edit] Builing WLAN driver (1271)

It has the patch, firmware binary and BT/FM init scripts.

Personal tools
Namespaces
Variants
Views
  • Read
  • Edit
  • View history
Actions
Navigation
Toolbox
  • What links here
  • Related changes
  • Special pages
  • Printable version