本帖最后由 hpdell 于 2019-3-29 21:27 编辑 请教下,sdram 调试有数据错乱 ?? 上图片中,2个框框里面的数据内容会同步发生变化,这个是怎么回事啊 ? sdram 使用 MT48LC16M16 相关配置代码如下: uint8_t BSP_SDRAM_Init(void) { uint8_t sdramstatus = SDRAM_ERROR; FMC_SDRAM_TimingTypeDef SDRAM_Timing; SDRAM_HandleTypeDef SDRAM_Handle; FMC_SDRAM_CommandTypeDef command = {0}; /* SDRAM device configuration */ SDRAM_Handle.Instance = FMC_SDRAM_DEVICE; SDRAM_Timing.LoadToActiveDelay = 2; SDRAM_Timing.ExitSelfRefreshDelay = 7; SDRAM_Timing.SelfRefreshTime = 4; SDRAM_Timing.RowCycleDelay = 7; SDRAM_Timing.WriteRecoveryTime = 2; SDRAM_Timing.RPDelay = 2; SDRAM_Timing.RCDDelay = 2; SDRAM_Handle.Init.SDBank = FMC_SDRAM_BANK2; /* 由硬件决定,使用 FMC_SDNE1, FMC_SDCKE1 */ SDRAM_Handle.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9; SDRAM_Handle.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13; SDRAM_Handle.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16; SDRAM_Handle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4; SDRAM_Handle.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3; SDRAM_Handle.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE; SDRAM_Handle.Init.SDClockPeriod = SDCLOCK_PERIOD; /* FMC时钟200MHz,2分频后给SDRAM,即100MHz */ SDRAM_Handle.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE; /* 使能读突发 */ SDRAM_Handle.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0; /* SDRAM controller initialization */ // BSP_SDRAM_MspInit(&SDRAM_Handle, NULL); /* __weak function can be rewritten by the application */ if(HAL_SDRAM_Init(&SDRAM_Handle, &SDRAM_Timing) != HAL_OK) { sdramstatus = SDRAM_ERROR; } else { /* SDRAM initialization sequence */ BSP_SDRAM_Initialization_sequence(&SDRAM_Handle, &command); sdramstatus = SDRAM_OK; } return sdramstatus; } MT48LC16M16 相关资料 我的行列设置应该是没有错的吧 ??? sdram 读写测试代码: |
评分
查看全部评分
评分
查看全部评分
是的,a7地址线不知道是怎么搞的,结果搞到 接地上去了,悲催