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 4-bit ECC test

Other Parts Discussed in Thread: OMAPL138

Hi,

I modifed PDK_c6657_1_1_2_6 nand driver for 16bit NAND flash. The Nand page read and page write wokrs. And I would like to know how to test the 4-bit ECC detection and correction.

I tried the following  --

1. Erase a Nand page

1. Wirte a 256-words buffer { 0,1,2,3...255} into the same Nand page--following steps in SPRUZ3A page 3-7,  4-bit ECC calulation Writes (step 1-5)

2. Read the same Nand page. --following steps in SPRUZ3A page 3-7,  4-bit ECC calulation Reads (step 1-13)

3. Modify the above buffer, intentionally change one of words to 0, (Ex, { 0,1,2,3...255}), Overwrite the same Nand page with the modified buffer. During the overwrite, skip all ECC calulation and store steps, (Ex, with SPRUZ3A page 3-7,  4-bit ECC calulation Writes , perform step 2 only, skip step 1,3,4,5)

4. Read the same Nand page. --following steps in SPRUZ3A page 3-7,  4-bit ECC calulation Reads (step 1-13).

Since step 3 perform a overwrite without modifying the stored parity in sapre location, I expect that in step 4 it can detect and restore the overwitten word with the parity calculated for the original buffer.  The test show that it can detect the address of the overwritten word correctly, but fail to restore the original data.

Please advice what's the correct way to test the ECC.

 

GanZ

  • Ganz,

    As a pseudo code to test the ECC part on the NAND, I am attaching the source code we use for checking this feature on another device OMAPL138 that has the same EMIF peripheral. You can modify this test for creating your own test.

    8664.nandtester.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /* --------------------------------------------------------------------------
    FILE : nandtester.c
    PURPOSE : NAND writer main program
    PROJECT : Dm644x CCS NAND Flashing Utility
    AUTHOR : Daniel Allred
    DESC : CCS-based utility to flash the DM644x in preparation for
    NAND booting
    ----------------------------------------------------------------------------- */
    // C standard I/O library
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    // General type include
    #include "tistdtypes.h"
    // Device specific CSL
    #include "device.h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Hope this helps.

    Regards,

    Rahul