Android on the Digi ConnectCore Wi-i.MX51

Android is an interesting platform for embedded devices of many types, not just phones. There are ports for various development boards, including the Beagleboard. To get an idea of how easy it is to implement on a new platform, I ported it to the Digi Wi-i.MX51 Jumpstart board which I reviewed earlier (see http://www.embedded-linux.co.uk/hardware/ccwi.imx51). I will post full details to Inner Penguin later. In this article I just want to show the end result.

Features that work in the current version of the port include

  • touch screen
  • serial port - for console messages
  • USB, e.g. for a keyboard
  • Ethernet
  • SD card

Not working/not tested

  • sound
  • wifi
  • graphical acceleration

For simplicity, I am booting off an SD card and I am putting all the Android files and data into a single partition rather than three separate ones as you would on a production system. You will need an SD card of at least 256 MiB capacity (I used a 4 GiB card). I used Ubuntu 10.04 to format the card but it should work on any Linux distribution.

Partition the SD card
You need to create two partitions:

Partition 1: at least 4 MiB with system id 6 (FAT16), for the kernel
Partition 2: at least 200 MiB with system id 0x83 (Linux), for the root file system

Create a file system of type msdos on the first partition.
Create a file system of type ext3 on the second partition.

Copy the kernel
Download the kernel image from http://www.embedded-linux.co.uk/downloads/uImage-2.6.31-ccwmx51js-android. Copy it to first partition as file "uimage".

Copy the root file system
Download the Android file system image from http://www.embedded-linux.co.uk/downloads/android-fs-2.1-ccwimx51.tar.gz. Un-tar it to the second partition.

Un-mount both partitions.
Remove the SD card and plug it into the ccwimx51 board.

Configure u-boot
Connect a serial cable to the console port on the board and start a terminal emulator (I use minicom) with a baudrate of 38400 and no hardware or software flow control.

Turn on the board and hit Ctrl-C to get to a U-Boot prompt (CCWMX51 #). Type the following, making sure that the two setenv commands are all on one line:

setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=0xb302 rw rootdelay=4 init=/init androidboot.console=ttymxc1 

setenv bootcmd mmc rescan 1\;fatload mmc 1:1 a0000000 uimage\;bootm a0000000

saveenv

Turn off the board.

Using Android

With the SD card in the SD slot on the board turn it on. On the LCD display you should see the normal penguin logo, then the word “Android” followed by an animated Android logo and finally the Android screen.

The screen is locked initially. Normally you would press the Menu button to unlock it, so I have mapped the button user marked BUTTON1 as “Menu” and also BUTTON2 as “Home”. Pressing BUTTON1 should bring you to this screen.

Press BUTTON2 (Home) to get back here at any time. With a combination of these two buttons and the touch screen you can navigate around most of the Android apps. Or, you can plug in a USB keyboard in which case you will find

HOME - Home
F1 - Menu
F4 - suspend/resume
Cursor keys - as you would expect

You can access the network via Ethernet: it will attempt to contact a local DHCP server as it boots up and configure the network from that.

You can get a root shell either via the serial terminal, or if you have a copy of adb (Android Debug Bridge) by typing

adb connect [IP address of the board]:5555 
adb shell

Enjoy!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi, its cool Android works

Hi, its cool Android works with this board :)

I try booting from MicroSD, and I modify:

setenv bootcmd mmc rescan 0\;fatload mmc 0:1 a0000000 uimage\;bootm a0000000

Kernel booting OK, but later can't find root file system, i have error with wrong blocks or something.
I'ts possible booting this image from MicroSD or only from SD/MMC?

You need change the kernel boot args

You need to change the kernel boot args so it mounts the rootfs from mmcblk1 partition 2. In u-boot, enter
setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=/dev/mmcblk1p2 rw rootdelay=4

or, I think that
setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=root=0xb30a rw rootdelay=4

would work as well.
Bye,
Chris

Please ignore my last message

I was wrong: if a micro SD card is detected at boot it will become /dev/mmcblk0 (NOT mmcblk1) so the kernel command line should remain the same. It seems that there is a problem with the micro SD driver: you will have to use full-size SD cards for this demo.

Chris.

VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)

