To use an external oscillator module (not just a crystal) with the STM32F4, one needs to enable the HSEBYP bit in the RCC_CR register. This change allows an integrator to define STM32_RCC_CR_HSEBYP in their board.h file if they want this configuration.

This commit is contained in:
Jeff 2017-07-30 06:22:30 -06:00 committed by Gregory Nutt
parent 7f53e08917
commit a420c0f369

View File

@ -642,6 +642,16 @@ static void stm32_stdclockconfig(void)
#else /* if STM32_BOARD_USEHSE */
/* Enable External High-Speed Clock (HSE) */
#ifdef STM32_RCC_CR_HSEBYP
/* Bypass HSE oscillator when using an external oscillator module
* Do NOT define STM32_RCC_CR_HSEBYP when using a crystal with HSE
*/
regval = getreg32(STM32_RCC_CR);
regval |= RCC_CR_HSEBYP;
putreg32(regval, STM32_RCC_CR);
#endif
regval = getreg32(STM32_RCC_CR);
regval |= RCC_CR_HSEON; /* Enable HSE */
putreg32(regval, STM32_RCC_CR);