使用FSMC 读写nand flash, 现在读写操作都正常的,但是想加ECC校验进去,结果读取到的值都为0,也看过网上帖子,一直没找到问题,求救大侠们:
配置如下:
FSMC_NANDInitStructure.FSMC_Bank = FSMC_Bank2_NAND; /* 定义FSMC NAND BANK 号 */
FSMC_NANDInitStructure.FSMC_Waitfeature = FSMC_Waitfeature_Disable; /* 插入等待时序使能 */
FSMC_NANDInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b; /* 数据宽度 8bit */
FSMC_NANDInitStructure.FSMC_ECC = FSMC_ECC_Enable; /* ECC错误检查和纠正功能使能 */
FSMC_NANDInitStructure.FSMC_ECCPageSize = FSMC_ECCPageSize_2048Bytes; /* ECC 页面大小 */
FSMC_NANDInitStructure.FSMC_TCLRSetupTime = 0x01; /* CLE低和RE低之间的延迟,HCLK周期数 */
FSMC_NANDInitStructure.FSMC_TARSetupTime = 0x01; /* ALE低和RE低之间的延迟,HCLK周期数 */
FSMC_NANDInitStructure.FSMC_CommonSpaceTimingStruct = &p; /* FSMC Common Space Timing */
FSMC_NANDInitStructure.FSMC_AttributeSpaceTimingStruct = &p; /* FSMC Attribute Space Timing */
FSMC_NANDInit(&FSMC_NANDInitStructure);
操作:
FSMC_NANDECCCmd(FSMC_Bank2_NAND, DISABLE);
FSMC_NANDECCCmd(FSMC_Bank2_NAND, ENABLE);
NAND_WriteMultiSectors(g_TestBuf, (us_j + (us_i * 64)), 2048, 1);
ui_ecc_data[us_j] = (FSMC_GetECC(FSMC_Bank2_NAND)) & 0x0FFFFFFF; //0-27bit
也变过写入缓存的值,结果读取到一直是0,求指导
|