Booting Android on imx7 dual using SD card

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Booting Android on imx7 dual using SD card

3,808 次查看
mehulshah
Contributor III

Hi ,

I am trying to boot Android pre-built images on IMX 7 sabre board dual using SD card ; please let me know the steps for the same.(from how to make partition to which images need to put ). i have downloaded pre-built images from nxp site.

i have made partition as seen in the attached image.

then , i wrote partition by following command.

sudo dd if=u-boot-imx7d.bin of=/dev/sdd bs=1K seek=1
sudo dd if=boot-imx7d.img of=/dev/sdd1 bs=1K seek=1
sudo dd if=system.img of=/dev/sdd2 bs=1K seek=1
sudo dd if=recovery-imx7d.img of=/dev/sdd3 bs=1K seek=1

and then at stopping at bootloader , i tried to load the boot.img at load address 0x80800000 (shown in environment variable as load address) using fatload command .but getting following error
U-Boot 2015.04-00392-g6581aea-dirty (Jul 02 2016 - 18:26:46)

CPU:   Freescale i.MX7D rev1.2 at 792 MHz
CPU:   Temperature 38 C
Reset cause: POR
Board: i.MX7D SABRESD RevA
I2C:   ready
DRAM:  1 GiB
PMIC: PFUZE300 DEV_ID=0x30 REV_ID=0x11
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

No panel detected: default to TFT43AB
Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
check_and_clean: reg 0, flag_set 0
Cannot find partition 8
rw_block, get_block_size return 0
read_bootctl, rw_block read failed
read command failed
Fastboot: Normal
flash target is MMC:0
Bad partition index:4 for partition:data
Net:   FEC0
Normal Boot
Hit any key to stop autoboot:  0
=> printenv  
baudrate=115200
bootcmd=boota mmc0
bootdelay=3
ethact=FEC0
ethaddr=00:04:9f:04:8e:f2
ethprime=FEC
fastboot_dev=mmc0
fdt_high=0xffffffff
initrd_high=0xffffffff
loadaddr=0x80800000
splashpos=m,m

Environment size: 216/8188 bytes

=> help boota
boota - boota   - boot android bootimg from memory

Usage:
boota [<addr> | mmc0 | mmc1 | mmc2 | mmcX] [<partition>]
    - boot application image stored in memory or mmc
        'addr' should be the address of boot image which is zImage+ramdisk.img
        'mmcX' is the mmc device you store your boot.img, which will read the boot.img from 1M offset('/boot' partition)
         'partition' (optional) is the partition id of your device, if no partition give, will going to 'boot' partition

=> boota mmc0
boota mmc0
boota: bad boot image magic

=> mmc rescan
=> fatload mmc 0:1 0x800800000 boot-imx7d.img
reading boot-imx7d.img
MMC: block number 0xc94767b exceeds max 0x1cea000)
I am struggling to boot kernel (boot.img) , please let me know , what is missing ?

标签 (1)
5 回复数

2,272 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Mehul Shah,

Are you using the M6.0.1_2.1.0 Image bundle?

The overall procedure looks okay. However, the partitions for Marshmallow are different than what you seem to be using. There are more details on the Android User’s Guide on how to create the partitions.

 

Also I think one of the problems may be the u-boot file used. Was there a u-boot-imx7d.imx file on your image bundle?  If so please use the file, so the command would be:

sudo dd if=u-boot-imx7d.imx of=/dev/sdd bs=1K seek=1; sync

It is a good idea to add the sync instruction after each of the dd commands.

The rest of the dd commands do not need a seek parameter but it’s also a good idea to add the sync.

sudo dd if=boot-imx7d.img of=/dev/sdd1 ; sync

As for the system image you would need to first convert it to a raw system image in order to load it with dd directly into your partition:

sudo simg2img system.img system_raw.img

sudo dd if=system_raw.img of=/dev/sdd5 ; sync

