不知道各位有使用过rt-thread系统么,我在调试时出现怪问题!使用
STM32F429
开发板(官方的那个)
不带操作系统时,移植emWin+tft屏(FSMC),运行正常(emWin的demo程序都是正常);
移植rt-thread系统进来,发现程序一直跑飞,最后发现在配置FSMC函数上,将此函数屏蔽,rt-thread系统能正常,否则程序就跑飞!!很是郁闷!!
FSMC配置如下:
sta
tic void LCD_FMCConfig(void)
{
FMC_NORSRAMInitTypeDef init;
FMC_NORSRAMTimingInitTypeDef timingWrite;
FMC_NORSRAMTimingInitTypeDef timingRead;
/* ʹÄÜFMCʱÖÓ */
RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FMC, ENABLE);
/*-- FMC Configuration ------------------------------------------------------*/
/*----------------------- SRAM Bank 4 ----------------------------------------*/
/* FMC_Bank1_NORSRAM4 configuration */
timingWrite.FMC_AddressSetupTime = 4; //5;
timingWrite.FMC_AddressHoldTime = 0;
timingWrite.FMC_DataSetupTime = 5; //6;
timingWrite.FMC_BusTurnAroundDuration = 1;
timingWrite.FMC_CLKDivision = 0;
timingWrite.FMC_DataLatency = 0;
timingWrite.FMC_AccessMode = FMC_AccessMode_A;
timingRead.FMC_AddressSetupTime =4;// 5;
timingRead.FMC_AddressHoldTime = 0;
timingRead.FMC_DataSetupTime =5;// 6;
timingRead.FMC_BusTurnAroundDuration = 1;
timingRead.FMC_CLKDivision = 0;
timingRead.FMC_DataLatency = 0;
timingRead.FMC_AccessMode = FMC_AccessMode_A;
init.FMC_Bank = FMC_Bank1_NORSRAM4;
init.FMC_DataAddressMux = FMC_DataAddressMux_Disable;
init.FMC_MemoryType = FMC_MemoryType_SRAM;
init.FMC_MemoryDataWidth = FMC_NORSRAM_MemoryDataWidth_16b;
init.FMC_BurstAccessMode = FMC_BurstAccessMode_Disable;
init.FMC_AsynchronousWait = FMC_AsynchronousWait_Disable;
init.FMC_WaitSignalPolarity = FMC_WaitSignalPolarity_Low;
init.FMC_WrapMode = FMC_WrapMode_Disable;
init.FMC_WaitSignalActive = FMC_WaitSignalActive_BeforeWaitState;
init.FMC_WriteOperation = FMC_WriteOperation_Enable;
init.FMC_WaitSignal = FMC_WaitSignal_Disable;
init.FMC_ExtendedMode = FMC_ExtendedMode_Enable;
init.FMC_WriteBurst = FMC_WriteBurst_Disable;
init.FMC_ReadWriteTimingStruct = &timingRead;
init.FMC_WriteTimingStruct = &timingWrite;
FMC_NORSRAMInit(&init);
/* - BANK 1 (of NOR/SRAM Bank 1~4) is enabled */
FMC_NORSRAMCmd(FMC_Bank1_NORSRAM4, ENABLE);
}
理论上裸机使用此配置正确,没道理加了rt-thread就不行了,所以很郁闷!!
怀疑是否rt-thread初始化的外设和FSMC相冲突了,但屏蔽了rt-thread初始化配置的唯一外设-----串口(当然系统时钟不能屏蔽),也给屏蔽了,问题还是在!!所以彻底郁闷了
期盼大神给我指点指点!!谢谢!!
一周热门 更多>