Hi,

The port to Android is certainly exciting and I look forward to your detailed tutorial. However, I have been doing some of my own experiments, similar to bodzio which are resulting in similar problems.

I have pasted my findings and would appreciate any assistance, I have a this in a document with full scripting but could not find a means of uploading such a file.

Regards,
Tom

Using an 8Gb Sandisk MicroSD card

Using fdisk to check my partitions are the correct file system

Device Boot Start End Blocks Id System
/dev/sdb1 1 3 24066 6 FAT16
/dev/sdb2 4 67 514080 83 Linux

Checking contents of partition 1
root@SuperComputer:/media/Part1# ls -a
. .. uimage

un-tar'ing the android root contents to partition 2
tar -C /media/Part2 -zxvf /home/tom/Downloads/android-fs-2.1-ccwimx51.tar.gz

checking contents of partition 2
root@SuperComputer:/media/Part2# ls -a
. .. cache data default.prop dev etc extsd init init.goldfish.rc init.rc lost+found proc sbin sdcard sqlite_stmt_journals sys system ts.log udisk

This is an extract from the terminal window in DIGI ESP, when the following environment variables are set:

bootcmd=mmc rescan 0;fatload mmc 0:1 a0000000 uimage;bootm a0000000

setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=/dev/mmcblk0p2 rw rootdelay=4 init=/init androidboot.console=ttymxc1

Starting kernel ...

