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 read failed

Other Parts Discussed in Thread: AM3517

Hi,

Our board am3517 have hynix 8-bit nand connected on cs0.I defined GPMC_NAND_ECC_LP_x8_LAYOUT in u-boot.

I can write and read MLO into nand from u-boot command.

But After writing u-boot.bin into nand,I cannot read back u-boot.bin from nand.

From 0x00 to 0x6e0000 it marked as bad blocks.How to overcome this problem?

Please suggest.Thanks in advance.

Regards,

RajeeSankar 

 

  • Can you share the log? Commands you are using for flashing images? u-boot version?

    Thanks,

    Vaibhav

  • Hi,

    Thank you vaibhav.

    Please find the attached error log.

    Nand commands what I used :

    /* MLO */
    nand erase
    mmc init
    fatload mmc 0 0x82000000 MLO
    nand erase 0x0 0x50000
    nandecc hw 2
    nand write 0x82000000 0x0 0x50000
    nand read 0x82000000 0x0 0x50000
    /* U-boot */
    fatload mmc 0 0x82000000 u-boot.bin
    nand erase 0x80000 0x1C0000
    nandecc sw
    nand write 0x82000000 0x80000 0x1C0000
    nand read 0x82000000 0x80000 0x1C0000
    Regards,
    RajeeSankar
    7563.8bit_nand_error_log.txt
  • Your NAND device seems to be completely screwed up, almost all initial blocks are bad.

    The failure is very obvious here,look at the steps and log,

    # specially u-boot

    // You erase only until -x1C0000

    # nand erase 0x80000 0x1C0000

    // Then you attempted to write and then read

    # nand write 0x82000000 0x80000 0x1C0000

    # nand read 0x82000000 0x80000 0x1C0000

    Both will skip the bad blocks and try to read the next valid block, which has not been erased properly before writing. So please erase the NAND area >0x740000, where u-boot is written.

    NOTE: Since your NAND device is screwed up completely, I would recommend to use another board here OR try "nand scrub" command. I would not recommend using this command since it is risky, and may lead to software failures and data loss.

    Thanks,

    Vaibhav

    nand erase 0x80000 0x1C0000
  • Hi,

    Thank you Vaibhav.

    I tried with other board.Earlier erase,read and write was proper.

    In my code CFG_NAND macro was disabled.So by default it was booting from mmc card.

    I enabled the macro and tried nand boot once.It was not working.So once again I went back to the older code .ie disabling CFG_NAND macro.

    After that erase not happening,even for the older code.No problem in hardware,because I tried Erase,Read & Write in ccs.It was working there.

    In u-boot prompt,I tried erase.It is not happening.Without erasing properly,I can't expect read and write.

    It seems something different.Please help me on this.

    Thanks.

    Regards,

    RajeeSankar

  • Hi,

    This is the latest update in nand issue.

    By ccs code,I erased the page0 in block0.(Erasing will clean up full page0 with spare area)

    At first boot,page0 is good,not marked as a bad block.

    I tried to write some data in page0.

    It was writing properly and I was able to read.

    But after rebooting(mmc boot),page0 marked as bad.

    AM3517_CRANE # 

    Device 0 bad blocks:
      00000000
    00020000
    00040000
    00060000
    00080000
    000a0000
    000c0000
    000e0000
    00100000
    00120000
    00140000
    00160000
    00180000
    001a0000
    001c0000
    00240000
    16f80000
    
    

    page0 in Block0 should not be bad.

    Please help me to resolve this.

    Thanks in advance.

    Regards,

    RajeeSankar

  • HI Rajeesankar,

    Have you solved your issue?

    Through uboot commnads,

    for my second nand flash!

    ubifs image adding, writing is proper, but if i read same thing back , getting read error?

    Regards,

    santosh vastrad

  • Hi Santosh,

    Please check with ECC Layout section in your code.

    For me, that was the problem.I was using 8-bit nand.So ECC position should be 1-12.(ie) 0th byte will be used to mark bad blocks.

    For 16-bit nand, ECC should be 2-13.(ie) 0th & 1st byte will be used to mark bad blocks.

    This mismatching causes read error for me.

    Regards,

    RajeeSankar

  • I have x8 NAND connected to am3517 and during debugging u-boot made a lot of mistakes and a IC came with a lot of bad blocks. Do not pay attention to it, just issue the command "nand scrub.chip". The real bad blocks marked by a NAND manufacturer will be in Bad-condition anyway, but your fake-bad blocks will recover.