本人使用STM32F103ZET7,通过FSMC总线控制NAND FLASH 芯片K9F1208,能够正常读、写、擦除以及读取状态等,但是在COPY-BACK这个功能上遇到了问题,貌似无法复制数据。我的代码如下,麻烦哪位大神遇到过这个问题赐教一下:
uint32_t NAND_CopyBack(NAND_ADDRESS SourAdd, NAND_ADDRESS DestAdd)
{
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = NAND_CMD_AREA_A;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = 0x00;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_1st_CYCLE(ROW_ADDRESS(SourAdd));
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_2nd_CYCLE(ROW_ADDRESS(SourAdd));
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_3rd_CYCLE(ROW_ADDRESS(SourAdd));
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = NAND_CMD_CPYBAK;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = 0x00;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_1st_CYCLE(ROW_ADDRESS(DestAdd));
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_2nd_CYCLE(ROW_ADDRESS(DestAdd));
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_3rd_CYCLE(ROW_ADDRESS(DestAdd));
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = NAND_CMD_WRITE_TRUE1;
return (NAND_GetStatus());
}
另外,在研读文档时已经注意到该指令需要在同一个Plane下进行,即要求地址的A14 和 A15一致,已经按此操作,但目的地址仍没有收到数据。百思不得其解,求大神指导。 |