你好! 是否有人使用407 FSMC配置NAND接口8bit,
访问BANK3地址0x80000000 写入0xA5,WE(PD5)输出不会变低,D[7:0]也没任何反应。
/////////////////// 配置了以下管脚及FSMC控制器
#ifdef FSMC_AS_NAND
GPIO_Config_FSMC(GPIOD, PD5_FSMC_nWE);
/* D[4:0] : Bus Line */
GPIO_Config_FSMC(GPIOD, PD14_FSMC_D0);
GPIO_Config_FSMC(GPIOD, PD15_FSMC_D1);
GPIO_Config_FSMC(GPIOD, PD0_FSMC_D2);
GPIO_Config_FSMC(GPIOD, PD1_FSMC_D3);
GPIO_Config_FSMC(GPIOE, PE7_FSMC_D4);
GPIO_Config_FSMC(GPIOE, PE8_FSMC_D5);
GPIO_Config_FSMC(GPIOE, PE9_FSMC_D6);
GPIO_Config_FSMC(GPIOE, PE10_FSMC_D7);
FSMC_NANDInitStructure.NandBank = FSMC_NAND_BANK3;
FSMC_NANDInitStructure.MemoryDataWidth = FSMC_NAND_PCC_MEM_BUS_WIDTH_8;
FSMC_NANDInitStructure.Waitfeature = FSMC_NAND_PCC_WAIT_FEATURE_DISABLE;
FSMC_NANDInitStructure.EccComputation = FSMC_NAND_ECC_DISABLE;
FSMC_NANDInitStructure.ECCPageSize = FSMC_NAND_ECC_PAGE_SIZE_256BYTE;
FSMC_NANDInitStructure.TARSetupTime = 0;
FSMC_NANDInitStructure.TCLRSetupTime = 0;
FSMC_DEVICE.PageSize = 512;
FSMC_DEVICE.BlockNbr = 1; // total blocks
FSMC_DEVICE.BlockSize = 512; // measured in number of pages
FSMC_DEVICE.PlaneSize = 1; // measured in number of blocks
FSMC_DEVICE.PlaneNbr = 1; // total planes
FSMC_DEVICE.SpareAreaSize = 0; // no spare memory
FSMC_DEVICE.ExtraCommandEnable = DISABLE;
FSMC_Timing.SetupTime = 0x0;
FSMC_Timing.WaitSetupTime = 0x2;
FSMC_Timing.HoldSetupTime = 0x1;
FSMC_Timing.HiZSetupTime = 0x0;
FSMC_Handler.Instance = FSMC_Bank2_3;
FSMC_Handler.Config = FSMC_DEVICE;
FSMC_Handler.Init = FSMC_NANDInitStructure;
FSMC_Handler.Lock = HAL_UNLOCKED;
FSMC_Handler.State = HAL_NAND_STATE_READY;
HAL_NAND_Init(&FSMC_Handler, &FSMC_Timing, &FSMC_Timing);
#endif
////////////// 执行写,不能在D[7:0]看到任何输出
while(1)
{
*(__IO uint8_t *)((uint32_t)(0x80000000)) = 0xA5;
} |