Uncompressing Linux........................................................................................................................................ done, booting the kernel.
Linux version 2.6.31 (chris@chris-laptop) (gcc version 4.4.3 (GCC) ) #1 PREEMPT Wed Jul 21 12:03:11 BST 2010
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Digi ConnectCore Wi-MX51 on a JSK Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 113792
Kernel command line: console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=/dev/mmcblk0p2 rw rootdelay=4 init=/init androidboot.console=ttymxc1
Unknown boot option `androidboot.console=ttymxc1': ignoring

it continues and ends in ...

input: 2.4GHz 2way RF Desktop Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input2
generic-usb 0003:1BCF:05C5.0001: input: USB HID v1.00 Keyboard [2.4GHz 2way RF Desktop Receiver] on usb-fsl-ehci.0-1.1/input0
input: 2.4GHz 2way RF Desktop Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.1/1-1.1:1.1/input/input3
generic-usb 0003:1BCF:05C5.0002: input: USB HID v1.00 Mouse [2.4GHz 2way RF Desktop Receiver] on usb-fsl-ehci.0-1.1/input1
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)
Please append a correct "root=" boot option; here are the available partitions:
1f00 768 mtdblock0 (driver?)
1f01 512 mtdblock1 (driver?)
1f02 40960 mtdblock2 (driver?)
1f03 482048 mtdblock3 (driver?)
b300 7977472 mmcblk0 driver: mmcblk
b301 24066 mmcblk0p1
b302 514080 mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

Then I tried modifying the bootargs command to:

bootargs=console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=/dev/mmcblk0p2 rootwait

input: mxc_ts as /devices/virtual/input/input1
mxc input touchscreen loaded
pmic_rtc pmic_rtc.1: setting system clock to 1970-03-15 11:15:26 UTC (6347726)
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address d555
mmcblk0: mmc0:d555 SU08G 7.60 GiB (ro)
mmcblk0: p1 p2
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)
Please append a correct "root=" boot option; here are the available partitions:
1f00 768 mtdblock0 (driver?)
1f01 512 mtdblock1 (driver?)
1f02 40960 mtdblock2 (driver?)
1f03 482048 mtdblock3 (driver?)
b300 7977472 mmcblk0 driver: mmcblk
b301 24066 mmcblk0p1
b302 514080 mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

This time it looks to recognise the card as it decodes some of its details.

I then tried subtituting in the hexadecimal address:

setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=0xb302 rootwait

input: mxc_ts as /devices/virtual/input/input1
mxc input touchscreen loaded
pmic_rtc pmic_rtc.1: setting system clock to 1970-03-15 11:30:14 UTC (6348614)
mmc0: new high speed SDHC card at address d555
VFS: Cannot open root device "0xb302" or unknown-block(179,2)
Please append a correct "root=" boot option; here are the available partitions:
1f00 768 mtdblock0 (driver?)
1f01 512 mtdblock1 (driver?)
1f02 40960 mtdblock2 (driver?)
1f03 482048 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

then with the hexadecimal root=root

setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=root=0xb302 rw rootdelay=4 init=/init androidboot.console=ttymxc1

input: mxc_ts as /devices/virtual/input/input1
mxc input touchscreen loaded
pmic_rtc pmic_rtc.1: setting system clock to 1970-03-15 11:38:31 UTC (6349111)
Waiting 4sec before mounting root device...
usb 1-1.1: new low speed USB device using fsl-ehci and address 3
usb 1-1.1: New USB device found, idVendor=1bcf, idProduct=05c5
usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
usb 1-1.1: Product: 2.4GHz 2way RF Desktop Receiver
usb 1-1.1: configuration #1 chosen from 1 choice
input: 2.4GHz 2way RF Desktop Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input2
generic-usb 0003:1BCF:05C5.0001: input: USB HID v1.00 Keyboard [2.4GHz 2way RF Desktop Receiver] on usb-fsl-ehci.0-1.1/input0
input: 2.4GHz 2way RF Desktop Receiver as /devices/platform/fsl-ehci.0/usb1/1-1/1-1.1/1-1.1:1.1/input/input3
generic-usb 0003:1BCF:05C5.0002: input: USB HID v1.00 Mouse [2.4GHz 2way RF Desktop Receiver] on usb-fsl-ehci.0-1.1/input1
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "root=0xb302" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00 768 mtdblock0 (driver?)
1f01 512 mtdblock1 (driver?)
1f02 40960 mtdblock2 (driver?)
1f03 482048 mtdblock3 (driver?)
b300 7977472 mmcblk0 driver: mmcblk
b301 24066 mmcblk0p1
b302 514080 mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

I have the same error with

I have the same error with MicroSD. On standard SD Android works OK. But my microSD have badblocks :)
Or something with root file system is wrong: partition, slowmmc, bootargs...

The micro SD driver seems to have a problem

Please use full-size SD cards for the time being.

Chris.

SD Worked :)

Hi,

I have booted Android using the standard SD card. I partioned my card into three FAT16-EXT3-FAT16. The idea was that I hoped that Android would detect my third partition for user files (audio, pictures ....) - but it did not.

I would be interested to learn how to find a distribution, such as Android and compile it into an image file and how to customise the Kernal for the digi board .... are there any tutorials? Is it possible to remove the phone related pharses from Android?

Regards,
Tom

Source Code

hi, i booted my Digi ConnectCore Wi-i.MX51 with your ubuntu and android images that you uploaded and they work great.
do you have the source code of android and also the toolchain? or where can i get them? i want to build my own and do some changes. or do you know a forum or something like that related the Digi ConnectCore Wi-i.MX51 where to collaborate?

Regards

Didn't Work...

Hello,

I tried as you described, but my Android hangs. I shows the small penguin on the screen but then nothing happens. The output of the serial console is the following:
U-Boot 2009.08 - DUB-1.0-3P - (Mar 29 2010 - 14:52:55) - GCC 4.3.2
for ConnectCore Wi-i.MX51 on a JSK Development Board

I2C: ready
NAND: 512 MB
DRAM: 512 MB
MMC: FSL_ESDHC: 0, FSL_ESDHC: 1
In: serial
Out: serial
Err: serial
Net: FEC0
Autoscript from TFTP... [not available]
Hit any key to stop autoboot: 0
reading uimage
..........
2147096 bytes read
## Booting kernel from Legacy Image at a0000000 ...
Image Name: Linux-2.6.31
Created: 2010-07-21 11:03:15 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2147032 Bytes = 2 MB
Load Address: 90008000
Entry Point: 90008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux........................................................................................................................................ done, booting the kernel.
Linux version 2.6.31 (chris@chris-laptop) (gcc version 4.4.3 (GCC) ) #1 PREEMPT Wed Jul 21 12:03:11 BST 2010
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Digi ConnectCore Wi-MX51 on a JSK Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 113792
Kernel command line: console=ttymxc1,38400 video=displayfb:LCD wvga calibration root=0xb302 rw rootdelay=4 init=/init androidboot.console=ttymxc1
Unknown boot option `androidboot.console=ttymxc1': ignoring
PID hash table entries: 2048 (order: 11, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 448MB = 448MB total
Memory: 449736KB available (3848K code, 709K data, 136K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:272
MXC IRQ initialized
Console: colour dummy device 80x30
Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
CPU is i.MX51 Revision 3.0
MXC GPIO hardware
iomux_config_mux: Warning: iomux pin config changed, reg=fb0a83b0, prev=0x11 new=0x1
IRAM READY
mxc_init_dvfs_per initialised
mxc_pwm_device registered
Using SDMA I.API
MXC DMA API initialized
bio: create slab at 0
SCSI subsystem initialized
CSPI: mxc_spi-0 probed
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
MXC I2C driver
MXC HS I2C driver
IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
mc13892 Rev 2.0 FinVer 2 detected
Initializing regulators for CCWMX51JS.
regulator: SW1: 600 <--> 1375 mV
regulator: SW2: 900 <--> 1850 mV
regulator: SW3: 1100 <--> 1850 mV
regulator: SW4: 1100 <--> 1850 mV
regulator: SWBST: 0 mV
regulator: VIOHI: 0 mV
regulator: VPLL: 1050 <--> 1800 mV
regulator: VDIG: 1050 <--> 1800 mV
regulator: VSD: 1800 <--> 3150 mV
regulator: VUSB2: 2400 <--> 2775 mV
regulator: VVIDEO: 2775 mV
regulator: VAUDIO: 2300 <--> 3000 mV
regulator: VCAM: 2500 <--> 3000 mV fast normal
regulator: VGEN1: 1200 <--> 3150 mV
regulator: VGEN2: 1200 <--> 3150 mV
regulator: VGEN3: 1800 <--> 2900 mV
regulator: VUSB: 0 mV
regulator: GPO1: 0 mV
regulator: GPO2: 0 mV
regulator: GPO3: 0 mV
regulator: GPO4: 0 mV
Device spi1.0 probed
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
NET: Registered protocol family 1
LPMode driver module loaded
Static Power Management for Freescale i.MX51
PM driver module loaded
sdram autogating driver module loaded
Bus freq driver module loaded
Using LDC wvga video timings and mode 800x480-16@60
usb: Host 1 host (isp1504) registered
mxc_dvfs_core_probe
DVFS driver module loaded
i.MXC CPU frequency driver
DVFS PER driver module loaded
ashmem: initialized
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 878
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
mxc_ipu mxc_ipu: Channel already disabled 9
mxc_ipu mxc_ipu: Channel already uninitialized 9
Console: switching to colour frame buffer device 100x30
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x73fbc000 (irq = 31) is a Freescale i.MX
mxcintuart.1: ttymxc1 at MMIO 0x73fc0000 (irq = 32) is a Freescale i.MX
console [ttymxc1] enabled
mxcintuart.2: ttymxc2 at MMIO 0x7000c000 (irq = 33) is a Freescale i.MX
loop: module loaded
pmem_adsp: 0 init
pmem_gpu: 1 init
FEC Ethernet Driver
fec: PHY @ 0x0, ID 0x0007c0f1 -- LAN8710
MXC MTD nand Driver 2.5
NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung NAND 512MiB 3,3V 8-bit)
RedBoot partition parsing not available
Creating 4 MTD partitions on "NAND 512MiB 3,3V 8-bit":
0x000000000000-0x0000000c0000 : "U-Boot"
0x0000000c0000-0x000000140000 : "U-Boot Environment"
0x000000140000-0x000002940000 : "Kernel"
0x000002940000-0x000020000000 : "RFS"
usbmon: debugfs is not available
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

That's it! Any suggestions?

Kind regards,

Christopher

I'm having the same problem.

I'm having the same problem. Did you ever figure this out?

DNS settings

Hi,
Android is running on our demo kit, but there is no internet connection possible until the command on the android console "setprop net.dns1 our_dns_ip_address" is given. After turning off the board, the command must be repeated. DHCP has been enabled in u-boot.
Is there any way to configure this permanently ?
Vincent

I had set my env variables as

I had set my env variables as shown below:

CCWMX51 # setenv bootargs console=ttymxc1,38400 video=displayfb:LCD wvga calibra
tion root=/dev/mmcblk1p2 rw rootdelay=10 init=/init androidboot.console=ttymxc1
CCWMX51 # setenv bootcmd mmc rescan 0\; fatload mmc 0:1 a0000000 uimage\;bootm a
0000000
CCWMX51 # saveenv

PS: I am using microSD card for booting Linux Kernel & Normal SD card for AndroidFS.

With the above configuration I am getting the below error:

====================================================================================

WARNING: at kernel/workqueue.c:368 flush_cpu_workqueue+0x34/0xc8()
Modules linked in:
[] (unwind_backtrace+0x0/0xd8) from [] (warn_slowpath_common
+0x48/0x60)
[] (warn_slowpath_common+0x48/0x60) from [] (flush_cpu_workq
ueue+0x34/0xc8)
[] (flush_cpu_workqueue+0x34/0xc8) from [] (tty_ldisc_releas
e+0x20/0x68)
[] (tty_ldisc_release+0x20/0x68) from [] (tty_release_dev+0x
408/0x464)
[] (tty_release_dev+0x408/0x464) from [] (tty_release+0x14/0
x20)
[] (tty_release+0x14/0x20) from [] (__fput+0x104/0x1fc)
[] (__fput+0x104/0x1fc) from [] (filp_close+0x6c/0x78)
[] (filp_close+0x6c/0x78) from [] (put_files_struct+0x7c/0xd
0)
[] (put_files_struct+0x7c/0xd0) from [] (binder_deferred_fun
c+0x500/0x544)
[] (binder_deferred_func+0x500/0x544) from [] (worker_thread
+0x184/0x230)
[] (worker_thread+0x184/0x230) from [] (kthread+0x78/0x80)
[] (kthread+0x78/0x80) from [] (kernel_thread_exit+0x0/0x8)
---[ end trace 682bf6297ea6ab9a ]---
binder: 1163: binder_alloc_buf, no vma
binder: 1188:1191 transaction failed 29201, size60-0
init: untracked pid 1141 exited
binder: 1163: binder_alloc_buf, no vma
binder: 1188:1191 transaction failed 29201, size60-0
binder: 1141: binder_alloc_buf, no vma
binder: 1212:1212 transaction failed 29201, size76-4
binder: 1141: binder_alloc_buf, no vma
binder: 1212:1212 transaction failed 29201, size84-0
pmem: no space left to allocate!
pmem: could not find allocation for map.
request_suspend_state: wakeup (0->0) at 77894868523 (1970-04-08 19:49:28.3185847
43 UTC)
init: untracked pid 1212 exited
binder: 1141: binder_alloc_buf, no vma
binder: 1259:1259 transaction failed 29201, size76-4
binder: 1141: binder_alloc_buf, no vma
binder: 1259:1259 transaction failed 29201, size84-0
pmem: no space left to allocate!
pmem: could not find allocation for map.
request_suspend_state: wakeup (0->0) at 83774463521 (1970-04-08 19:49:34.1981804
91 UTC)
====================================================================================

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Youtube and Vimeo video links are automatically converted into embedded videos.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.