Just Started Micro2440

November 10, 2010

How to Boot Android from an SD Card

Filed under: Uncategorized — iemasen @ 8:22 am

Steps below are a guideline for booting the Android OS on the Micro2440 SDK with 256M.

Step 1 – Downloading an Android Kernel

[1] UBoot-256MB
[2] Android Kernel
[3] Android Filesystem

Step 2 – Setting Up the ARM Toolchain

If you haven’t set up the ARM Toolchain, follow the guideline in this link.

Step 3 – Partition the SD Card

Refer to How to Partition an SD Card for the steps.

Step 4 – Mount the SD Card

My SD card is mounted using the following names:

/dev/sdb2  –> /media/boot
/dev/sdb3 –> /media/rootfs

The name of boot and rootfs were given during the partition step. It’s up to you to give any names.

Step 5 – Compiling Kernel Image

/android/kernel> cp config_mini2440 .config

Run the menuconfig, but don’t change anything. Just exit from the menuconfig.

/android/kernel> make ARCH=arm menuconfig

Start to compile the Kernel image.

/android/kernel> make ARCH=arm uImage

Step 6 – Copy the Kernel uImage and Filesystem to the SD Card

The resulted uImage can be found in arch/arm/boot directory.

/android/kernel/arch/arm/boot> cp uImage /media/boot/.

Then, copy the contents of fs directory to /media/rootfs. We need to do this first before installing the kernel modules to the filesystem.

/android/fs> cp * /media/rootfs/.

Step 7 – Create Kernel Modules

/android/kernel> make ARCH=arm INSTALL_MOD_PATH=/media/rootfs modules

If you jump directly to modules_install without compiling modules first, you will get an error saying modules.order cannot be found.

/android/kernel> make ARCH=arm INSTALL_MOD_PATH=/media/rootfs modules_install

Step 8 – Setting Up  the Minicom

If we don’t have the Minicom available in our Linux system, then we need to install it first.

> sudo apt-get install minicom

Once it’s installed, we can invoke it from the shell prompt.

> minicom -s

Select “Serial Port Setup”. Enter the following information:

Serial Device: /dev/ttyS0
Bps/Par/Bits: 115200 8N1
Hardware Flow Control: No
Software Flow Control: No

Then select “Exit” and press Enter. Don’t select “Exit from Minicom”, otherwise you are out of minicom.

Step 9 – Downloading UBoot to NAND

Tell vivi that you need 242360 bytes space in the RAM to load something from the USB, starting at 0x31000000. Few examples on the internet ask you to load images to the RAM location 0x32000000. It works fine for small image. For larger image, you must go to a lower address space, such as 0x31000000.

Supervivi> load ram 0x31000000 242360 u

On another shell window, use following command to download u-boot into the RAM of Micro2440.

Supervivi> sudo ./s3c2410_boot_usb UBoot-256MB.bin

The process of downloading the u-boot to the RAM is shown in Figure .

Transferring u-boot from the Linux Host the RAM

Now we are ready to write u-boot from the RAM to NAND flash. It involves a few steps.

Transferring u-boot from the RAM to the NAND

First, we need the execute the u-boot in the RAM, instead of Supervivi in the NOR.

Supervivi> go 0x31000000

When seeing “Hit any key to stop autoboot,” press any key on the keyboard. The prompt shall change from Supervivi> to MINI2440 #.

Next, we need to get the information about the NAND flash.

MINI2440 # nand info

Erase everything on the NAND flash.

MINI2440 # nand scrub

Now create a new partition table.

MINI2440 # nand createbbt

The previous command will create 4 partitions: u-boot, env, kernel and root. You can check the partition list by executing the following command.

MINI2440 # mtdparts

Once we have the NAND flash is ready to be written, now we can start transferring the u-boot from the RAM to the u-boot partition in the NAND.

MINI2440 # nand write 0x31000000 u-boot

This step can be viewed as

Transferring the u-boot from the RAM to the NAND

Now we’re going to boot from the NAND. Move the switch to NAND position and reboot Micro2440. Now you shall see all u-boot informations on the minicom window. Hit any key when you see the promption “Hit any key to stop autoboot.

Step 10 – Set the Boot Environment

This step will copy the kernel from the SD card partition 2 (mmcblk0p2) to the RAM address 0x31000000 and run the booting process from the RAM.

MINI2440 # setenv bootcmd mmcinit \; ext2load mmc 0:2 0x31000000 uImage \; bootm 0x31000000

We also need to inform the u-boot where the rootfs location is and other configurations.

MINI2440 # setenv bootargs root=/dev/mmcblk0p3 rootfstype=ext3 mini2440=1tb rootdelay=3 init=/linuxrc

The description of the bootargs parameters can be seen in this Table.

ENV BOOT Parameters Description
bootargs noninitrd
bootargs mini2440 = Type of display
0 = 3.5 “display N35
1 = 7 “Display
2 = VGA Board
3 = 3.5-inch screen T35
4 = 5.6 “display Innolux
t = Touchscreen
b = Back Light
bootargs rootfstype = File system with rootfs
bootargs root = Description / Drive the rootfs (eg / dev/sda1)
bootargs rw Mount parameters rw = Read / Write, RO = Read Only
bootargs rootwait Waiting for the file system before the boot process continues
bootargs init = Starts the specified program completed after the start of the kernel is.

Now save the environment.

MINI2440 # saveenv

Then, reboot the system.

MINI2440 # reset

You should see the Android OS as shown in the Figure below.


[1] Manual for Compiling Android for Mini2440

[2] Micro2440

[3] HOWTO: Booting from SD Card Using U-Boot

[4] Running the Android OS on the Mini2440

[5] …





  1. Hello, could you please tell me know if my 1GB SD Card is enough to stock Android OS? Thanks so much!


    Comment by Pascal — January 22, 2011 @ 5:58 pm

  2. thanks a lot for your tut, it was a big help,
    I’ve been using the W35 display and when I boot up the display is 90 degrees turned so I can nly see half of it.
    What should I change to get the display wright part from entering 6tb as mini2440 bootargs.

    and thanks

    Comment by Ramzi — May 9, 2012 @ 4:11 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: