系统默认配置为:
PLL_VCO = HSE_VALUE/PLL_MPLL_N = 25_000_000/25336 = 336M
SYSCLK = PLL_VCO/PLL_P = 336_000_000/2 = 168M
更改后配置为:
PLL_VCO = HSE_VALUE/PLL_MPLL_N = 18432000/18432336000 = 336M
SYSCLK = PLL_VCO/PLL_P = 336_000_000/2 = 168M
以F407/外部晶振为18.432Mhz为例更改位置如下:
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)18432000) /*!< Value of the External oscillator in Hz */
#if defined (STM32F40_41xxx) || defined (STM32F427_437xx) || defined (STM32F429_439xx) || defined (STM32F401xx)
#define PLL_M 18432
#if defined (STM32F40_41xxx)
#define PLL_N 336000