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.

NAND write error in linux and NAND read error in u-boot

Hi,

I am working on a DM8168 processor.

I use a 2GB/16Gb nand flash memory.

Information on NAND
Part : MT29F16G08ABACAWP-IT
Device width : 8-bit
Page size : 4320 bytes (4096 + 224 bytes)

Block size: 128 pages (512K + 28K bytes)
Plane size: 2 planes x 2048 blocks per plane
Device size: 16Gb: 4096 blocks

Error Management Details:
Minimum number of valid blocks (NVB) per LUN: 4016
Total available blocks per LUN                               : 4096
First spare area location                                           :Byte 4096
Bad-block mark                                                          : 00h
Minimum required ECC                                            : 8-bit ECC per 540 bytes of data

Iam trying to read and write to nand flash in u-boot and linux level.


Iam facing "ECC: uncorrectable" error while reading from nand in u-boot and "nandwrite: error!: /dev/mtd1: MTD get bad block failed" error while writing to mtd0 & mtd1 partitions in linux level.

Here is the log showing errors:

U-Boot 2010.06 (Dec 06 2013 - 19:05:05)

TI8168-GP rev 2.0

ARM clk: 987MHz
DDR clk: 796MHz

I2C:   ready
DRAM:  1 GiB
NAND:  HW ECC BCH8 Selected
2048 MiB
*** Warning - bad CRC or NAND, using default environment

Hit any key to stop autoboot:  0
TI8168_EVM#nand erase

NAND erase: device 0 whole chip
Skipping bad block at  0x00000000                                         
Skipping bad block at  0x00040000                                         
Skipping bad block at  0x00080000                                         
Skipping bad block at  0x000c0000                                         
Skipping bad block at  0x00100000                                         
Skipping bad block at  0x00140000                                         
Skipping bad block at  0x00180000                                         
Skipping bad block at  0x001c0000                                         
Skipping bad block at  0x00200000                                         
Skipping bad block at  0x00240000                                         
Skipping bad block at  0x00280000                                         
Skipping bad block at  0x002c0000                                         
Skipping bad block at  0x00300000                                         
Skipping bad block at  0x00340000                                         
Skipping bad block at  0x00380000                                         
Skipping bad block at  0x003c0000                                         
Skipping bad block at  0x00400000                                         
Skipping bad block at  0x00440000                                         
Skipping bad block at  0x00480000                                         
Skipping bad block at  0x004c0000                                         
Skipping bad block at  0x00500000                                         
Skipping bad block at  0x00540000                                         
Skipping bad block at  0x00580000                                         
Skipping bad block at  0x005c0000                                         
Skipping bad block at  0x00600000                                         
Skipping bad block at  0x00640000                                         
Skipping bad block at  0x00680000                                         
Skipping bad block at  0x006c0000                                         
Skipping bad block at  0x00700000                                         
Skipping bad block at  0x00740000                                         
Skipping bad block at  0x00780000                                         
Skipping bad block at  0x007c0000                                         
Skipping bad block at  0x00800000                                         
Skipping bad block at  0x00840000                                         
Skipping bad block at  0x00880000                                         
Skipping bad block at  0x008c0000                                         
Skipping bad block at  0x00900000                                         
Skipping bad block at  0x00940000                                         
Skipping bad block at  0x00980000                                         
Skipping bad block at  0x009c0000                                         
Skipping bad block at  0x00a00000                                         
Skipping bad block at  0x00a40000                                         
Skipping bad block at  0x00b00000                                         
Skipping bad block at  0x00b40000                                         
Skipping bad block at  0x00b80000                                         
Skipping bad block at  0x00bc0000                                         
Skipping bad block at  0x00c00000                                         
Skipping bad block at  0x00c40000                                         
Skipping bad block at  0x00c80000                                         
Skipping bad block at  0x00cc0000                                         
Skipping bad block at  0x00d00000                                         
Skipping bad block at  0x00d40000                                         
Skipping bad block at  0x00d80000                                         
Skipping bad block at  0x00dc0000                                         
Skipping bad block at  0x00e00000                                         
Skipping bad block at  0x00e40000                                         
Skipping bad block at  0x02d00000                                         
Skipping bad block at  0x02d40000                                         
Skipping bad block at  0x02d80000                                         
Skipping bad block at  0x02dc0000                                         
Skipping bad block at  0x0eac0000                                         
Skipping bad block at  0x0eb80000                                         
Skipping bad block at  0x0ebc0000                                         
Skipping bad block at  0x0ec00000                                         
Skipping bad block at  0x0ec40000                                         
Skipping bad block at  0x0ec80000                                         
Skipping bad block at  0x0ecc0000                                         
Skipping bad block at  0x0ed00000                                         
Skipping bad block at  0x0ed40000                                         
Skipping bad block at  0x0ed80000                                         
Skipping bad block at  0x0edc0000                                         
Skipping bad block at  0x0ee00000                                         
Skipping bad block at  0x0ee40000                                         
Skipping bad block at  0x0ee80000                                         
Skipping bad block at  0x0eec0000                                         
Erasing at 0x7ffc0000 -- 100% complete.
OK
TI8168_EVM#nand read 0x80800000 0x0eac0000 0x4000

