修改STM32库函数中的晶振值

STM32F407的库文件中默认晶振值为25MHz,若外接晶振8MHz,则需修改以下几个地方:

1)修改HSE_VALUE的值

将#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */

修改为 #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */

2)修改PLL_M的值

将#define PLL_M 25修改为 #define PLL_M 8

3)修改STM32F407工程的Options设置

在Option for target"Flash"窗口中,选择Target页面,修改STMicroelectronics STM32F407VG栏中Xtal(MHz)的值为8.0

注:转载请注明出处http://www.cnblogs.com/zaishuiyifang006 人生如棋,我愿为卒,行动虽缓,可谁见我后退一步。
原文地址:https://www.cnblogs.com/zaishuiyifang006/p/4183837.html