Qiang Li - Mpu Se

How to add a new NAND Flash support in iMX WinCE BSP -blog archive

Discussion created by Qiang Li - Mpu Se Employee on Jan 5, 2012
Latest reply on Jan 28, 2013 by Keshava G N

To support a new NAND in WinCE BSP, you need add the NAND information into file "WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_FSL_V2_PDK1_9\NAND\INC\NANDTYPES.h".

The "NANDCode" line is hard to get from NAND datasheet, you can also print it ot from driver code, file "WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_FSL_V2_PDK1_9\NAND\FMDCOMMON\BIG_SECTOR_INTERLEAVE\fmd.cpp"
Function FMD_Init(), you can add the debug message as followed:

... ...
           FullCode = CSPNAND_ReadID(i);
           //only support multi-nand with same type
           //only support multi-nand connected continously
RETAILMSG(TRUE, (TEXT("NAND FullCode = 0x%x\r\n"), FullCode));  // Print out the current NAND flash code
           for(j = 0; j < sizeof(ChipInfo)/sizeof(ChipInfo[0]); j++)

... ...


An example to support the NAND NAND01GW3B2CNb

        {NAND, 1024, 2048 * 64, 64, 2048},          //FlashInfo   fi;
        {0x20, 0xF1, 0x00, 0x1d},                   //BYTE        NANDCode[NANDID_LENGTH]
        3,                                          //BYTE        NumBlockCycles
        5,                                          //BYTE        ChipAddrCycleNum
        8,                                          //BYTE        DataWidth
        1,                                          //BYTE        BBMarkNum
        {0},                                        //BYTE        BBMarkPage
        6,                                          //BYTE        StatusBusyBit
        0,                                          //BYTE        StatusErrorBit
        64,                                         //WORD        SpareDataLength
        0x70,                                       //BYTE        CmdReadStatus
        0x00,                                       //BYTE        CmdRead1
        0x30,                                       //BYTE        CmdRead2
        0x90,                                       //BYTE        CmdReadId
        0xff,                                       //BYTE        CmdReset
        0x80,                                       //BYTE        CmdWrite1
        0x10,                                       //BYTE        CmdWrite2
        0x60,                                       //BYTE        CmdErase1
        0xD0,                                       //BYTE        CmdErase2
        {30, 20, 25, 6}                             //NANDTiming  timings