NAND read: device 0 offset 0xeac0000, size 0x4000
Skipping bad block 0x0eac0000
 16384 bytes read: OK
TI8168_EVM#md 0x80800000
80800000: ffffffff ffffffff ffffffff ffffffff    ................
80800010: ffffffff ffffffff ffffffff ffffffff    ................
80800020: ffffffff ffffffff ffffffff ffffffff    ................
80800030: ffffffff ffffffff ffffffff ffffffff    ................
80800040: ffffffff ffffffff ffffffff ffffffff    ................
80800050: ffffffff ffffffff ffffffff ffffffff    ................
80800060: ffffffff ffffffff ffffffff ffffffff    ................
80800070: ffffffff ffffffff ffffffff ffffffff    ................
80800080: ffffffff ffffffff ffffffff ffffffff    ................
80800090: ffffffff ffffffff ffffffff ffffffff    ................
808000a0: ffffffff ffffffff ffffffff ffffffff    ................
808000b0: ffffffff ffffffff ffffffff ffffffff    ................
808000c0: ffffffff ffffffff ffffffff ffffffff    ................
808000d0: ffffffff ffffffff ffffffff ffffffff    ................
808000e0: ffffffff ffffffff ffffffff ffffffff    ................
808000f0: ffffffff ffffffff ffffffff ffffffff    ................
TI8168_EVM#mw 0x80800000 12345
TI8168_EVM#nand write 0x80800000 0x0eac0000 0x40

NAND write: device 0 offset 0xeac0000, size 0x40
Skip bad block 0x0eac0000
 64 bytes written: OK
TI8168_EVM#nand read 0xa0800000 0x0eac0000 0x40

NAND read: device 0 offset 0xeac0000, size 0x40
Skipping bad block 0x0eac0000
ECC: uncorrectable.
ECC: uncorrectable.
ECC: uncorrectable.
ECC: uncorrectable.
NAND read from offset eb00000 failed -74
 0 bytes read: ERROR
TI8168_EVM#nand read 0xa0800000 0x0eac0000 0x40

NAND read: device 0 offset 0xeac0000, size 0x40
Skipping bad block 0x0eac0000
 64 bytes read: OK

log showing nand write error in linux:


U-Boot 2010.06 (Dec 02 2013 - 16:21:02)

DRAM:  1 GiB
Using default environment

Hit any key to stop autoboot:  0
mmc1 is available
reading u-boot.bin

176020 bytes read
## Starting application at 0x80800000 ...


U-Boot 2010.06 (Dec 06 2013 - 19:05:05)

TI8168-GP rev 2.0

ARM clk: 987MHz
DDR clk: 796MHz

I2C:   ready
DRAM:  1 GiB
NAND:  HW ECC BCH8 Selected
2048 MiB
*** Warning - bad CRC or NAND, using default environment

Hit any key to stop autoboot:  0
mmc1 is available
reading boot.scr

300 bytes read
Running bootscript from MMC/SD to set the ENV...
## Executing script at 80900000
reading uImage

