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.

请教:C6747的nand flash控制器的4-bit ECC不正常,请帮分析一下问题

Other Parts Discussed in Thread: TMS320C6747

Nandflash挂在DSP的A总线上作数据存储设备。

DSP为TMS320C6747,Nand Flash为三星K9HCG08U1M,DSP开发软件为CCS3.3,配置CS3为nand flash控制器。

现在nandflash读、写正常,即写进去一页数据,然后再读出来,两者是一致的;但在调试DSP nandflash的4-bit ECC功能时,发现写入时DSP计算的校验值,与读出同一组数据(无误码)时,计算的校验值不同,可能什么原因会导致这种情况?

nandflash读写正常,说明电路、EMIF配置等都是没有问题的。问题应该出在4-bit校验等相关的配置上,我仔细对照了一下手册上4-Bit ECC校验的流程和nandwrite工程下的相关程序,没有发现异异常啊。

已经调试了一个星期了,还未定位问题,急急急!请大神指教啊!

nand部分代码.docx
  • 我好像没有注意到TI提供的NAND例程里有4bit ECC的,你是自己写的么(也有可能有我没注意到)?

    如果是自己写的,是否注意到NAND ECC操作的流程呢:

    the 4BITECC_ADD_CALC_START bit in the NAND Flash control register (NANDFCR) to 1.
    10. Start another read from NAND, if required (a new thread from step 1).
    11. Wait for the 4-bit ECC correction state field (ECC_STATE) in the NAND Flash status register
    (NANDFSR) to be equal to 1, 2h, or 3h.
    12. The number of errors can be read from the 4-bit number of errors field (ECC_ERRNUM) in the NAND
    Flash status register (NANDFSR).
    13. Read the error address from the NAND Flash error address 1-2 registers (NANDERRADD[2:1]).
    Address for the error word is equal to (total_words_read + 7 - address_value). For 518 bytes, the
    address will be equal to (525 - address_value).
    14. Read the error value from the NAND Flash error value 1-2 registers (NANDERRVAL[2:1]). Errors can
    be corrected by XORing the error word with the error value from the NAND Flash error value 1-2
    registers (NANDERRVAL[2:1]).

  • 问题已经解决了。

    在load ecc的时候把顺序弄反了。应该是先VAL8,最后是val1。太粗心了。

    手册上对4bit ecc的流程讲得不是太清楚,还是需要结合例子来看。