NAND corrupt after aborted flashing [SOLVED]

Started by shamada, July 19, 2013, 12:38:26 AM

Previous topic - Next topic

shamada

Hi!

I have tried to flash the preliminary android image into the nand of the a20 board to re-start with a clean slate (and to try the flashing process/tools).
Sadly my Win7 system stalled with a bluescreen while flashing the a20 nand via PhoenixSuit. It got to approx. 95% before crashing.
Now the a20 bootloader sees a valid header on the nand, but crashes instantly (no serial console output at all) when trying to boot from nand.
Booting debian from micro sd card still works like a charm. (Since luckily it's before the nand in the boot order)

Any chance to get it re-flashed via debian from sdcard or via some kind of remote boot? I could set up tftp/nfs for remote booting, but don't know how to set it up for android remote boot environment.

Otherwise, I'll have to go to the shops and get a microsd cardreader for my pc and a second microsd card. (Because booting an android from microsd should still work - and from there i could try re-flashing).

shamada

farlane

Normally you could try flashing MTD partitions from inside a running Linux environment using flash_erase and nandwrite from mtd-utils, but i don't know if thats supported by the A20.

shamada

Might be worth a try. But to do that, I'll first have to figure out how to unpack the nand image supplied by olimex. Because that's in some kind of compressed or sparse format.

I found some utilities last night and managed to split it into some kind of chunks and actually got the kernel and ramdisk for the recovery extracted. But booting those files from tftp didn't work yet. But I'm still trying :-)

shamada

Ok, i got it fixed.

I got myself a cardreader and a shiny new micro-sd card. But for it to work, I first had to convert the android nand image (the preliminary image from the wiki) to a sdcard image.

Note: When I write sdcard, I'm _always_ talking about a _micro_cd-card. This is important, because the sd card slot has a lower boot priority than the nand. Only the micro-sd slot has a higher boot priority.

I followed the instruction at http://linux-sunxi.org/Boot_Android_from_SdCard which were really good and worked quite nice.

Some problems though:
The patching of the mount/device references (which have to be switched from nand to mmcblk) didn't match. But since I still had some stuff on the nand (which just couldn't boot anymore) I could skip this problem. This should be fixable though.

The next problem was that the bootrom somehow didn't accept the sdcard as bootable. I'm not really sure, how this is determined - haven't found any specific docs about this.
But for me the workaround was:
1. Boot from debian sdcard
2. stop auto-boot of u-boot via keypress on serial console (you have 3 seconds afair)
3. switch to freshly created android sdcard
4. type "mmc rescan"
5. type "boot"

And then it got loaded. Yay! I didn't get a fully operational system, but I got the adb daemon. So now I could re-flash the nand using phoenixsuit. (And it didn't crash this time \o/ )

So, in essence and as far as i know - it should be pretty close to impossible to brick the board by flashing. Of course you can always destroy the boards by other means ;-)

Hopefully my misfortune can help others when something similar happens.

shamada