As the current hand only 16MHZ of the 2520 package of SMD Crystal, 8MHZ This package does not make so small, so first with 16MHZ, so we need to modify the program-related RCC clock:
1,stm32f4xx.h
#define Hse_value ((uint32_t) 16000000)/*!< VALUE of the External oscillator in Hz */
2,system_stm32f4xx.c
/* Pll_vco = (hse_value or hsi_value/pll_m) * Pll_n */
#define PLL_M
/* USB OTG FS, SDIO and RNG Clock = pll_vco/pllq */
#define PLL_Q 7
#if defined (stm32f40_41xxx)
#define PLL_N 336
/* SYSCLK = pll_vco/pll_p */
#define PLL_P 2
#endif/* stm32f40_41xxx */
#if defined (stm32f427_437xx) | | Defined (STM32F429_439XX)
#define PLL_N 360
/* SYSCLK = pll_vco/pll_p */
#define PLL_P 2
#endif/* stm32f427_437x | | STM32F429_439XX * *
#if defined (stm32f401xx)
#define PLL_N 336
/* SYSCLK = pll_vco/pll_p */
#define PLL_P 4
#endif/* stm32f401xx */
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
crazyflie2.0 RCC Clock knowledge