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 bad showing all blocks bad

Other Parts Discussed in Thread: AM3354

Hi,

I have a custom AM3354 board with STNAND256A. I am getting a all blocks are bad whenever  I issue nand bad command

U-Boot# nand bad

Device 0 bad blocks:

00000000

00004000

00008000

...

Where I am wrong ?

  • Hi,

    Can you post the exact NAND part number?

  • Thanks for so quick reply

    NAND part number : NAND256W3A2BNE

    Datasheet is attached.

    1258.Nand256W3A2BNE.pdf

  • This NAND is 32MB - 256Mb, 8 bit interface, 512+16 bytes page size, as far as I can see. You cannot boot from this device as it's not supported by AM335X. Also the 16 byte spare area will not support the default ECC used, which is BCH8.

  • Hi,

    if I modify the file  include/configs/am335x_evm.h as below  ,then whether I will be able to boot.

    #define CONFIG_SYS_NAND_PAGE_SIZE    (512+16)
    #define CONFIG_SYS_NAND_OOBSIZE        16
    #define CONFIG_SYS_NAND_BLOCK_SIZE    (32*512)

    If there are any way so that it should work,can you please suggest.

    thanks,

    tapas

  • Please read carefully the whole section 26.1.7.4 in the AM335X Technical Reference Manual Rev. K. 256Mb NAND memories are not supported by AM335X ROM code.

  • Thank you for your complete explanation.

    regards,

    Tapas

  • Thanks for the details and i verified the same in TRM also. i d'ont want to use XIP.

    we had provisioned

    1) NOR flash (M25P80-VMW6TGBA) (8Mbit) interfaced to the AM3354 through SPI, where i want to store MLO (SPL.bin) and uBoot (image).

    2) The NAND256W3A2BNE (256 Mbit) is provisioned for kernel image and file system.

    On power up, i want to run uboot from SPI NOR flash and then copy the kernel & filesystem from NAND to RAM.

    while board bringing up, i'm attempting to write kernel image from RAM to NAND.

    When i read kernel image from NAND to RAM, ECC "uncorrectable error" is what i get.

    Is it still feasible for me to use the NAND256W3A2BNE with AM3354BZCZA100 for storing kernel image and filesystem?

  • I was already contacted by your FAE about this. I responded as below:

    This NAND has 512 bytes page size + 16 bytes spare area. This will fit exactly into what BCH8 needs, if the filesystem does not use spare area for its own metadata. See this wiki for details:

    http://processors.wiki.ti.com/index.php/Raw_NAND_ECC#Is_it_possible_to_use_any_ECC_algorithm_for_any_NAND.3F

  • The bad block marker is in the first 2 bytes of the first spare area of a block. A value != 0xFFFF marks a bad block.

    Da a nand memory dump from u-boot and check, what values are at this position.

  • Hi Wolfgang,

    I tried different pages as follows:

    U-Boot# nand dump 0x10
    Page 00000000 dump:
    27 05 19 56 fa 2d c0 d3 54 79 83 da 00 26 c0 c8
    80 00 80 00 80 00 80 00 90 ad f2 dc 05 02 02 00
    4c 69 6e 75 78 2d 33 2e 32 2e 30 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 a0 e1 00 00 a0 e1 00 00 a0 e1 00 00 a0 e1
    00 00 a0 e1 00 00 a0 e1 00 00 a0 e1 00 00 a0 e1
    02 00 00 ea 18 28 6f 01 00 00 00 00 c8 c0 26 00
    01 70 a0 e1 02 80 a0 e1 00 20 0f e1 03 00 12 e3
    01 00 00 1a 17 00 a0 e3 56 34 12 ef 00 20 0f e1
    c0 20 82 e3 02 f0 21 e1 00 00 00 00 00 00 00 00
    84 47 9f e5 55 00 00 eb 4a 0f 8f e2 4e 1c 90 e8
    1c d0 90 e5 01 00 40 e0 00 60 86 e0 00 a0 8a e0
    00 90 da e5 01 e0 da e5 0e 94 89 e1 02 e0 da e5
    03 a0 da e5 0e 98 89 e1 0a 9c 89 e1 00 d0 8d e0
    01 a8 8d e2 00 50 a0 e3 01 a9 8a e2 0a 00 54 e1
    16 00 00 2a 09 a0 84 e0 50 90 8f e2 09 00 5a e1
    12 00 00 9a 02 ab 8a e2 ff a0 ca e3 6c 50 4f e2
    1f 50 c5 e3 05 90 46 e0 1f 90 89 e2 1f 90 c9 e3
    05 60 89 e0 0a 90 89 e0 0f 5c 36 e9 05 00 56 e1
    0f 5c 29 e9 fb ff ff 8a 06 60 49 e0 06 d0 8d e0
    4e 01 00 eb a4 00 4f e2 06 00 80 e0 00 f0 a0 e1
    05 10 90 e1 0d 00 00 0a 00 b0 8b e0 00 c0 8c e0
    00 20 82 e0 00 30 83 e0 00 10 9b e5 00 10 81 e0
    02 00 51 e1 01 00 53 21 05 10 81 80 04 10 8b e4
    0c 00 5b e1 f7 ff ff 3a 05 20 82 e0 05 30 83 e0
    00 00 a0 e3 04 00 82 e4 04 00 82 e4 04 00 82 e4
    04 00 82 e4 03 00 52 e1 f9 ff ff 3a 04 00 a0 e1
    0d 10 a0 e1 01 28 8d e2 07 30 a0 e1 ec 01 00 eb
    2e 01 00 eb fd 00 00 eb 00 00 a0 e3 07 10 a0 e1
    08 20 a0 e1 04 f0 a0 e1 98 01 00 00 c8 c0 26 00
    e8 c0 26 00 c8 c0 26 00 81 c0 26 00 94 c0 26 00
    c0 c0 26 00 e8 d0 26 00 00 f0 20 e3 00 f0 20 e3
    OOB:
    ff ff da 0f 3b 55 51 cb
    b0 6d c2 88 c6 31 a4 00
    U-Boot# nand dump 0x00001000
    Page 00001000 dump:
    b2 30 d5 e1 83 30 a0 e1 b3 90 96 e1 78 10 1b e5
    01 00 59 e1 50 00 00 9a 94 20 1b e5 90 30 1b e5
    02 40 00 e0 03 00 54 e1 4b 00 00 0a 7c 60 1b e5
    00 00 5a e3 70 10 1b e5 01 20 a0 e3 78 50 1b e5
    01 61 86 e0 05 a0 a0 01 08 00 59 e1 09 c0 6a e0
    7c 60 0b e5 0c 10 a0 e1 12 3c a0 e1 12 00 00 2a
    19 52 a0 e1 2c 60 4b e2 05 20 86 e0 b0 24 52 e1
    03 30 62 e0 00 00 53 e3 0b 00 00 da 6c 20 4b e2
    05 50 82 e0 03 00 00 ea b2 20 f5 e1 03 30 62 e0
    00 00 53 e3 04 00 00 da 01 c0 8c e2 83 30 a0 e1
    0c 20 8a e0 08 00 52 e1 f6 ff ff 3a 84 30 1b e5
    01 50 a0 e3 af 25 00 e3 15 3c 83 e0 84 30 0b e5
    84 60 1b e5 98 30 1b e5 02 00 56 e1 00 30 a0 93
    01 30 03 82 00 00 53 e3 21 00 00 1a 80 30 1b e5
    90 40 0b e5 78 50 1b e5 00 20 93 e5 04 31 a0 e1
    7c 60 1b e5 04 c1 c2 e7 80 40 1b e5 00 20 94 e5
    03 20 82 e0 01 50 c2 e5 00 20 94 e5 06 40 62 e0
    03 30 82 e0 44 41 a0 e1 b2 40 c3 e1 7d ff ff ea
    00 00 e0 e3 19 ff ff ea 04 00 55 e1 05 40 a0 31
    78 c0 0b e5 0c 00 54 e1 0c 90 a0 21 78 40 0b 25
    78 90 1b 35 20 ff ff ea 13 20 a0 e3 a0 70 0b e5
    9c 70 0b e5 88 20 0b e5 52 ff ff ea 09 10 6a e0
    6c ff ff ea 01 00 a0 e3 08 ff ff ea 00 00 50 e3
    23 00 00 0a 78 c0 1b e5 40 50 a0 e3 7c 90 1b e5
    01 70 a0 e3 7c 80 ef e6 00 00 5a e3 26 00 00 0a
    94 40 1b e5 90 c0 1b e5 04 10 00 e0 01 00 5c e1
    21 00 00 0a 80 10 1b e5 00 a0 a0 e3 78 c0 1b e5
    0a 40 a0 e1 08 60 a0 e1 00 90 91 e5 01 20 4c e2
    30 44 a0 e1 17 12 a0 e1 04 c1 89 e0 00 00 11 e1
    04 51 c9 e7 01 60 cc e5 b2 30 cc e1 02 00 00 0a
    a1 10 a0 e1 01 00 10 e1 fc ff ff 1a 00 00 51 e3
    03 00 00 0a 01 c0 41 e2 00 00 0c e0 01 00 90 e0
    OOB:
    ff ff de d6 b9 db 54 db
    e6 2c 99 2d 6d 7b f7 00
    U-Boot# nand dump 0x00002000
    Page 00002000 dump:
    07 30 05 e0 03 01 82 e0 03 11 d2 e7 01 30 d0 e5
    b2 00 d0 e1 03 00 56 e1 12 00 00 2a 00 00 54 e3
    49 03 00 0a 30 c0 1b e5 01 00 00 ea 00 00 54 e3
    41 03 00 0a 01 30 dc e4 01 40 44 e2 0c a0 a0 e1
    13 56 85 e0 08 60 86 e2 07 30 05 e0 03 01 82 e0
    03 11 d2 e7 01 30 d0 e5 b2 00 d0 e1 06 00 53 e1
    f1 ff ff 8a 30 c0 0b e5 00 00 51 e3 58 03 00 0a
    f0 00 11 e3 93 03 00 1a 01 10 83 e0 00 c0 e0 e3
    1c c1 e0 e1 05 10 0c e0 60 c0 0b e5 31 13 80 e0
    01 c1 82 e0 01 11 d2 e7 01 70 dc e5 b2 c0 dc e1
    54 c0 0b e5 07 c0 83 e0 0c 00 56 e1 15 00 00 2a
    00 00 54 e3 24 03 00 0a 30 c0 1b e5 01 00 00 ea
    00 00 54 e3 20 03 00 0a 01 10 dc e4 01 40 44 e2
    60 70 1b e5 30 c0 0b e5 11 56 85 e0 08 60 86 e2
    07 10 05 e0 31 13 80 e0 01 a1 82 e0 01 11 d2 e7
    01 70 da e5 b2 a0 da e1 54 a0 0b e5 03 a0 87 e0
    06 00 5a e1 ed ff ff 8a 54 c0 1b e5 35 53 a0 e1
    00 00 51 e3 06 60 63 e0 35 57 a0 e1 3c c0 88 e5
    06 60 67 e0 2d 03 00 0a 20 00 11 e3 8d 02 00 1a
    40 00 11 e3 85 03 00 0a b0 18 9f e5 01 10 8f e0
    1a 00 00 ea 07 30 06 e2 07 60 c6 e3 1f 00 56 e3
    35 53 a0 e1 0d 00 00 8a 00 00 54 e3 fa 02 00 0a
    30 30 1b e5 01 00 00 ea 00 00 54 e3 5c 02 00 0a
    01 20 d3 e4 01 40 44 e2 03 10 a0 e1 12 56 85 e0
    08 60 86 e2 1f 00 56 e3 f6 ff ff 9a 30 30 0b e5
    25 28 a0 e1 75 30 ff e6 ff 2c 22 e2 ff 20 22 e2
    02 00 53 e1 26 03 00 0a 44 18 9f e5 01 10 8f e0
    3c 70 1b e5 1b 20 a0 e3 02 30 a0 e1 18 10 87 e5
    00 20 88 e5 38 fe ff ea 3c 30 98 e5 00 00 53 e3
    64 02 00 0a 34 70 1b e5 03 00 54 e1 04 30 a0 31
    07 00 53 e1 03 70 a0 31 00 00 57 e3 93 02 00 0a
    07 20 a0 e1 48 00 1b e5 30 10 1b e5 04 40 67 e0
    OOB:
    ff ff e2 9e c2 cf e2 e8
    e8 d0 95 cb 1c da a9 00

    U-Boot# nand read 0x80200000 0 100

    NAND read: device 0 offset 0x0, size 0x100
    Skipping bad block 0x00000000
    Skipping bad block 0x00004000
    Skipping bad block 0x00008000
    Skipping bad block 0x0000c000
    Skipping bad block 0x00010000
    Skipping bad block 0x00014000
    Skipping bad block 0x00018000
    Skipping bad block 0x0001c000
    Skipping bad block 0x00020000
    Skipping bad block 0x00024000
    Skipping bad block 0x00028000
    Skipping bad block 0x0002c000
    Skipping bad block 0x00030000
    Skipping bad block 0x00034000
    Skipping bad block 0x00038000
    Skipping bad block 0x0003c000
    Skipping bad block 0x00040000
    Skipping bad block 0x00044000
    Skipping bad block 0x00048000
    Skipping bad block 0x0004c000
    Skipping bad block 0x00050000
    Skipping bad block 0x00054000
    Skipping bad block 0x00058000
    Skipping bad block 0x0005c000
    Skipping bad block 0x00060000
    Skipping bad block 0x00064000
    Skipping bad block 0x00068000
    Skipping bad block 0x0006c000
    Skipping bad block 0x00070000


    I am getting always ff for first two byte of spare area.

    reagards,
    Tapas Maji
  • NAND has 512 bytes page size + 16 bytes spare area. As indicated this will fit exactly into what BCH8 of AM3354 needs, in my case.

    But whenever i write to NAND flash the first 2 bytes of 16 bytes spare area is always 0xff 0xff indicating bad block.

    As a result i'm not successfull in programming the flash with the kernel image from RAM.

    Is there a way to overcome : ECC "uncorrectable error" in fetching the kernel image from NAND to RAM?

    Am i missing any configuration with respect to BCH8 and ELM?

    regards,
    Tapas Maji
  • Hi Wolfgang,

    I tried different pages as follows:

    U-Boot# nand dump any_address_of_NAND_flash

    I am getting always ff for first two byte of spare area for every page.

    How do i write this flash and then read the data without "ECC uncorrectable" error!

    Should replace the nand flash?

    reagards,
    Tapas Maji

  • 0xFF 0xFF is not a bad block. It is a good block marker.