2577136 bytes read
## Booting kernel from Legacy Image at 80009000 ...
   Image Name:   Linux-2.6.37
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2577072 Bytes = 2.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.37 (root@dell) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #17 Sat Dec 7 11:56:41 IST 2013
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: ti8168evm
vram size = 52428800 at 0x0
reserved size = 52428800 at 0x0
FB: Reserving 52428800 bytes SDRAM for VRAM
Memory policy: ECC disabled, Data cache writeback
OMAP chip is TI8168 2.0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 52224
Kernel command line: console=ttyO2,115200n8 rootwait root=/dev/mmcblk0p2 rw mem=256M earlyprink vram=50M ti816xfb.vram=0:16M,1:16M,2:6M ip=off noinitrd notifyk.vpssm3_sva=0xA00
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 206MB = 206MB total
Memory: 203148k/203148k available, 58996k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .init : 0xc0008000 - 0xc003c000   ( 208 kB)
      .text : 0xc003c000 - 0xc04de000   (4744 kB)
      .data : 0xc04de000 - 0xc0527400   ( 293 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:407
IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
Total of 128 interrupts on 1 active controller
GPMC revision 6.0
Trying to install interrupt handler for IRQ400
Trying to install interrupt handler for IRQ401
Trying to install interrupt handler for IRQ402
Trying to install interrupt handler for IRQ403
Trying to install interrupt handler for IRQ404
Trying to install interrupt handler for IRQ405
Trying to install interrupt handler for IRQ406
Trying to install type control for IRQ407
Trying to set irq flags for IRQ407
OMAP clockevent source: GPTIMER1 at 27000000 Hz
Console: colour dummy device 80x30
Calibrating delay loop... 986.31 BogoMIPS (lpj=4931584)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
omap_voltage_early_init: voltage driver support not added
regulator: core version 0.5
regulator: dummy:
NET: Registered protocol family 16
omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
omap_voltage_add_dev: VDD specified does not exist!
OMAP GPIO hardware version 0.1
OMAP GPIO hardware version 0.1
omap_mux_init: Add partition: #1: core, flags: 0
_omap_mux_get_by_name: Could not find signal i2c2_scl.i2c2_scl
_omap_mux_get_by_name: Could not find signal i2c2_sda.i2c2_sda
NOR: Can't request GPMC CS
registered ti816x_gpio_vr device
registered ti816x_sr device
pm_dbg_init: only OMAP3 supported
registered ti81xx_vpss device
registered ti81xx_vidout device
registered ti81xx on-chip HDMI device
registered ti81xx_fb device
registered ti81xx_vin device
ti81xx_pcie: Invoking PCI BIOS...
ti81xx_pcie: Setting up Host Controller...
ti81xx_pcie: Register base mapped @0xd0820000
ti81xx_pcie: Starting PCI scan...
PCI: bus0: Fast back to back transfers disabled
PCI: bus1: Fast back to back transfers disabled
PCI: bus2: Fast back to back transfers disabled
PCI: bus3: Fast back to back transfers enabled
PCI: bus4: Fast back to back transfers enabled
PCI: bus5: Fast back to back transfers disabled
pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
pci 0000:01:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
pci 0000:02:03.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
pci 0000:02:01.0: PCI bridge to [bus 03-03]
pci 0000:02:01.0:   bridge window [io  disabled]
pci 0000:02:01.0:   bridge window [mem disabled]
pci 0000:02:01.0:   bridge window [mem pref disabled]
pci 0000:02:02.0: PCI bridge to [bus 04-04]
pci 0000:02:02.0:   bridge window [io  disabled]
pci 0000:02:02.0:   bridge window [mem disabled]
pci 0000:02:02.0:   bridge window [mem pref disabled]
pci 0000:05:00.0: BAR 0: assigned [mem 0x20000000-0x2000ffff 64bit]
pci 0000:05:00.0: BAR 0: set to [mem 0x20000000-0x2000ffff 64bit] (PCI address [0x20000000-0x2000ffff])
pci 0000:05:00.0: BAR 2: assigned [mem 0x20010000-0x20011fff 64bit]
pci 0000:05:00.0: BAR 2: set to [mem 0x20010000-0x20011fff 64bit] (PCI address [0x20010000-0x20011fff])
pci 0000:02:03.0: PCI bridge to [bus 05-05]
pci 0000:02:03.0:   bridge window [io  disabled]
pci 0000:02:03.0:   bridge window [mem 0x20000000-0x200fffff]
pci 0000:02:03.0:   bridge window [mem pref disabled]
pci 0000:01:00.0: PCI bridge to [bus 02-05]
pci 0000:01:00.0:   bridge window [io  disabled]
pci 0000:01:00.0:   bridge window [mem 0x20000000-0x200fffff]
pci 0000:01:00.0:   bridge window [mem pref disabled]
pci 0000:00:00.0: PCI bridge to [bus 01-05]
pci 0000:00:00.0:   bridge window [io  disabled]
pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
pci 0000:00:00.0:   bridge window [mem pref disabled]
PCI: enabling device 0000:00:00.0 (0140 -> 0143)
PCI: enabling device 0000:01:00.0 (0140 -> 0143)
PCI: enabling device 0000:02:01.0 (0140 -> 0143)
PCI: enabling device 0000:02:02.0 (0140 -> 0143)
PCI: enabling device 0000:02:03.0 (0140 -> 0143)
bio: create slab <bio-0> at 0
regulator: VFB: 800 <--> 1025 mV at 1010 mV
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
USBSS revision 4ea20809
registerd cppi-dma Intr @ IRQ 17
Cppi41 Init Done
omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
omap_i2c omap_i2c.2: bus 2 rev4.0 at 100 kHz
Advanced Linux Sound Architecture Driver Version 1.0.23.
Switching to clocksource gp timer
musb-hdrc: version 6.0, host, debug=0
musb-hdrc musb-hdrc.0: dma type: dma-cppi41
MUSB controller-0 revision 4ea20800
musb-hdrc musb-hdrc.0: MUSB HDRC host driver
musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: MUSB HDRC host driver
usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
usb usb1: SerialNumber: musb-hdrc.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
musb-hdrc musb-hdrc.0: USB Host mode controller at d081e000 using DMA, IRQ 18
musb-hdrc musb-hdrc.1: dma type: dma-cppi41
MUSB controller-1 revision 4ea20800
musb-hdrc musb-hdrc.1: MUSB HDRC host driver
musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: MUSB HDRC host driver
usb usb2: Manufacturer: Linux 2.6.37 musb-hcd
usb usb2: SerialNumber: musb-hdrc.1
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
musb-hdrc musb-hdrc.1: USB Host mode controller at d0826800 using DMA, IRQ 19
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
PMU: registered new PMU device of type 0
omap-iommu omap-iommu.0: ducati registered
omap-iommu omap-iommu.1: sys registered
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
msgmni has been set to 396
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
 PCI DRV INIT
 PCI REGISTER DRV success
Serial: 8250/16550 driver, 8 ports, IRQ sharing enabled
omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
console [ttyO2] enabled
brd: module loaded
loop: module loaded
ahci ahci.0: forcing PORTS_IMPL to 0x3
ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
ahci ahci.0: flags: ncq sntf pm led clo only pmp pio slum part ccc
scsi0 : ahci_platform
scsi1 : ahci_platform
ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16
ata2: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x180 irq 16
omap2-nand driver initializing
ONFI flash detected
ONFI param page 0 valid
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x48 (Micron NAND 2GiB 3,3V 8-bit)
Creating 5 MTD partitions on "omap2-nand.0":
0x000000000000-0x000000400000 : "U-Boot"
0x000000400000-0x000000500000 : "U-Boot Env"
0x000000500000-0x000001900000 : "Kernel"
0x000001900000-0x000014500000 : "File System"
0x000014500000-0x00007d000000 : "Reserved"
davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
davinci_mdio davinci_mdio.0: detected phy mask fffffff7
davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[3]: device 0:03, driver unknown
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver dm9601
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
i2c /dev entries driver
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v1.0.0)
OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
ata1: SATA link down (SStatus 0 SControl 300)
ata2: SATA link down (SStatus 0 SControl 300)
usb 1-1: new high speed USB device using musb-hdrc and address 2
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
notify_init : notify drivercreated  for  remote proc id 2 at physical Address 0xa0000000
usbcore: registered new interface driver snd-usb-audio
asoc: tlv320aic3x-hifi <-> davinci-mcasp.2 mapping ok
ALSA device list:
  #0: TI81XX EVM
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
omap_voltage_late_init: Voltage driver support not added
Power Management for TI81XX.
smartreflex smartreflex: Driver initialized
omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU04G 3.69 GiB
 mmcblk0: p1 p2
