This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bad block and ECC error in flash

Hi. I have a problem in replacing Toshiba TC58BVG1S3HTA00 2Gbit nandflash with TC58BVG2S0HTA00 4Gbit flash.
Uboot version is "U-Boot 2013.10-ge408e96", which is from "ti-sdk-am335x-evm-07.00.00.00". Not a single line of flash driver source code in uboot is changed by me.
Everything was fine with 2Gbit flash, until I replaced it with 4Gbit flash.
I read the datasheet of the flash, they are almost the same.


2Gbit
U-Boot# nand info
Device 0: nand0, sector size 128 KiB
Page size 2048 b
OOB size 64 b
Erase size 131072 b

4Gbit
U-Boot# nand info
Device 0: nand0, sector size 256 KiB
Page size 4096 b
OOB size 128 b
Erase size 262144 b

The result of "nand info" is correct.

The steps to reproduce the issue:

1. At first, use "nand scrub.chip" to clear all. Two bad block cannot be cleared.
U-Boot# nand bad
Device 0 bad blocks:
18000000
18040000

2. Read the flash from any address, take 0x00140000 as an example
U-Boot# nand read 0x81000000 0x00140000 1
NAND read: device 0 offset 0x140000, size 0x1
1 bytes read: OK

3. Write
U-Boot# nand write 0x81000000 0x00140000 1
NAND write: device 0 offset 0x140000, size 0x1
1 bytes written: OK

4. Read again, ECC error occurs.
U-Boot# nand read 0x81000000 0x00140000 1
NAND read: device 0 offset 0x140000, size 0x1
nand: error: uncorrectable ECC errors
nand: error: uncorrectable ECC errors
nand: error: uncorrectable ECC errors
nand: error: uncorrectable ECC errors
NAND read from offset 140000 failed -74
0 bytes read: ERROR

5. No new bad blocks yet
U-Boot# nand bad
Device 0 bad blocks:
18000000
18040000

6. Reboot

7. A new bad block at 0x00140000 after reboot
U-Boot# nand bad
Device 0 bad blocks:
00140000
18000000
18040000

8. Do it again at any other address, and more bad blocks appear.

Need some modifications in uboot?

Thanks.