How to use pre-built images of android on i.MX5X?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use pre-built images of android on i.MX5X?

2,586 Views
KrishnaPavan
Contributor II

Hi,

I have downloaded Android Source Code & Demo Images.

I would like to go with the usage of prebuilt images!

  • I have u-boot.bin and uImage [pre-built images]
  • Android file system:
  • Initramfs:  imx51_BBG/SD/uramdisk.img
  • System root:  imx51_BBG/SD/system.img
  • Data: imx51_BBG/SD/recovery.img

I know how to load the u-boot.bin & uImage at a particular partition. the same we did with LTIB, I guess!

How to load the rootfs, & How to make use of the above listed images like initramfs?

Please Suggest!

Labels (1)
6 Replies

1,299 Views
KrishnaPavan
Contributor II

The process I have posted is completely wrong.

Many use a script-file to port the images to SD Card.

However, I searched for a correct procedure, and have tried it.

An outline is here.

Partition Type/Index

Name

Start Offset

Size

File System

Content

N/A

BOOT

0

10 MB

N/A

bootloader/kernel/uramdisk images

Primary 1

MEDIA

11 MB

User Defined

VFAT. Mount as /sdcards

Media file storage

Primary 2

SYSTEM

follow MEDIA

>= 200 MB

EXT4. Mount as /system (with read only)

Android system bin/libs (system.img)

Logic 5 (Extended 3)

DATA

follow SYSTEM

> 200 MB

EXT4. Mount as /data

Android data (e.g. installed app)

Logic 6 (Extended 3)

CACHE

follow DATA

> 10 MB

EXT4. Mount as /cache

Android cache

Primary 4

RECOVERY

follow CACHE

> 20 MB

EXT4. Mount as / in recovery mode

Root file system for recovery mode (recovery.img)

1,299 Views
arunmitteam
Contributor III

Hi,

Were you able to boot the android image flash in the sd card? I'm trying to boot the imx53 with adeneo prebuilt image but I think I'm missing something. As you have mentioned above I just used the prebuilt script that comes with the download.

I formatted the sd card and just executed the ./flash_prebuilt_android.sh /dev/sda. The script runs successfully but I'm unable to boot the board. Are my steps correct? if so how do I check the boot log when I power up the imx53 board?

Please suggest. Thanks in advance.

0 Kudos
Reply

1,299 Views
JayZhang
Contributor I

u-boot-no-padding.bin means you have skip 1k space in sdcard, so these two ways are the same, I think you can try to change a sdcard two dd your image.


Krishna Pavan said:

Hi,

Should I use

sudo dd if=u-boot.bin of=u-boot-no-padding.bin bs=1K skip=1; sync   <---

0 Kudos
Reply

1,299 Views
KrishnaPavan
Contributor II

Hi,

Should I use

sudo dd if=u-boot.bin of=u-boot-no-padding.bin bs=1K skip=1; sync   <---

0 Kudos
Reply

1,299 Views
KrishnaPavan
Contributor II

Hi, Here's what I have tried, but could not get result in my project.

                                                                Download the u-boot image:
sudo dd if=u-boot.bin of=/dev/sdb bs=1K skip=1 seek=1; sync
                                                                Or If you are using no padding u-boot image:
sudo dd if=u-boot-no-padding.bin of=/dev/sdb bs=1K seek=1; sync
                                                                Download the kernel image:
sudo dd if=uImage of=/dev/sdb bs=1M seek=1; sync
                                                                Download the initramfs image:
sudo dd if=uramdisk.img of=/dev/sdb bs=1M seek=6; sync
                                                                

sudo fdisk /dev/sdb
            u           [switch the unit to sectors instead of cylinders]
            d           [repeat this until no partition is reported by the ‘p’ command ]
            n           [create a new partition]
            p           [create a primary partition]
            1           [the first partition]
            8192      [for kernel and other]
          Until the required
            w           [ this writes the partition table to the medium and fdisk exits]

Partitions

sudo mkfs.vfat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2 -O ^extent -L system
sudo mkfs.ext4 /dev/sdb4 -O ^extent -L recovery
mkfs.ext4 /dev/sdb5 -O ^extent -L data
mkfs.ext4 /dev/sdb6 -O ^extent -L cache

                                                                Download the Android system root image:
sudo dd if=system.img of=/dev/sdb2; sync
                                                                Download the Android recovery image:
sudo dd if=recovery.img of=/dev/sdb4; sync


Environment Variables

U-Boot > setenv loadaddr 0x90800000        [0x90800000 for i.MX51, 0x70800000 for i.MX50/3]
U-Boot > setenv rd_loadaddr 0x90C00000    [0x90C00000 for i.MX51, 0x70C00000 for i.MX50/3]
U-Boot > setenv bootcmd 'run bootcmd_SD; bootm ${loadaddr} ${rd_loadaddr}'
U-Boot > setenv bootcmd_SD 'mmc read 0 ${loadaddr} 0×800 0×2000; mmc read 0 ${rd_loadaddr} 0×3000 0×300;'
U-Boot > setenv bootargs console=ttymxc0 init=/init androidboot.console=ttymxc0 di1_primary calibration ip=dhcp gpu_memory=16M
U-Boot > saveenv


Error_Log

PMIC Mode: SPI
Detecting HOME+POWER key for recovery ...
** Bad partition 6 **
Net:   FEC0 [PRIME]
Hit any key to stop autoboot:  0

MMC read: dev # 0, block # 0,count 0 ...
0 blocks read: OK

MMC read: dev # 0, block # 0,count 0 ...
0 blocks read: OK
## Booting kernel from Legacy Image at 90800000 ...
Bad Header Checksum
ERROR: can't get kernel image!

Please Suggest!

0 Kudos
Reply

1,299 Views
XiaoPong
NXP Employee
NXP Employee

sudo dd if=uramdisk.img of=/dev/sdx bs=1M seek=6; sudo dd if=imx51_BBG/SD/system.img of=/dev/sdx2; sudo dd if=imx51_BBG/SD/recovery.img of=/dev/sdx4; sync

0 Kudos
Reply