Author Topic: Flash erase failed.  (Read 3505 times)

alex (OP)

  • Posts: 3
Flash erase failed.
« on: November 18, 2012, 06:29:53 pm »
Hi,

I just got a A320 from dx. I first thought it was dead since it doesn't turn on (even after charging).
I tried to install Dingux without success... but the screen does turn on and the machine is able to execute code: it is not completely dead :-)!

I have the following error when running the dual boot installer:
"Flash erase failed, you will most likely have to do a full firmware restore, sorry. Please report this failure."

My config:
A320 9338

Steps:
1) download  http://dingoo-linux.googlecode.com/files/dingux_dual_boot_installer_20110420.zip
2) # ./usbtool-linux 1 hwinit_ILI9338.bin 0x80000000 (I can see the screen with "Dingux" written on it)
3) # ./usbtool-linux 1 zImage_dual_boot_installer_ILI9338 0x80600000 (reboot is fine and I see the screen with "Continue" at the bottom)
4) press start button (I see the screen with "Acceptance of Terms")
5) press start button, select YES, press start button
6) select either "dual-boot" or "original firmware" (I've tried both) and press start button (I see the screen with "About to write DUAL_BOOT SPL to NAND flash, do you want to continue?)
7) select YES and press start button -> "Flash erase failed, you will most likely have to do a full firmware restore, sorry. Please report this failure."

How can I check if there is a NAND hardware failure? Is that even possible?
How can I do this firmware restore from a computer under GNU/Linux?
Is there another way to install Dingux?

Thanks for your help,
/Alex



*** output of step 2
USBtool v0.4 - (C) 2008 Maurus Cuelenaere
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[INFO] File size: 6560 bytes
[INFO] Searching for device...
[INFO] Found device, uploading application.
[INFO] GET_CPU_INFO: JZ4740V1
[INFO] SET_DATA_ADDRESS to 0x80000000... Done!
[INFO] Sending data... Done!
[INFO] Verifying data... Done!
[INFO] Booting device [STAGE1]... Done!

*** output of step 3
# ./usbtool-linux 1 zImage_dual_boot_installer_ILI9338 0x80600000
USBtool v0.4 - (C) 2008 Maurus Cuelenaere
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[INFO] File size: 3256320 bytes
[INFO] Searching for device...
[INFO] Found device, uploading application.
[INFO] GET_CPU_INFO: JZ4740V1
[INFO] SET_DATA_ADDRESS to 0x80600000... Done!
[INFO] Sending data... Done!
[INFO] Verifying data... Done!
[INFO] Booting device [STAGE1]... Done!

mth

  • *
  • Posts: 298
Re: Flash erase failed.
« Reply #1 on: November 20, 2012, 09:33:37 pm »
What you could try is in step 3, instead of uploading the installer, upload the OpenDingux kernel. Once OD is booted, log in with telnet and in "dmesg" check what it says about the NAND.

alex (OP)

  • Posts: 3
Re: Flash erase failed.
« Reply #2 on: November 21, 2012, 06:45:47 am »
Thanks for your help.

Booting from OD is ok. Dmesg says the following about NAND:

***
$ telnet 10.1.0.2
Trying 10.1.0.2...
Connected to 10.1.0.2.
Escape character is '^]'.

 _________________________
< Welcome to OpenDingux ! >
 -------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

opendingux:/boot/local/home # dmesg | grep -i nand
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit)
jz4740-nand jz4740-nand.0: Found chip 0 on bank 1
jz4740-nand jz4740-nand.0: No chip found on bank 2
jz4740-nand jz4740-nand.0: No chip found on bank 3
jz4740-nand jz4740-nand.0: No chip found on bank 4
nand_bbt: ECC error in BBT at 0x000000200000
Creating 4 MTD partitions on "jz4740-nand":
end_request: I/O error, dev ccnanda, sector 0
Buffer I/O error on device ccnanda, logical block 0
end_request: I/O error, dev ccnanda, sector 0
Buffer I/O error on device ccnanda, logical block 0
 ccnanda: unable to read partition table
end_request: I/O error, dev ccnandb, sector 0
Buffer I/O error on device ccnandb, logical block 0
end_request: I/O error, dev ccnandb, sector 0
Buffer I/O error on device ccnandb, logical block 0
 ccnandb: unable to read partition table
jz4740-nand jz4740-nand.0: Successfully registered JZ4740 NAND driver
end_request: I/O error, dev ccnanda, sector 0
end_request: I/O error, dev ccnanda, sector 0
FAT-fs (ccnanda): unable to read boot sector
end_request: I/O error, dev ccnandb, sector 0
end_request: I/O error, dev ccnandb, sector 0
FAT-fs (ccnandb): unable to read boot sector
opendingux:/boot/local/home #
***

