FAQ: MTD/NAND testing(2010-09-21)

Document created by Aaronwu Employee on Aug 28, 2013Last modified by sonic on Sep 8, 2013
Version 2Show Document
  • View in full screen mode

2010-09-21 15:40:41     MTD/NAND testing

Jay Ku (UNITED STATES)

Message: 93710   

 

I'm trying to bring up ubifs on a BF537 board using the 9821 kernel.  Configuration and connection of the flash (NAND04 4Gbit part) is identical to the BF537 Stamp + CF/IDE/NAND expansion board with the exception of a different GPIO for the BUSY line.

 

I can erase/read/write to the flash just fine from u-boot (I can store my kernel and boot out of flash), so I think the part is connected properly.

 

Here's how my board boots:

 

...

 

NAND device: Manufacturer ID: 0x20, Chip ID: 0xdc (ST Micro NAND 512MiB 3,3V 8-bit)

Scanning device for bad blocks

Bad eraseblock 1 at 0x000000020000

Bad eraseblock 3 at 0x000000060000

Bad eraseblock 439 at 0x0000036e0000

Bad eraseblock 869 at 0x000006ca0000

RedBoot partition parsing not available

Creating 2 MTD partitions on "gen_nand":

0x000000000000-0x000000800000 : "linux kernel(nand)"

0x000000800000-0x000020000000 : "file system(nand)"

 

...

 

flash_eraseall work ok (finds a few bad blocks, but completes), and ubiformat seems to work ok (ubiformat /dev/mtd1 -s 512 -O 512), but when I do ubiattach (ubiattach /dev/ubi_ctrl -m 1), it reports lots of errors (not the same on each run) and then fails:

 

root:/> ubiattach /dev/ubi_ctrl -m 1

UBI: attaching mtd1 to ubi0

UBI: physical eraseblock size:   131072 bytes (128 KiB)

UBI: logical eraseblock size:    129024 bytes

UBI: smallest flash I/O unit:    2048

UBI: sub-page size:              512

UBI: VID header offset:          512 (aligned 512)

UBI: data offset:                2048

uncorrectable error :

UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 0:512, read 512 bytes

uncorrectable error :

UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 1:512, read 512 bytes

uncorrectable error :

.

.

UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 3867:0, read 64 bytes

uncorrectable error :

UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 3954:0, read 64 bytes

UBI warning: ubi_scan: 133 PEBs are corrupted

corrupted PEBs are: 0 1 2 3 4 5 35 305 306 307 308 309 518 797 884 966 1250 1398 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1808 1809 1810 1811 1933 2079 2113 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2359 2360 2361 2362 2538 2539 2540 2541 2542 2543 2544 2545 2546 2624 2800 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2870 2983 2994 3149 3349 3350 3351 3352 3353 3354 3355 3356 3358 3387 3440 3540 3541 3542 3576 3653 3654 3655 3656 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3737 3861 3862 3863 3864 3865 3867 3954

UBI error: ubi_read_volume_table: the layout volume was not found

ubiattach: error!: cannot attach mtd1

           error 22 (Invalid argument)

 

The BUSY line from the NAND looks like it's working - at least it's getting back to my micro and appears to be properly allocated when I look at /proc/gpio:

 

root:/> cat /proc/gpio

GPIO_0:         bfin-uart               Peripheral

GPIO_1:         bfin-uart               Peripheral

GPIO_14:        BFIN-GPIO               GPIO INPUT

GPIO_32:        bfin_mac                Peripheral

GPIO_33:        bfin_mac                Peripheral

GPIO_36:        bfin_mac                Peripheral

 

My EBUI_AMBCTL is set to something reasonable (is there any way to check it from linux... maybe /proc/something?).

 

I'm trying to back up and do some low-level testing of the MTD, but nandtest isn't happy at all and I'm not sure how it's supposed to work:

 

root:/> flash_eraseall /dev/mtd0

Erasing 128 Kibyte @ 0 --  0 % complete.

Skipping bad block at 0x00020000

Erasing 128 Kibyte @ 40000 --  3 % complete.

Skipping bad block at 0x00060000

Erasing 128 Kibyte @ 800000 -- 100 % complete.

root:/> nandtest /dev/mtd0

ECC corrections: 0

ECC failures   : 48

Bad blocks     : 2

BBT blocks     : 0

Bad block at 0x00020000

Bad block at 0x00060000

00220000: reading...

uncorrectable error :

uncorrectable error :

uncorrectable error :

uncorrectable error :

uncorrectable error :

uncorrectable error :

uncorrectable error :

uncorrectable error :

ECC failed at 00220000

00220000: checking...

compare failed. seed 1322638827

Byte 0x4000 is 00 should be cb

Byte 0x4001 is 4a should be 82

Byte 0x4002 is 4a should be 3a

Byte 0x4003 is 4a should be aa

Byte 0x4004 is 4a should be de

Byte 0x4005 is 4a should be 4c

Byte 0x4006 is 4a should be 4f

Byte 0x4007 is 4a should be 11

Byte 0x4008 is 4a should be d6

Byte 0x4009 is 4a should be eb

Byte 0x400a is 4a should be 36

Byte 0x400b is 4a should be 57

Byte 0x400c is 4a should be b8

Byte 0x400d is 4a should be 9a

 

...

 

 

 

Any ideas how to proceed?  Is there any good way to check if BUSY is being read correctly?

Attachments

    Outcomes