Home > Android > Porting Android to Beagle Board

Porting Android to Beagle Board

April 15th, 2009

Recently I got a Beagle Board rev C2. It’s a pretty nice hardware piece:
Beagle Board Hareware Specs

embinux has done a pretty good job of porting android to beagle board, and made it open source, here’s the link for the guide to port android.

Using Ubuntu, first compile the kernel, it’s pretty easy. You will need to install git and git-core if you haven’t used git before.

Then clone the git for android, and then compile. The source for android comes down to about 2.7GB. So prepare for a length download. Also note, you need at least 1GB~1.5GB of RAM to actually compile android. The JVM during compilation will eat up a lot of the RAM. If you don’t have sufficient RAM, the compilation will stuck at a random point during the process and never finish. I’ve encountered this problem on 2 different machines and finally switched to a 4GB MacBook 467 to finished the compilation.

Then apply the patches stated in the above porting guide.
Make a bootable SD card following instruction here
Partition 1 is for the uImage and boot loader; partition 2 is for the actual android file system.

Boot up the beagle board w/o inserting the SD card, then at prompt (using minicom/kermit under ubuntu or Tera Term/Hyper Terminal under windows), type in:
mmcinit // init mmc
fatload mmc 0 0×80300000 uImage // load uImage into memory address of 0×80300000
set boot arguments:
setenv bootargs console=ttyS2,115200n8 root=/dev/nfs rw nfsroot=192.168.1.5:/data/target ip=192.168.1.1::255.255.255.0 nolock,rsize=1024,wsize=1024 rootdelay=2
video=omapfb:mode:1280×720@50 init=/init
bootm 0×80300000 // boot up the loaded uImage

If everything goes well, u should see Android booting up ^_^