Can we be sure at this point that it is a hardware failure?
Or is the flash chip not correctly handled by the NAND driver?
If it is a hardware failure, isn't it possible to tell the chip to mark sector 0 as dead?

Thanks,
/Alex

mth

  • *
  • Posts: 298
Re: Flash erase failed.
« Reply #3 on: November 21, 2012, 01:06:05 pm »
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit)
This (0xec, 0xd7) is the exact same chip I've got in my A320, so at least it isn't an issue with the type of NAND used.

nand_bbt: ECC error in BBT at 0x000000200000
This might be the cause for all the other errors. BBT is the Bad Block Table, the administration area that keeps track of which blocks are bad. If that administration itself is corrupted, Linux probably assumes the worst and considers all blocks bad.

In theory there should be a backup BBT somewhere on the NAND, but I've never seen one in the NAND dumps I looked at. A possible location for the backup BBT is block 3. I don't remember exactly how do make NAND dumps though, maybe Ayla can help you with this.

You could also try to erase the main bad block table (block 4). Linux will write a new BBT if none is found. This would only help if the corruption of the BBT is an unlucky accident and block 4 itself is undamaged. Also it will lose all info about possible bad blocks on the NAND, so you could get write errors on data later.

Can we be sure at this point that it is a hardware failure?
Yes, but it is uncertain whether it is a transient failure or a permanent one. NAND flash always contains errors, it really needs ECC to be usable at all, but usually the level of errors is within the amount the ECC can correct.

Or is the flash chip not correctly handled by the NAND driver?
Unlikely, since it has the same ID that all of the 4GB NAND chip A320s have (some have two 2GB NAND chips instead).

If it is a hardware failure, isn't it possible to tell the chip to mark sector 0 as dead?
That "sector 0" is the first sector within the partition, not the first sector in the chip. Since you're getting read errors on both sector 0 of ccnanda and of ccnandb, I'm assuming it's not those sectors that are bad but that the read is not even attempted because the BBT says the blocks containing those sectors are bad (probably because the BBT itself was discarded after the ECC failure).

As a workaround, you could boot OpenDingux via USB (as you already did) and never turn off the device, only suspend it. Suspend to RAM drains the battery in about a day, so you would have to regularly recharge the device, but at least it is usable.

For a real solution, try to find out if there is a backup BBT or try to erase the main BBT, as outlined above.

alex (OP)

  • Posts: 3
Re: Flash erase failed.
« Reply #4 on: November 25, 2012, 10:59:31 am »
Thanks for the detailed answer.

As suggested by mth and following Ayla's instructions, I tried to erase block 4.
It seems that block 4 has been erased successfully but Linux did not write a new BBT?

# ./src/jzboot -i 0 -C config/initial.cfg
Shell: using command set 'SPL', run 'help' for command list. CPU: 4740
jzboot> boot
Shell: using command set 'USBBoot', run 'help' for command list. CPU: 4750
jzboot> nerase 0 4 1
jzboot> exit

# dmesg | egrep -i -e nand -e bbt
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit)
jz4740-nand jz4740-nand.0: Found chip 0 on bank 1
jz4740-nand jz4740-nand.0: No chip found on bank 2
jz4740-nand jz4740-nand.0: No chip found on bank 3
jz4740-nand jz4740-nand.0: No chip found on bank 4
nand_bbt: ECC error in BBT at 0x000000200000
Creating 4 MTD partitions on "jz4740-nand":
end_request: I/O error, dev ccnanda, sector 0
Buffer I/O error on device ccnanda, logical block 0
end_request: I/O error, dev ccnanda, sector 0
Buffer I/O error on device ccnanda, logical block 0
 ccnanda: unable to read partition table
jz4740-nand jz4740-nand.0: Successfully registered JZ4740 NAND driver
end_request: I/O error, dev ccnanda, sector 0
end_request: I/O error, dev ccnanda, sector 0
FAT-fs (ccnanda): unable to read boot sector


Also, I could not read read data from the NAND using jzboot:


# ./src/jzboot -i 0 -C config/initial.cfg
Shell: using command set 'USBBoot', run 'help' for command list. CPU: 4740
jzboot> boot
jzboot> nquery 0
VID:   EC
PID:   D7
Chip:  55
Page:  B6
Plane: 78
jzboot> ndump 0 0 1 newdump
Ingenic: ECC failure while reading NAND. See UART output for details                                                                                                                                   
jzboot> exit

Where can I see UART output? The newdump file is empty.

Thanks,
/Alex

 

Post a new topic
Post a new topic