mirror of https://github.com/ARMmbed/mbed-os.git
STM32WB : LSI clock selection when LSE is not available
parent
5cfee65881
commit
8c1f94f7cb
|
@ -2929,9 +2929,8 @@
|
|||
#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK
|
||||
#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2
|
||||
|
||||
#if defined(STM32L4)
|
||||
#if defined(STM32L4) || defined(STM32WB)
|
||||
#define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE
|
||||
#elif defined(STM32WB) || defined(STM32G0)
|
||||
#else
|
||||
#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK
|
||||
#endif
|
||||
|
|
|
@ -113,7 +113,11 @@ void lp_ticker_init(void)
|
|||
#else /* MBED_CONF_TARGET_LSE_AVAILABLE */
|
||||
|
||||
/* Enable LSI clock */
|
||||
#if TARGET_STM32WB
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI1;
|
||||
#else
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
||||
#endif
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||
|
||||
|
|
|
@ -61,7 +61,11 @@ void mbed_sdk_init()
|
|||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
|
||||
if (__HAL_RCC_GET_RTC_SOURCE() != RCC_RTCCLKSOURCE_NO_CLK) {
|
||||
#if TARGET_STM32WB
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI1;
|
||||
#else
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
||||
#endif
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
||||
|
|
|
@ -74,7 +74,11 @@ void rtc_init(void)
|
|||
error("PeriphClkInitStruct RTC failed with LSE\n");
|
||||
}
|
||||
#else /* MBED_CONF_TARGET_LSE_AVAILABLE */
|
||||
#if TARGET_STM32WB
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI1;
|
||||
#else
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
|
||||
#endif
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
||||
|
|
Loading…
Reference in New Issue