Monday, May 9, 2011

Android on the PandaBoard

For some weekend fun, I thought I'd check out Android on the PandaBoard (a.k.a. "Pandroid", heh) and see how Android compared to my webOS phone (a Palm Pre).

The "installation" of Android was roughly equivalent to the Fedora 13 experience:
  1. Create a small FAT partition and a larger ext3 partition on the SD card
  2. Download Android (I grabbed L27.10.2-P1_pandroid_rls.tar.bz2)
  3. Copy the bootloader/* files to the boot partition (MLO, u-boot.bin, and uImage)
  4. Copy the myfs/* files to the root filesystem partition
  5. Unmount the SD card and move it to the PandaBoard
Booting Android differed a bit from Fedora:
  1. Connect USB2Serial cable and fire up minicom
  2. Attach the power and...  it gives an error:
    booti: cannot find 'boot' partition
    Fastboot entered...
After searching the web for a while, I found a different set of boot arguments in the L27.10.2-P1 release notes to try (as opposed to this set of arguments):
setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=456M@0x80000000 mem=512M@0xA0000000 root=/dev/mmcblk0p2 rw rootdelay=2 init=/init vram="32M" omapfb.vram=0:16M,1:16M consoleblank=0'
setenv bootcmd 'mmcinit 0;fatload mmc 0 0x80000000 uImage; bootm 0x80000000'

Trying it again:
  1. Hit the power reset button, then hit a key in minicom to interrupt the autoboot sequence
  2. At the 'PANDA #' prompt, enter (copy and paste, actually) the above setenv commands for bootargs and bootcmd and then boot
It took a while to load (due to the slow SD card, more on this in a future post), but eventually Android popped up on my LCD monitor (connected with an HDMI-A to DVI-D cable).  The touch screen normally used on phone is simulated with a USB mouse and a regular cursor (left button is a finger tap, middle button is the menu, and right button is back), however, the cursor for the mouse was really slow and jumped around to try to keep up with mouse movements.
    A bit more reading and I learned that the Android image does not include accelerated drivers for the PandaBoard's PowerVR SGX540 chipset.  Fortunately, drivers are just another quick download from Texas Instruments.  I grabbed the drivers for L27.10.2-P1 image and copied them to the SD card (using my regular Linux laptop again), booted once more, and the graphics were nice and snappy!

    It seemed to have trouble bringing up the network (I think it needs more drivers), so I couldn't actually do a whole lot except fire up the basic apps that came with Android, e.g., calculator, address book, nothing too exciting, but the core OS worked!


    1. hi...

      I tried booting L27.8.2 version and found it to be slow as well and then tried to install the drivers . After installing the drivers , my board is not booting its kind of getting stuck before the android screeen is launched.. can you offer and help??

    2. Hi Manu,

      I'm not sure what might be causing that. Did you copy all of the drivers into the appropriate directories? The drivers include a number of files:

    3. I also get the error but sadly I could not fix it. When I enter your bootargs and bootcmd it still does not work. I am using the last Gingerbread build. Any idea what I am doing wrong? Thanks.

    4. More info on my last post. After I anter your bootargs and bootcmd this is what I get:

      mmc read: Invalid size

      3186828 bytes read
      ## Booting image at 80000000 ...
      Image Name: Linux-
      Image Type: ARM Linux Kernel Image (uncompressed)
      Data Size: 3186764 Bytes = 3 MB
      Load Address: 80008000
      Entry Point: 80008000
      Verifying Checksum ... OK

      Starting kernel ...

      Uncompressing Linux...

      Texas Instruments X-Loader 1.41 (Mar 21 2011 - 12:38:40)
      mmc read: Invalid size
      Starting OS Bootloader from MMC/SD1 ...

      U-Boot 1.1.4-L27.10.2P1^0-dirty (Mar 21 2011 - 12:38:03)

      Load address: 0x80e80000
      DRAM: 1024 MB
      Flash: 0 kB
      Using default environment

      In: serial
      Out: serial
      Err: serial

      efi partition table:
      efi partition table not found
      Net: KS8851SNL
      Hit any key to stop autoboot: 0
      booti: cannot find 'boot' partition
      Fastboot entered...

      As you can see it is starting to decompress the kernel...and than it just restarts. hope this helps you identify my problem.

    5. Did you partition the SD card using the script from omappedia?

      The PandaBoard is very picky about the partition layout.

    6. I tried both with the omap script and with the smaller one that is provided and I got the same results. I am using a 4GB card...can this be a problem? Thanks.

    7. Solved the problem. The power supply wasn't good and it only got power via USB...and that wast enough.

    8. Hi, when you said "it took a while", how long exactly did it took? Mine is in "booting kernel" and I don't know if it is working or not. Thanks

    9. thanks! it works! but i have a can i make it automatic? i've seen that i could use "boot.scr"...but it simply doesn't work...i don't know what i have to write in it....

    10. Also, Have anyone out there ever tried running any benchmark program, such as Quadrant, AnTuTu, CoreMark, LMBench etc?

      If anyone happens to have run any benchmark, please let me know, how could it be installed and be allowed to run on a Pandaboard. The basic metrics for the components that I am looking for are:
      - CPU
      - memory access
      - WLAN
      - Ethernet (in and out)

      1. me too i'm looking for a good benchmark that run on Pandaboard, any help please !!