View source for Android on Freerunner
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to Android on Freerunner.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to Android on Freerunner.
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |
Google has released their open source version of the Android phone software distribution. In order to use it on the Freerunner, a number of patches need to be applied and a compiler with armv4 java exception support needs to be used to compile the software.
Most of the hardware on Freerunner seems to work on latest Android images, but not always perfectly.
SW keyboard | works, can be brought up with short press to power button |
Suspend | works, can be done with 1s press of power button, wake up with long power button press, don't use screen timeouts, disable it in Settings->Sound & display->Screen timeout->Never timeout |
GSM | sources for libmuxgsm-ril.so not released yet, latest images have binary from ML that works fine |
GPRS | does not work, GSM get's confused when you try to use it |
Contacts on SIM | works, Contacts->menu->Settings->SIM contacts importer |
Bluetooth | works, latest kernels need permissions for second rfkill interface in init.rc to turn it on |
Wifi | works, but i have problems with scanning when just one AP is in range, it fails most of the time |
GPS | once i got it working, you can test with AndNav2 program |
Accelerometers | works, can be tested with simple game called Amazed |
Media | can play OGG audio files, picure application crashes |
Android is a little picky about the version of gcc compiler. It also requires some java exception support that isn't available for armv4 without a minor modification. The following tools are what I use to build Android:
At one time I had some armv5t code that was compiled into Android which would cause the linker to generate these blx instructions which fail on armv4. I'm not sure if this is still necessary, but I still have the following change applied to binutils:
diff -urN binutils-2.18-orig/bfd/elf32-arm.c binutils-2.18/bfd/elf32-arm.c --- binutils-2.18-orig/bfd/elf32-arm.c 2007-08-07 02:59:23.000000000 +0700 +++ binutils-2.18/bfd/elf32-arm.c 2008-03-15 11:30:17.000000000 +0700 @@ -3093,8 +3093,8 @@ static void check_use_blx(struct elf32_arm_link_hash_table *globals) { if (bfd_elf_get_obj_attr_int (globals->obfd, OBJ_ATTR_PROC, - Tag_CPU_arch) > 2) - globals->use_blx = 1; + Tag_CPU_arch) >= TAG_CPU_ARCH_V5T) + globals->use_blx = 0; } bfd_boolean
configure --prefix={devel path}/android/cross --target=arm-eabi
configure --prefix={devel path}/android/cross --target=arm-eabi --with-arch=armv4t --enable-shared --enable-threads --disable-nls --disable-libmudflap --enable-target-optspace --with-abi=aapcs --enable-multilib --disable-libssp --disable-libstdcxx --enable-languages=c,c++
This is the standard Linux package available for most (all?) distributions.
Coming soon. I've posted a number of them on the devel mailing list so far. Eventually, I expect to provide everything necessary for people to build Android for themselves.
There are currently a few prebuild images:
Michael Trimarchi's images with latest fixes Sean McNeil images
To use the Kernel you have to either :
I have placed an older 2.6.26 kernel with Android support at:
uImage-android
I have put up a jffs2 image that replaces rootfs on the Freerunner at:
androidfs.jffs2
As noted above, this installation requires you to wipe out the existing kernel and rootfs in NAND on your Freerunner. You also must have an SDCARD and it needs to be configured with two (2) primary partitions: First is VFAT/MSDOS (16 or 32) which acts as the /sdcard storage area for pictures, movies, music, etc. and the Second is an ext3 primary partition for use of internal Android /data area to store settings, caches, etc.
The first thing I suggest is to setup an SDCARD. You can flash the NAND first, but you must have an SDCARD with two partitions as stated before you'll be able to boot. I use a 2GB card which I have split in half. fdisk shows me:
/dev/mmcblk0p1 1 2454 996310 6 FAT16
/dev/mmcblk0p2 2455 4908 996324 83 Linux
formatted as
sudo mkfs.vfat /dev/mmcblk0p1
sudo mkfs.ext3 /dev/mmcblk0p2
There is no need to populate the ext3 partition at all. The VFAT partition can be populated with media content if you so desire.
With your SDCARD all set, you are ready to flash the kernel and rootfs:
sudo {path_to}/dfu-util -d 0x1d50:0x5119 -a kernel -D uImage-android
sudo {path_to}/dfu-util -d 0x1d50:0x5119 -a rootfs -D androidfs.jffs2
There are currently a few prebuild images: Radek Polak's SD card images (install on ext3, first partition on SD must be FAT16)
You can also boot from the SD Card using the pre built images like so :-
sudo ./Mntjffs.sh freerunner-v5.jffs2 image/
Some notes about booting android from sdcard :
--- filesystem/root/init.rc 2008-12-15 17:51:14.000000000 +0100 +++ phyce.init.rc 2008-12-19 15:56:25.000000000 +0100 @@ -24,7 +24,7 @@ mkdir /sqlite_stmt_journals 01777 root root mount tmpfs tmpfs /sqlite_stmt_journals size=4m - mount rootfs rootfs / ro remount + mount rootfs rootfs / rw remount write /proc/sys/kernel/panic_on_oops 1 write /proc/sys/kernel/hung_task_timeout_secs 0 @@ -38,14 +38,14 @@ # mount yaffs2 mtd@system /system ro remount # We chown/chmod /data again so because mount is run as root + defaults - mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev - chown system system /data - chmod 0771 /data +# mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev +# chown system system /data +# chmod 0771 /data # Same reason as /data above - mount yaffs2 mtd@cache /cache nosuid nodev - chown system cache /cache - chmod 0770 /cache +# mount yaffs2 mtd@cache /cache nosuid nodev +# chown system cache /cache +# chmod 0770 /cache
Android boots and graphic UI appears (hurray) ! But, i cannot unlock my SIM so I can't tell more ;) Maybe you wanna try to remove PIN protection in your SIM (using another phone) and see what happens next.
Phyce 16:25, 1 January 2009 (UTC)
To assist in debugging and to gain shell access to the phone with Android, you can use
adb
You should be able to connect to the phone as long as you start it up with the USB connected to your host. I don't think it will work if you plug it in after starting. Of course, you need to setup USB_Networking (ifconfig usb0 ...) on your host before connecting.
Some helpful commands are:
ADBHOST=192.168.0.202 ./adb logcat - like a tail -f of the android log ADBHOST=192.168.0.202 ./adb logcat -b radio - same as above for the radio logs ADBHOST=192.168.0.202 ./adb shell - bring up a command shell to the phone ADBHOST=192.168.0.202 ./adb kill-server - kill the background server on the host
Sometimes, adb gets stuck: if you cannot to the device run "adb kill-server" before trying other commands.
This version of the linux kernel will not successfully wake from suspend mode. Your battery life will be significantly lowered because of this and the phone will lock up unless you setup the phones screen timeout to never.
This version of the kernel also uses a keypad hack. The buttons layout is as follows:
Aux left-hand upper button is the "back" key. Power button is: menu button when pushed quickly, end button when held for more than a second and released, power-off if held for 10 seconds.