Support for HSEBYP
Posted: Thu May 03, 2012 3:04 pm
Hi,
Could someone add support for HSEBYP?
I want to connect an external clock to the MCU, and there's no clean way to do so.
basically
in mcuconf.h:
in hal_lld.c:
HSEBYP can only be written when HSE is not enabled yet, so I put it before.
STM32_HSE_BYPASS is already defined.
Could someone add support for HSEBYP?
I want to connect an external clock to the MCU, and there's no clean way to do so.
basically
in mcuconf.h:
Code: Select all
#define STM32_HSE_BYPASS TRUE (should depend on HSE_ENABLED)in hal_lld.c:
Code: Select all
#if STM32_HSE_ENABLED
#if STM32_HSE_BYPASS
/* HSE Bypass.*/
RCC->CR |= RCC_CR_HSEBYP;
#endif
/* HSE activation.*/
RCC->CR |= RCC_CR_HSEON;
while (!(RCC->CR & RCC_CR_HSERDY))
; /* Waits until HSE is stable. */
#endif
HSEBYP can only be written when HSE is not enabled yet, so I put it before.
Bit 18 HSEBYP: External high-speed clock bypass
Set and cleared by software to bypass the oscillator with an external clock. The external
clock must be enabled with the HSEON bit set, to be used by the device. The HSEBYP bit
can be written only if the HSE oscillator is disabled.
0: external 4-16 MHz oscillator not bypassed
1: external 4-16 MHz oscillator bypassed with external clock
STM32_HSE_BYPASS is already defined.