外部SRAM操作的奇怪现象求助

2019-07-21 04:42发布

  我在使用FSMC操作一个外部SRAM时,经J-Link调试发现,
当FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b时,
向地址 0x68000000+ A  写入数据时,地址 0x68000080+ A 处也会自动被写入相同的数据,其中A为 地址偏移。
例如:
向地址 0x68000000 写入0x81, 地址0x68000080处被自动写入0x81. 
当向0x68000080处写入数据时,地址0x68000000到0x68000080范围全部数据的最高位都由1变成0.

当FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b时,
向地址 0x68000000+ A  写入数据时,地址 0x68000100+A 处也会自动被写入相同的数据,
例如向地址0x68000000 写入0x81, 0x68000100也会被自动写入0x81,

请问有谁知道是什么原因? 

我的FSMC配置如下:
Timing_read.FSMC_AddressSetupTime = 3; 
Timing_read.FSMC_AddressHoldTime = 0;   
Timing_read.FSMC_DataSetupTime = 4;   
Timing_read.FSMC_BusTurnAroundDuration = 1;
Timing_read.FSMC_CLKDivision = 0;
Timing_read.FSMC_DataLatency = 0; 
Timing_read.FSMC_AccessMode = FSMC_AccessMode_A;
/*--------------------- write timings configuration ---------------------*/
Timing_write.FSMC_AddressSetupTime =2; 
Timing_write.FSMC_AddressHoldTime = 0; 
Timing_write.FSMC_DataSetupTime =3;    
Timing_write.FSMC_BusTurnAroundDuration = 1;
Timing_write.FSMC_CLKDivision = 0; 
Timing_write.FSMC_DataLatency = 0;
Timing_write.FSMC_AccessMode = FSMC_AccessMode_A;

  FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM3;
  FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
  FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
  FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
  FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
  FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;  
  FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
  FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
  FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
  FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
  FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
  FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
  FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
  FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &Timing_read;
  FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &Timing_write;
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。