usb 1-1: New USB device found, idVendor=0424, idProduct=2514
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
EXT3-fs: barriers not enabled
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): recovery complete
EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
devtmpfs: mounted
Freeing init memory: 208K
INIT: version 2.86 booting
Please wait: booting...
Error opening /dev/fb0: No such file or directory
Starting udev
udevd (71): /proc/71/oom_adj is deprecated, please use /proc/71/oom_score_adj instead.
Remounting root file system...
Caching udev devnodes
NET: Registered protocol family 10
ALSA: Restoring mixer settings...
Configuring network interfaces... PHY 0:01 not found
net eth0: could not connect to phy 0:01
ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc (v1.13.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
done.
Setting up IP spoofing protection: rp_filter.
Wed Dec 26 16:01:00 UTC 2012
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Starting telnet daemon.
Starting syslogd/klogd: done
Starting thttpd.
Starting Matrix GUI application.

 _____                    _____           _         _   
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
              |___|                    |___|            

Arago Project http://arago-project.org dm816x-evm ttyO2

Arago 2011.09 dm816x-evm ttyO2

dm816x-evm login: root
root@dm816x-evm:~# ls
1080P.sh             dump_data.hex        ti816x_hdvpss.xem3
0x00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000000a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000000b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000000c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000000d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000000e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x000000f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000110: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000120: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000130: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000140: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000150: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x00000160: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[1] + Stopped                    vi dump_data.hex
root@dm816x-evm:~# flash_eraseall /dev/mtd1
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
flash_erase: Skipping bad block at 00000000
flash_erase: Skipping bad block at 00080000
Erasing 512 Kibyte @ 80000 -- 100 % complete
root@dm816x-evm:~# nandwrite -p -n /dev/mtd1 test.txt
Writing data to block 0 at offset 0x0
Bad block at 0, 1 block(s) from 0 will be skipped
Writing data to block 1 at offset 0x80000
Bad block at 80000, 1 block(s) from 80000 will be skipped
Writing data to block 2 at offset 0x100000
libmtd: error!: bad eraseblock number 2, mtd1 has 2 eraseblocks
nandwrite: error!: /dev/mtd1: MTD get bad block failed
           error 22 (Invalid argument)
Data was only partially written due to error
: Invalid argument
root@dm816x-evm:~# flash_eraseall /dev/mtd2
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
flash_erase: Skipping bad block at 00000000
flash_erase: Skipping bad block at 00080000
flash_erase: Skipping bad block at 00100000
flash_erase: Skipping bad block at 00180000
flash_erase: Skipping bad block at 00200000
flash_erase: Skipping bad block at 00280000
flash_erase: Skipping bad block at 00300000
flash_erase: Skipping bad block at 00380000
flash_erase: Skipping bad block at 00400000
flash_erase: Skipping bad block at 00480000
flash_erase: Skipping bad block at 00500000
Erasing 512 Kibyte @ 580000 -- 27 % complete flash_erase: Skipping bad block at 00600000
flash_erase: Skipping bad block at 00680000
flash_erase: Skipping bad block at 00700000
flash_erase: Skipping bad block at 00780000
flash_erase: Skipping bad block at 00800000
flash_erase: Skipping bad block at 00880000
flash_erase: Skipping bad block at 00900000
Erasing 512 Kibyte @ 1380000 -- 100 % complete
root@dm816x-evm:~# nandwrite -p -n /dev/mtd2 test.txt
Writing data to block 0 at offset 0x0
Bad block at 0, 1 block(s) from 0 will be skipped
Writing data to block 1 at offset 0x80000
Bad block at 80000, 1 block(s) from 80000 will be skipped
Writing data to block 2 at offset 0x100000
Bad block at 100000, 1 block(s) from 100000 will be skipped
Writing data to block 3 at offset 0x180000
Bad block at 180000, 1 block(s) from 180000 will be skipped
Writing data to block 4 at offset 0x200000
Bad block at 200000, 1 block(s) from 200000 will be skipped
Writing data to block 5 at offset 0x280000
Bad block at 280000, 1 block(s) from 280000 will be skipped
Writing data to block 6 at offset 0x300000
Bad block at 300000, 1 block(s) from 300000 will be skipped
Writing data to block 7 at offset 0x380000
Bad block at 380000, 1 block(s) from 380000 will be skipped
Writing data to block 8 at offset 0x400000
Bad block at 400000, 1 block(s) from 400000 will be skipped
Writing data to block 9 at offset 0x480000
Bad block at 480000, 1 block(s) from 480000 will be skipped
Writing data to block 10 at offset 0x500000
Bad block at 500000, 1 block(s) from 500000 will be skipped
Writing data to block 11 at offset 0x580000
root@dm816x-evm:~#

Note:Iam getting this "ECC: uncorrectable" error only once while using nand read command at first.

Is this any configuration missing problem?! Can any1 tell me what went wrong here...?

Thanks in advance.

Regards,

kripashree

  • Anyway both the issue is solved.but iam facing new problem.

    In linux nand write for mtd0 partition is not happening properly.

    It simply shows like data is written,but nothing is written while confirming by dumping to some hex file.

    Here is the log:

    -----------------------------------------

    Starting syslogd/klogd: done
    Starting thttpd.
    Starting Matrix GUI application.

     _____                    _____           _         _  
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_| 
                  |___|                    |___|           

    Arago Project http://arago-project.org dm816x-evm ttyO2

    Arago 2011.09 dm816x-evm ttyO2

    dm816x-evm login: root
    root@dm816x-evm:~# flash_eraseall /dev/mtd0
    flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
    flash_erase: Skipping bad block at 00000000
    flash_erase: Skipping bad block at 00080000
    flash_erase: Skipping bad block at 00100000
    flash_erase: Skipping bad block at 00180000
    flash_erase: Skipping bad block at 00200000
    flash_erase: Skipping bad block at 00280000
    flash_erase: Skipping bad block at 00300000
    flash_erase: Skipping bad block at 00380000
    flash_erase: Skipping bad block at 00400000
    flash_erase: Skipping bad block at 00480000
    flash_erase: Skipping bad block at 00500000
    flash_erase: Skipping bad block at 00580000
    flash_erase: Skipping bad block at 00600000
    flash_erase: Skipping bad block at 00680000
    flash_erase: Skipping bad block at 00700000
    flash_erase: Skipping bad block at 00780000
    flash_erase: Skipping bad block at 00800000
    flash_erase: Skipping bad block at 00880000
    flash_erase: Skipping bad block at 00900000
    flash_erase: Skipping bad block at 00980000
    flash_erase: Skipping bad block at 00a00000
    Erasing 512 Kibyte @ a80000 -- 70 % complete flash_erase: Skipping bad block at 00b00000
    flash_erase: Skipping bad block at 00b80000
    flash_erase: Skipping bad block at 00c00000
    flash_erase: Skipping bad block at 00c80000
    flash_erase: Skipping bad block at 00d00000
    flash_erase: Skipping bad block at 00d80000
    flash_erase: Skipping bad block at 00e00000
    Erasing 512 Kibyte @ e80000 -- 100 % complete
    root@dm816x-evm:~# nandwrite -p -n /dev/mtd0 test.txt
    Writing data to block 0 at offset 0x0
    Bad block at 0, 1 block(s) from 0 will be skipped
    Writing data to block 1 at offset 0x80000
    Bad block at 80000, 1 block(s) from 80000 will be skipped
    Writing data to block 2 at offset 0x100000
    Bad block at 100000, 1 block(s) from 100000 will be skipped
    Writing data to block 3 at offset 0x180000
    Bad block at 180000, 1 block(s) from 180000 will be skipped
    Writing data to block 4 at offset 0x200000
    Bad block at 200000, 1 block(s) from 200000 will be skipped
    Writing data to block 5 at offset 0x280000
    Bad block at 280000, 1 block(s) from 280000 will be skipped
    Writing data to block 6 at offset 0x300000
    Bad block at 300000, 1 block(s) from 300000 will be skipped
    Writing data to block 7 at offset 0x380000
    Bad block at 380000, 1 block(s) from 380000 will be skipped
    Writing data to block 8 at offset 0x400000
    Bad block at 400000, 1 block(s) from 400000 will be skipped
    Writing data to block 9 at offset 0x480000
    Bad block at 480000, 1 block(s) from 480000 will be skipped
    Writing data to block 10 at offset 0x500000
    Bad block at 500000, 1 block(s) from 500000 will be skipped
    Writing data to block 11 at offset 0x580000
    Bad block at 580000, 1 block(s) from 580000 will be skipped
    Writing data to block 12 at offset 0x600000
    Bad block at 600000, 1 block(s) from 600000 will be skipped
    Writing data to block 13 at offset 0x680000
    Bad block at 680000, 1 block(s) from 680000 will be skipped
    Writing data to block 14 at offset 0x700000
    Bad block at 700000, 1 block(s) from 700000 will be skipped
    Writing data to block 15 at offset 0x780000
    Bad block at 780000, 1 block(s) from 780000 will be skipped
    Writing data to block 16 at offset 0x800000
    Bad block at 800000, 1 block(s) from 800000 will be skipped
    Writing data to block 17 at offset 0x880000
    Bad block at 880000, 1 block(s) from 880000 will be skipped
    Writing data to block 18 at offset 0x900000
    Bad block at 900000, 1 block(s) from 900000 will be skipped
    Writing data to block 19 at offset 0x980000
    Bad block at 980000, 1 block(s) from 980000 will be skipped
    Writing data to block 20 at offset 0xa00000
    Bad block at a00000, 1 block(s) from a00000 will be skipped
    Writing data to block 21 at offset 0xa80000
    root@dm816x-evm:~# nanddump -f dump_data.hex -l 100 -n -p -s 0 /dev/mtd0
    Block size 524288, page size 4096, OOB size 224
    Dumping data starting at 0x00000000 and ending at 0x00000064...

    Here is the dump_data.hex:

    0x00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000000a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000000b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000000c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000000d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000000e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000000f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000110: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000120: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000130: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000140: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000150: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000160: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

    then for all other partition writing is proper.

    Plz  help me this time.... :( :(

  • Kripashree,

    Do a "nand scrub" from u-boot and flash everything again. This might solve your problem.

  • That problem was solved.

    There was bad block problem , that was trying to write for bad block.

    After increasing the partition size and leaving some memory free at 0'th location, problem was solved.

    Anyway thank you very much for your reply Renjith.

  • Hi Kripashree,

    Can you please tell how you were able to solve the issue on "ECC Uncorrectable error" on DM8168.

    Regards

    Ayusman

  • hello Ayusman,

    Use appropriate ECC LAYOUT.

    Eg: you can use the following ECC Layout for 224 ECC bytes

     u-boot-2010.06-psp04.04.00.01/arch/arm/include/asm/arch-ti81xx/nand.h :

    #define GPMC_NAND_HW_BCH8_ECC_LAYOUT_4KPAGE {\
           .eccbytes = 112,\
           .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
                                   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
                                   28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
                                   40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
                                   52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\
                                   64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\
                                   76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\
                                   88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\
                                   100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,\
                                   112, 113},\
           .oobfree = {\
                   {.offset = 114,\
                    .length = 110 } } \
            }

    It also depends on which type of BCH you are using.

    Regards,

    kripa

  • Hi kripashree gowda,

    Is it a nand HW failure , or did you do some fix to get over the list of bad block ?

    Thank you.
    Ran