• MCOfrom ST-LINK: MCO output of ST-LINK MCU is used as input clock. This frequency cannot be changed, it is fixed at 8 MHz and connected toPF0/PD0/PH0- OSC_IN of STM32 microcontroller. 我手头有片NucleoSTM32F411RE BOARD,外部晶振8MZ,固定不能改,我在KeilC/C++ 页面定义:USE_STDPERIPH_DRIVER,STM32F411xE,我移值标准固件库,SYSTEM_STMF32F4XX.H, 下列:STM32F411xE关键词判斷有效時,就会执行这句 #defineHSE_VALUE ((uint32_t)25000000) /*!< Value of the Externaloscillator in Hz 就跟原厂定义8MHZ不同,我需要调整为: #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz 8MHZ,还是不用理它!!!! #if defined(STM32F40_41xxx) || defined(STM32F427_437xx) ||defined(STM32F429_439xx) || defined(STM32F401xx) ||defined(STM32F411xE) #if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!<Value of the External oscillator in Hz #endif /* HSE_VALUE */ #elif defined(STM32F446xx) #if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!<Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx ||STM32F401xx || STM32F411xE */ /** |
第一段话是NucleoSTM32F411RE的说明文档吧,说的没毛病,ST-LINK MCU的MCO输出给目标板器件8MHz时钟的。
原库中是25M时钟,想改成8M时钟也可以。但有几个地方需要改,不只改一处就行的。