本帖最后由 damiaa 于 2009-9-3 12:54 编辑
我每次读写后都调用getecc,发现ECC数据不变啊.
初始化允许ECC啦,ECCPAGE设置2K
FSMC_NANDInitStructure.FSMC_ECC = FSMC_ECC_Enable;
FSMC_NANDInitStructure.FSMC_ECCPageSize = FSMC_ECCPageSize_2048Bytes
MAIN中:
Fill_Buffer(TxBuffer, BUFFER_SIZE , 0x11);
status = FSMC_NAND_WriteLargePage(TxBuffer, WriteReadAddr, 2048/*PageNumber*/);
Ecc = FSMC_GetECC(FSMC_Bank2_NAND);
status = FSMC_NAND_ReadLargePage (RxBuffer, WriteReadAddr, 2048);
Ecc = FSMC_GetECC(FSMC_Bank2_NAND);
后来看了资料,就在读写前调用:
MAIN中:
Fill_Buffer(TxBuffer, BUFFER_SIZE , 0x11);
status = FSMC_NAND_WriteLargePage(TxBuffer, WriteReadAddr, 2048/*PageNumber*/);
Ecc = FSMC_GetECC(FSMC_Bank2_NAND);
FSMC_NANDECCCmd(FSMC_Bank2_NAND,DISABLE);
FSMC_NANDECCCmd(FSMC_Bank2_NAND,ENABLE);
status = FSMC_NAND_ReadLargePage (RxBuffer, WriteReadAddr, 2048);
Ecc = FSMC_GetECC(FSMC_Bank2_NAND);
把ECC复位,结果再读到的ECC全是0啦. 希望得到指点. |