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.

DM8148 ECC: uncorrectable.

Hi,

I am working on the product using NAND flash, when I erase completely from SD boot mode from uboot and then boot the Linux kernel and flash the image onto NAND using mtdutils, this work for the first time. If again I go into SD bootmode boot linux and again reflash the images onto NAND it fails to load second stage uboot saying ECC: uncorrectable.

So I suspect there is some issue with the uboot nand driver with linux nand driver while erasing.

Can any one point me to the fix please ?

Thank And Regards,

Mike

  • Hi Mike,

    Are you using EZSDK or DVR RDK or IPNC RDK or else? Which version? Are you using TI EVM or custom board?

    You can flash your NAND from u-boot, from user space (with MTD utils) and from CCS/JTAG. Per mine understanding you need to flash everything (u-boot-min, u-boot.bin, uImage and rootfs) from user space, is that correct?

    Regards,
    Pavel
  • Hi Pavel,

    I am using the EZSDK release and its a custom board with 512Mb of nand size.
    As I told in my earlier post when I do a erase of nand from u-boot and write the images to nand from linux it works fine then again later when I boot from NAND and boot linux and now reflash the images it doesnt work it fails with ECC errors which tells me that there is some issue in NAND erase.

    Thanks And Regards,
    Mike
  • Mike,

    mike A said:
    I am using the EZSDK release

    Which version? Is it 5.05.02.00?

    mike A said:
    later when I boot from NAND and boot linux and now reflash the images it doesnt work it fails with ECC errors

    Can you provide me the steps you are using to reflash the NAND from linux? Can you provide me console log with the ECC errors?

    Regards,
    Pavel

  • Hi Pavel,

    Yes version 5.05.02.00.

    The steps are as follows:--
    1: I boot from SD boot mode erase nand in u-boot, boot linux flash the images onto nand using mtdutils.
    2: I boot into linux from NAND, now again using mtdutils I reflash the images and now when I reboot I get ECC errors

    Following is the log of NAND booting it fails to read the 2nd stage u-boot,
    U-Boot 2010.06-00315-g97d1cbc-dirty (May 26 2015 - 11:14:21)

    DRAM: 2 GiB
    DCACHE: Off
    NAND: HW ECC BCH8 Selected
    512 MiB
    Using default environment

    ECC: uncorrectable.


    Thanks And Regards,
    Mike
  • Hi Pavel.

    Does the below write with ECC ?

    cat file_name > /dev/mtdblock0

    Thanks And Regards,
    Mike
  • Mike,

    I made some tests on my side (DM814x TI EVM with 256MB NAND). I was able to boot from NAND (UBIFS) to user space then erase 1st and 2nd stage bootloaders, flash new 1st and 2nd stage bootloaders and then reboot from NAND fine. Below is the log file how I erase and reflash from user space:

    root@dm814x-evm:~# flash_eraseall /dev/mtd0

    flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it

    Erasing 128 Kibyte @ 0 -- 100 % complete

    root@dm814x-evm:~# nandwrite -p /dev/mtd0 u-boot.min.nand

    Writing data to block 0 at offset 0x0

    root@dm814x-evm:~# sync

    root@dm814x-evm:~# flash_eraseall /dev/mtd1

    flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it

    Erasing 128 Kibyte @ 220000 -- 100 % complete

    root@dm814x-evm:~# nandwrite -p /dev/mtd1 u-boot.bin

    Writing data to block 0 at offset 0x0

    Writing data to block 1 at offset 0x20000

    root@dm814x-evm:~# sync

    root@dm814x-evm:~# reboot

    ........................

    .......................

    Restarting system.

    U-Boot 2010.06 (May 26 2015 - 15:38:30)

    TI8148-GP rev 2.1

    ARM clk: 600MHz

    DDR clk: 400MHz

    DRAM:  1 GiB

    DCACHE:  Off

    NAND:  HW ECC BCH8 Selected

    256 MiB

    Using default environment

    The 2nd stage U-Boot will now be auto-loaded

    Please do not interrupt the countdown till TI8148_EVM prompt if 2nd stage is already flashed

    Hit any key to stop autoboot:  0

    NAND read: device 0 offset 0x20000, size 0x40000

    262144 bytes read: OK

    ## Starting application at 0x81000000 ...

    U-Boot 2010.06 (May 26 2015 - 15:36:00)

    TI8148-GP rev 2.1

    ARM clk: 600MHz

    DDR clk: 400MHz

    I2C:   ready

    DRAM:  1 GiB

    DCACHE:  On

    NAND:  HW ECC BCH8 Selected

    256 MiB

    MMC:   OMAP SD/MMC: 0

                             .:;rrr;;.                  

                       ,5#@@@@#####@@@@@@#2,            

                    ,A@@@hi;;;r5;;;;r;rrSG@@@A,          

                  r@@#i;:;s222hG;rrsrrrrrr;ri#@@r        

                :@@hr:r;SG3ssrr2r;rrsrsrsrsrr;rh@@:      

               B@H;;rr;3Hs;rrr;sr;;rrsrsrsrsrsr;;H@B    

              @@s:rrs;5#;;rrrr;r#@H:;;rrsrsrsrsrr:s@@    

             @@;;srs&X#9;r;r;;,2@@@rrr:;;rrsrsrsrr;;@@  

            @@;;rrsrrs@MB#@@@@@###@@@@@@#rsrsrsrsrr;;@@  

           G@r;rrsrsr;#X;SX25Ss#@@#M@#9H9rrsrsrsrsrs;r@G

           @9:srsrsrs;2@;:;;:.X@@@@@H::;rrsrsrsrsrsrr:3@

          X@;rrsrsrsrr;XAi;;:&@@#@Bs:rrsrsrsrsrsrsrsrr;@X

          @#;rsrsrsrsrr;r2ir@@@###::rrsrsrsrsrsrsrsrsr:@@

          @A:rrsrsrsrr;:2@29@@M@@@;:;rrrrsrsrsrsrsrsrs;H@

          @&;rsrsrsrr;A@@@@@@###@@@s::;:;;rrsrsrsrsrsr;G@

          @#:rrsrsrsr;G@5Hr25@@@#@@@#9XG9s:rrrrsrsrsrs:#@

          M@;rsrsrsrs;r@&#;::S@@@@@@@M@@@@Grr:;rsrsrsr;@#

          :@s;rsrsrsrr:M#Msrr;;&#@@@@@@@@@@H@@5;rsrsr;s@,

           @@:rrsrsrsr;S@rrrsr;:;r3MH@@#@M5,S@@irrsrr:@@

            @A:rrsrsrsrrrrrsrsrrr;::;@##@r:;rH@h;srr:H@  

            ;@9:rrsrsrsrrrsrsrsrsr;,S@Hi@i:;s;MX;rr:h@;  

             r@B:rrrrsrsrsrsrsrr;;sA@#i,i@h;r;S5;r:H@r  

              ,@@r;rrrsrsrsrsrr;2BM3r:;r:G@:rrr;;r@@,    

                B@Mr;rrrrsrsrsr@@S;;;rrr:5M;rr;rM@H      

                 .@@@i;;rrrrsrs2i;rrrrr;r@M:;i@@@.      

                   .A@@#5r;;;r;;;rrr;r:r#AsM@@H.        

                      ;&@@@@MhXS5i5SX9B@@@@G;            

                          :ihM#@@@@@##hs,                

    Net:   Detected MACID:90:d7:eb:d5:13:96

    cpsw

    Hit any key to stop autoboot:

    This flow is aligned with the NAND driver user guide:

    Regards,

    Pavel

  • Hi Pavel,

    Thanks for the tests.

    What version of mtd-utils is preferred ? I am using the latest version.
    For nandwrite I was also giving -b 1 option, Ill do tests with just -p option and
    will let you know.

    And also, Does the below write with ECC ?
    cat file_name > /dev/mtdblock0

    Thanks And Regards,
    Mike
  • Hi Pavel,

    I tried with -p option it does fail again, so here is the test case of failure which you might want to give a try:

    Following are the partitions:-
    0x000000000000-0x000000020000 : "U-Boot-min-1"
    0x000000020000-0x000000040000 : "U-Boot-min-2"
    0x000000040000-0x000000060000 : "U-Boot-min-3"
    0x000000060000-0x000000080000 : "U-Boot-min-4"
    0x000000100000-0x000000140000 : "U-Boot-1"
    0x000000140000-0x0000001c0000 : "U-Boot Env-1"
    0x0000001c0000-0x000000200000 : "U-Boot-2"
    0x000000200000-0x000000280000 : "U-Boot Env-2" (Redundant copy of env)
    0x000000280000-0x0000008c0000 : "Kernel-1"
    0x0000008c0000-0x000000f00000 : "Kernel-2"
    0x000000f00000-0x00000dd40000 : "File System-1"
    0x00000dd40000-0x000020000000 : "File System-2"

    1: Firstly in SD U-boot I do complete NAND erase (using nand erase)

    2: Boot Linux from SD boot mode, erase all U-Boot-min-x partitions using flash_erase and then flash the u-boot.min.bin, and then erase U-Boot-1 partition and flash u-boot.bin the 2nd stage boot loader.

    3: Boot Linux in NAND boot mode erase all U-Boot-min-x partitions using flash_erase and then flash the u-boot.min.bin, and then erase U-Boot-2 partition and flash u-boot.bin the 2nd stage boot loader.

    Note:- u-boot.min is configured accordingly to look for proper address in NAND

    Thanks And Regards,
    Mike
  • Hi Pavel,

    Everything works fine If I use 'cat image_file > /dev/mtdblockx'
    So I am not sure what and where to debug.

    Thanks And Regards,
    Mike
  • Mike,

    mike A said:
    so here is the test case of failure which you might want to give a try

    How exactly I can try this on the DM814x TI EVM? Provide me the exact steps. I have already tried similar use case on the DM814x TI EVM (described in my previous post) and it was successful. I am not sure how exactly to run your specific use case on the DM814x TI EVM?

    mike A said:
    2: Boot Linux from SD boot mode, erase all U-Boot-min-x partitions using flash_erase and then flash the u-boot.min.bin, and then erase U-Boot-1 partition and flash u-boot.bin the 2nd stage boot loader.

    Can you try to flash the NAND from the SD u-boot prompt (bootloaders and kernel), not from SD user space. From SD user space, flash only rootfs. Is there any difference?

    Regards,
    Pavel

  • Below you can find similar instructions for flashing u-boot from Linux:

    processors.wiki.ti.com/.../Sitara_Linux_Training:_Boot_Time_Reduction

    BR
    Pavel