(This tool is located on myandroid/out/host/linux-x86/bin/simg2img when you install the Android BSP. Since you are using the image bundle you may obtain the tool from elsewhere, here is an alternative from another forum:

http://muzso.hu/2012/08/10/how-to-pack-and-unpack-system.img-and-userdata.img-from-an-android-factor...)

sudo dd if=recovery-imx7d.img of=/dev/sdd2 ; sync

 

The u-boot included with the image bundle should have the parameters to boot from the SD card so you may try without changing the load address. (Regardless, I think the seek parameters where the culprit as to why the load address wasn’t working in this case)

I hope this helps!

Regards,

2,272 次查看
mehulshah
Contributor III

Hi Gusarambula ,

Thanks for your reply .

i had downloaded binaries from below link

IMX6_M6.0.1_2.1.0_ANDROID_DEMO_iMX7D_BSP

Now , i have done partition as before (PFA) but now i am booting the board with uboot-imx7d.imx in place of uboot-imx7d.bin and dd the images without seek parameter except in uboot-imx7d.imx. and i am getting the logs . please find the log as an attachment.(PFA) , but i am not getting full logs of android .

So Now , as suggested by you , i am going to make the partition according to mentioned in the android user guide

http://support.keith-koep.com/service/lib/exe/fetch.php/service/linux/android_user_guide.pdf

But , if you see on page 11 of the doc , i have some confusion . please answer .

1> i will not have to reserve separate partition for u-boot as i did before and will flash/write uboot-imx7d.img into /dev/sdd partition. right ?

2>on the page 11 , if you see , for boot-imx7d.img partition , file system type for boot partition is boot.img format , so for this partition , what type of file system should i keep , because there is no option called boot.img format while making partition. should i make it FAT32 ? or what ?

one more thing , it will be very nice , if you explain in a line or two regarding the problem , we were having due to "seek " parameter in the dd command . why seek causing a problem ? that will help me to understand the problem better.

Thanks ,

Mehul

2,272 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Mehul Shah,

U-boot does not need a logical partition, rather you would just leave space at the beginning of the SD card to accommodate it and load it directly to the 1K position. You may see more details on the Storage Partitions section (5.1.1) of the Android user’s guide.

The seek parameter is given on the case of the u-boot because the i.MX7 ROM code will look for the bootloader on the 1K location of memory of the bootable device. More details on how the boot is executed may be found on the i.MX7 Reference Manual.

The boot partition may be a FAT32, yes. The document is not clear on this. Thanks for pointing it out!

As a side note, if you are having problems creating the partitions one useful resource is the Manufacturing Tool which you can find on the i.MX7 SABRE downloads page. However I think you’re pretty much there going the manual route.

Regards,

2,272 次查看
mehulshah
Contributor III

Hi Gusarambula ,

Thanks for the reply....

Now i have created 9 partition (First two of FAT32 type , one extended , others are ext4 file system type of random size) and then i

executed below commands.

sudo dd if=u-boot-imx7d.imx of=/dev/sdd bs=1k seek=1 ; sync
sudo dd if=boot-imx7d.img of=/dev/sdd1 ; sync
sudo dd if=recovery-imx7d.img of=/dev/sdd2 ; sync
sudo dd if=system_raw.img of=/dev/sdd4 ; sync

then i am getting the logs as seen in the attachment.

there are couple of errors :

1>EXT4-fs (mmcblk0p4): Ignoring removed nomblk_io_submit option

Regarding which i got following link :

 https://community.nxp.com/thread/388907#comment-631817  , in which ramdisk fstab file he is suggesting to modify , since i am having

boot.img(kernel + ramdisk) and ramdisk.img , then from where i will get the ramdisk fstab file  and modify it ?

2> there are some errors related to

init: SELinux: Could not set context for /data:  Permission denied .

I think , these all related to partition only ....

so can you please point out what is missing .

Also , you suggested about manufacturing tool for flashing , which works in windows only. i am using Ubunut.

Regards,

Mehul

2,272 次查看
mehulshah
Contributor III

Hi Gusarambula ,

Thanks for your reply .

i had downloaded binaries from below link

IMX6_M6.0.1_2.1.0_ANDROID_DEMO_iMX7D_BSP 

Now , i have done partition as before (PFA) but now i am booting the board with uboot-imx7d.imx in place of uboot-imx7d.bin and dd the images without seek parameter except in uboot-imx7d.imx. and i am getting the logs . please find the log as an attachment.(PFA) , but i am not getting full logs of android .

So Now , as suggested by you , i am going to make the partition according to mentioned in the android user guide

http://support.keith-koep.com/service/lib/exe/fetch.php/service/linux/android_user_guide.pdf 

But , if you see on page 11 of the doc , i have some confusion . please answer .

1>  i will not have to reserve separate partition for u-boot as i  did before and will flash/write uboot-imx7d.img into /dev/sdd partition. right ?

2>on the page 11 , if you see , for boot-imx7d.img  partition , file system type for boot partition  is boot.img format , so for this partition , what type of file system should i keep , because there is no option called boot.img format while making partition. should i make it FAT32 ? or what ?

3> Also , using gparted , i am making partitions ; But gparted do not let me to make many logical partitions as mentioned in the document.so how can i make such partition

as i do not have the script that make such partition .

one more thing , it will be very nice , if you explain in a line or two regarding the problem , we were having due to "seek " parameter in the dd command . why seek causing a problem ? that will help me to understand the problem better.

Thanks and Regards,

Mehul

0 项奖励
回复