Android Shogun Android , ,

  1. Yossi
    April 21st, 2009 at 05:07 | #1

    Thanks for sharing your experience.
    Could you elaborate on the setup?, how did you connect the keyboard?, what about a mouse?
    I see you used NFS, so how did you connect to the PC?, as far as I know there is not Ethernet or wifi interface on the beagle. I assume only on USB interface, so how all of those interfaces were connected?.
    If you used USB hub, then what is the power source of that hub?

    Thanks, and sorry for so many questions…

    Yossi

  2. Android Shogun
    April 21st, 2009 at 06:20 | #2

    You will need a USB hub to connect keyboard and mouse (on the USB Host connector).
    The USB hub will provide the power (itself will be powered by AC/DC power input by default)
    Use HDMI to DVI to connect your monitor. No wifi yet. You can use a USB to Ethernet connector to get network :)

  3. Yossi
    April 21st, 2009 at 11:09 | #3

    Thanks,
    Well my problem was probably the hub which gets power from the beagle. I just connected diectly my keyboard and it works.
    With linux (angstrom distro) I could use my bluetooth keyboard+mouse, but here for some reason the init stucks when i am trying to.
    tomorrow i will look for a USB hub with power connection.

  4. Yossi
    April 25th, 2009 at 12:27 | #4

    Hi again,
    I am trying to connect the beagle as a device to my PC (so i will be able to upload my first android application).
    I followed some instructions and connected a mini male B connector to the beagle and the USB-A male connector to my PC (win xp).
    I waited for the PC to ask for a driver, but it didn’t. instead the PC found a malfunction USB device. when updating the driver to the one in x86 directory at the android SDK, the windows can’t realy find it.
    Any idea what could be the problem?, i didn’t find any clue about that in the forums.

  5. Darbar
    April 25th, 2009 at 22:00 | #5

    @Android Shogun
    To build the SD card partition 2 image (file system), how do I modify the procedure described in the “Root file System of Android” section of “Android_Porting_Guide_to_Beagle_Board” document? Can I just replace the “~/Android_rfs” with, e.g. “/media/Test_Android”, where “Test_Android” is the SD card partition name?

  6. Android Shogun
    May 1st, 2009 at 18:51 | #6

    I believe you need a custom ADB program in order to connect to Beagle Board.
    What I did is to put the apk files under the Android file system /data/app/ folder instead of doing “adb install your_apk.apk”

  7. Android Shogun
    May 1st, 2009 at 18:54 | #7

    I think ~/Android_rfs is the file system folder on your PC/Ubuntu.
    You actually need to put all the files/folders under that to the root of your 2nd SD partition.
    So if you do a “ls”, it looks like: /data /var /usr , etc. regular linux file structure stuff…

  8. Susan
    May 7th, 2009 at 05:11 | #8

    Hi Shogun,
    After porting android to beagleboard sucessfully, I’d like to put the apk into it. I copied the apk(under project_name/bin at Eclipse workspace)into SDcard (RFS/system/app or RFS/data/app). After that, I only can see the Package name of project. I executed it, but it failed. Do you know about this problem?
    What android SDK does the kernel and RFS that embinux released? Can I put the apk with SDK1.5 into beagle board and execute it? If not, how can I update the SDK of the beagleboard?

    Thanks in advanced.
    Best Regards.

  9. ssocco
    May 12th, 2009 at 09:59 | #9

    I recently downloaded the embinux hosted android beagleboard code. In following the port guide, “http://labs.embinux.org/index.php/Android_Porting_Guide_to_Beagle_Board” I was able to access the repository and configure the source code.

    When I try to “Compile Kernel” with ../vendor/embinux/support-tools/beagle_build_kernel.sh I get the following error:

    Assembler messages:
    Error: unknown architecture `armv7-a’

    Error: unrecognized option -march=armv7-a
    make[2]: *** [scripts/mod/empty.o] Error 1
    make[1]: *** [scripts/mod] Error 2
    make: *** [scripts] Error 2
    net Kernel Build Completed Sucessfully. Documentation

    Has anyone run across this before?

  10. Android Shogun
    May 16th, 2009 at 11:32 | #10

    Hi Susan,

    It looks like your APK is not properly signed. Follow this signing process. Then copy signed APK to /data/data/app or /data/app, depends on your SDK version.
    It should work.

  11. Android Shogun
    May 16th, 2009 at 11:33 | #11

    Make sure you have all the libraries needed and cross-compile toolchain ready. I think it’s CodeSourcery Q3 2008 release.

  12. May 21st, 2009 at 04:12 | #12

    While you refer to the C2 rev, the image you show above is of an earlier B version. You might want to update that image. Then *I* can steal it. :-)

  13. Stan
    May 21st, 2009 at 14:57 | #13

    Hi… I would love to get a little clarification on a couple things.

    Firstly, are you supposed to get the main Android source and compile from here?

    http://source.android.com/download

    Or do you skip that and go straight to http://labs.embinux.org/index.php/Android_Porting_Guide_to_Beagle_Board and follow the instructions there?

    I don’t understand what it means to “apply the patches”.

    I have a Rev C board as well, and cannot get my compiled kernel to boot.

    It gets stuck after:

    OMAP3 beagleboard.org # mmcinit
    OMAP3 beagleboard.org # fatload mmc 0 0×80300000 uImage
    OMAP3 beagleboard.org # setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p2 video=omapfb:mode:1280×720@50 init=/init rootfstype=ext3 rw rootdelay=1 nohz=off

    OMAP3 beagleboard.org # bootm 0×80300000

    ## Booting kernel from Legacy Image at 80300000 …
    Image Name: Linux-2.6.27-omap1-00125-g7fd866
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1886636 Bytes = 1.8 MB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum … OK
    Loading Kernel Image … OK
    OK

    Starting kernel …

    Uncompressing Linux…………………………………………………….
    …………………………………………………… done, booting the kernel.

  14. Suresh
    May 29th, 2009 at 21:49 | #14

    Hi Shogun,

    How to use Camera with beagle board, when i try calling the camera application, it is asking for SD card, i tried USB to SD converter in USB hub, but i think it is not detecting. If you have any solution for this pls let me know.

    Thanks,
    Suresh

  15. Android Shogun
    June 13th, 2009 at 17:33 | #15

    Oh, that image is from BeagleBoard.org :)

  16. Android Shogun
    June 13th, 2009 at 17:34 | #16

    Yes, I’m following the instruction at labs.embinux.org. Seems your board is booting up, probably something wrong with the SD Card format/file system?

  17. Android Shogun
    June 13th, 2009 at 17:36 | #17

    I haven’t gotten the SD Card to work though. :(

  18. Suresh Kalidasan
    June 19th, 2009 at 20:07 | #18

    Hi Shogun,

    I tried mounting SD card and it mounted properly commands as shown below

    1. mount -o rw -t ext3 /dev/block/sdc2 sdcard
    2. setprop EXTERNAL_STORAGE_STATE mounted
    3. am broadcast -a android.intent.action.MEDIA_MOUNTED –ez read-only false -d file:///sdcard

    now i see in Android Settings -> SD card & phone storage -> SD card is displaying
    Total space = 77MB
    Available space = 56MB
    Unmount SD card (Highlighted)
    Format SD card (Not Highlighted)

    Still when i try calling Camera application in Android, i’m getting message like “Please insert an SD card before using the camera”.

    Can somebody update with your comments to solve this.

  19. Suresh
    July 19th, 2009 at 00:33 | #19

    Hi Shogun,

    I got SD card detected, camera working fine with greenish dots in picture captured.

  20. Android Shogun
    August 8th, 2009 at 18:27 | #20

    wow! congratulations! ^_^ hope to see your blog/tutorial about this, if possible…

  21. pawan p
    December 15th, 2009 at 21:54 | #21

    hiiiiiiii,
    i had created a application by using andoid sdk 1.6 means but that is not running in beagle board ,but when i chenge the sdk version to 3 the application is running successfully on beagle board can any one tell how we can run our android application on beagle board which is created on android 1.6

  22. Android Shogun
    December 19th, 2009 at 13:38 | #22

    for now the beagle board android version supports sdk 1.5 only. you cannot run 1.6 code base on it.

  1. No trackbacks yet.