how to flash android in NAND without phonixsuite ..

812 views
Skip to first unread message

Puneet B

unread,
Feb 20, 2014, 1:00:08 AM2/20/14
to linux...@googlegroups.com
Hi all,

I am using A20 humming bird board.

i want to boot android from NAND.

i booted android from sd card successfully.

i want to know boot0 and boot1 , is it common for all A20 board.

and to which sector i need to flash this.

Regards
Punith

Gerardo Di Iorio

unread,
Feb 20, 2014, 3:28:56 AM2/20/14
to linux...@googlegroups.com
On Wed, Feb 19, 2014 at 10:00:08PM -0800, Puneet B wrote:
> Hi all,
>
> I am using A20 humming bird board.
>
> i want to boot android from NAND.
>
> i booted android from sd card successfully.
Good you can share you info on the wiki
>
> i want to know boot0 and boot1 , is it common for all A20 board.
>

try to create an livesuite image and use livesuite.
you can create an livesuite image from android build(see cubieboad info)
http://linux-sunxi.org/Building_Android_TV_image
or modify an existing image
https://www.miniand.com/wiki/Allwinner/Unpacking+and+building+LiveSuit+images

Regards


> and to which sector i need to flash this.
>
> Regards
> Punith
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Puneet B

unread,
Feb 20, 2014, 4:20:09 AM2/20/14
to linux...@googlegroups.com
Hi arete74,

Actually i am not booted android successfully from sdcard.

only u-boot ,kernel  from sdcard and rootfs  mounted from NAND.

sorry for inconvenience.

and also i dont want to flash NAND  from live suite also.

i want to flash in to nand from command line ( by using bootable sd card)

Kindly tell me  how can i do it.

Regards
Punith

Puneet B

unread,
Feb 21, 2014, 2:35:10 AM2/21/14
to linux...@googlegroups.com
Hi ,

Atleast how to flash linux in fresh NAND.

Regards
Punith

ditma...@gmail.com

unread,
Feb 21, 2014, 3:45:02 AM2/21/14
to linux...@googlegroups.com
Am Freitag, 21. Februar 2014 08:35:10 UTC+1 schrieb Puneet B:
> Atleast how to flash linux in fresh NAND.
>
> Regards Punith

read here : http://linux-sunxi.org/Installing_to_NAND

Puneet B

unread,
Feb 21, 2014, 6:18:41 AM2/21/14
to linux...@googlegroups.com, ditma...@gmail.com
 Hi Ditmar,

I already saw this link .

This link will tell us to take the back up of boot0 and boot1.

since i am using custom board.

i have fresh nand.

so how can flash linux into NAND starting from boot0 and boot1.

Regards
Punith

Puneet B

unread,
Feb 21, 2014, 7:21:53 AM2/21/14
to linux...@googlegroups.com, ditma...@gmail.com
Hi Patwood,
 In my himming bird board android is booting fine from NAND.

so i tried to install ubuntu in NAND by this link.

https://www.miniand.com/forums/forums/development/topics/boot-ubuntu-lubuntu-from-internal-4g-flash?page=2

My steps:
1>i booted ubuntu from sdcard.
2>./nand-partv /dev/nand 'linux 8000000'
3>remove sdcard
4>booted from NAND.

i did not done any changes in nanda partition.
(i check by mounting nanda also , but u-boot is not evoked).

in log:

U-Boot 2014.01-rc1-09161-gaf9f405-dirty (Feb 19 2014 - 19:20:31) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: embdes
I2C:   ready
DRAM:  1 GiB
HELLO! BOOT0 is starting!
boot0 version : 2.0.0 �
read dram para.
dram size =1024MB
0x01a48608
super_standby_flag = 0
Succeed in opening nand flash.
block from 2 to 6
deal block 2
Succeed in reading Boot1 file head.
The size of Boot1 is 0x00068000.
The file stored in 0x00000000 of block 2 is perfect.
Check is correct.
Ready to disable icache.
Succeed in loading Boot1.
Jump to Boot1.
[       0.150] boot1 version : 2.0.0
[       0.159] script installed early ok
[       0.160] pmu type = 3
[       0.161] bat vol = 0 mv
[       0.179] axi:ahb:apb=4:2:2
[       0.179] set dcdc2=1400mv, clock=912M successed
[       0.181] key
[       0.194] no key found
[       0.194] flash init start
[       2.177] flash init finish
[       2.203] fs init ok
[       2.531] fattype FAT16
[       2.531] fs mount ok
[       2.536] nand good_block_ratio=944
[       2.536] storage_type=0
[       2.587] 0
[       2.601] set pc
[       2.603] usbdc_vol = 4000, usbdc_cur = 0
[       2.603] usbpc_vol = 4400, usbpc_cur = 0
[       2.606] init to usb pc
[       2.609] set pc
[       2.804] battery enough
[       2.804] power_start=0x00000001
[       2.804] key value = 0
[       2.807] recovery key high 40, low 4
[       2.901] show pic finish
[       2.901] load kernel start
[       2.930] load kernel successed
[       2.931] start address = 0x4a000000
[       2.933] boot1: bad boot image magic, maybe not a boot.img?
[       2.942] power exit detect
[       2.942] usb exit detect
[       2.944] try to fel in 1 secend

