我的fsmc的 设置如下
p.FSMC_AddressSetupTime = 3;
p.FSMC_AddressHoldTime = 3;
p.FSMC_DataSetupTime = 3;
p.FSMC_BusTurnAroundDuration = 0;
p.FSMC_CLKDivision = 1;
p.FSMC_DataLatency = 0;
p.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_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_AsyncWait = FSMC_AsyncWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM3, ENABLE);
在程序中我定义了一个很大的数组
#ifdef ExtRamOnbord
#define NETSENDFIFO_MAXLEN 131072
#else
#define NETSENDFIFO_MAXLEN 40960
#endif
static U8 NETSENDFIFO[NETSENDFIFO_MAXLEN];
然后在初始化代码中加入
U32 i;
for(i=0;i<NETSENDFIFO_MAXLEN;i++)
NETSENDFIFO[i]=(u8)i;
在调试窗口中看到内存地址为0x68000000开始的地方,赋值NETSENDFIFO[1]的时候0x68000000和0x68000001都变成了0,赋值NETSENDFIFO[1]的时候这两个地址都变成了0x01,赋值NETSENDFIFO[2]的时候0x68000002和0x68000003都变成了0x02,赋值NETSENDFIFO[3]的时候0x68000002和0x68000003都变成了0x03,....执行完后0x68000000 开始的内存值从MDK的窗口看是0x01 0x01 0x03 0x03 0x05 0x05 。。。。
|