Booting stop here.

Regards
Punith

Patrick Wood

unread,
Feb 22, 2014, 9:23:39 PM2/22/14
to linux...@googlegroups.com

Runzhong Yi

unread,
Feb 23, 2014, 3:08:25 AM2/23/14
to linux...@googlegroups.com
I think you should first build a workable SD card, then use the
partition tool to part the nand flash. Remember the first partition
must be a fat partition, and put the second boot loader(provided by
android distribution) and .fex file into this partition, then edit the
.inf file to instruct the second boot loader to load your own u-boot
which must be build from lichee-dev branch. Still you need to transfer
the boot0 to the beginning of nand flash. The boot0 can be extracted
from a android image. After all these steps proves working, write a
script to do it automatically.

Anyway, I didn't do the whole thing like this, but used the original
boot0 and boot1 provided by android and build my own u-boot and
kernel. Just want to be helpful. If you succedeed, I'd like to see you
to share the method.

Olliver Schinagl

unread,
Feb 23, 2014, 11:52:06 AM2/23/14
to linux...@googlegroups.com
On 02/21/14 13:21, Puneet B wrote:
> [ 2.933] boot1: bad boot image magic, maybe not a boot.img?
Your boot1 is not right, boot0 loaded fine from the flash, but it
couldn't find boot1 where it expected it to be.

oliver

Patrick Wood

unread,
Feb 23, 2014, 12:12:30 PM2/23/14
to linux...@googlegroups.com
This from his boot log indicatees that boot1 was found, loaded, and started up okay:

Olliver Schinagl

unread,
Feb 23, 2014, 2:16:05 PM2/23/14
to linux...@googlegroups.com
You are right, boot1 is complaining about not finding boot.axf, my
apologies.

Puneet B

unread,
Mar 13, 2014, 3:12:46 AM3/13/14
to linux...@googlegroups.com, olive...@schinagl.nl
how to erase boot0 and boot1 in nand.

i tried by using mkfs.ext4 /dev/nand.

but still boot0 and boot1 is not erased.

kindly tell me how to erase the nand memory.

Regards
Punith

Runzhong Yi

unread,
Mar 13, 2014, 8:14:12 PM3/13/14
to linux...@googlegroups.com
Maybe the work yuq did sometime ago could help you. Search this
maillist, or see this link: https://github.com/yuq/sunxi-nfc-mtd.
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Igor Cardoso

unread,
Mar 17, 2014, 7:55:18 PM3/17/14
to linux...@googlegroups.com

Hello friend,

I'm new here but I might give you some light of your problem. I tried to do the reverse, use on fresh SD CARD. What I did was:

dd if=boot0_sdcard.fex of=/dev/sdd seek=8 bs=1024
dd if=boot1_sdcard.fex of=/dev/sdd seek=19096 bs=1024

This was for sun6i, Allwinner A31. When I compiled the Kernel (lichee) it compiled boot0_sdcard.fex and boot1_sdcard.fex, also for boot0 and boot1 for NAND. Those parts are on GPT area (see here: http://en.wikipedia.org/wiki/GUID_Partition_Table).
From what I understand (I might be mistaken), they are not "partitions", boot0 and boot1. After them comes U-BOOT. 

I tried without success to place u-boot after boot1, but I manage to solve my problem using the PhoenixCard software from Allwinner to create a SD CARD from my image file. This program placed every file and partition where it should be. 

Sorry I didn't gave you the solution, but I hope those websites can help you find the solution...

By the way, I'm with problem on my SD CARD. You said you did manage to load with success. Mine is with problem trying to find the NAND partiton. My original image file was made to work with NAND Flash, but the project I'm trying to do demands SD CARD. So I removed my NAND and I'm trying to load everything from SD CARD. My kernel tries to find the NAND partitions that don't exist anymore. Do you know where I can change these before compiling my Kernel?

Thanks,
Igor.

Puneet B

unread,
Mar 18, 2014, 1:10:52 AM3/18/14
to linux...@googlegroups.com
Hi Igor,

Thanks for your reply.

i am facing problem in booting  of android4.2 from sdcard.

but for android4.0 you can see this link.

http://linux-sunxi.org/Boot_Android_from_SdCard.

but if you are using android4.2 .

boot u-boot, kernel from sdcard and mount file system from nand which will work.

Regards
Punith

Igor Cardoso

unread,
Mar 18, 2014, 12:29:27 PM3/18/14
to linux...@googlegroups.com


It is impossible to boot via SD CARD on android 4.2? My NAND is gone, I removed it... 

I'm actually using Android 4.1, and I will try 4.2, 4.3, 4.4 in the future.

Thanks for the website, I will try it right away.

Olliver Schinagl

unread,
Mar 23, 2014, 6:59:59 AM3/23/14
to Puneet B, linux...@googlegroups.com
Boot0 and boot1 are BEFORE /dev/nand, you need specialized access to
remove/invalidate them.

Yuq's mtd stuff may be actually used to invalidate nand and make the
board refusing to load it.
Reply all
Reply to author
Forward
0 new messages