diff --git a/targets/TARGET_STM/lp_ticker.c b/targets/TARGET_STM/lp_ticker.c index a702fbb..9a9eb69 100644 --- a/targets/TARGET_STM/lp_ticker.c +++ b/targets/TARGET_STM/lp_ticker.c @@ -170,7 +170,11 @@ /* Enable LSE clock */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; +#if MBED_CONF_TARGET_LSE_BYPASS + RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS; +#else RCC_OscInitStruct.LSEState = RCC_LSE_ON; +#endif RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Select the LSE clock as LPTIM peripheral clock */ diff --git a/targets/TARGET_STM/rtc_api.c b/targets/TARGET_STM/rtc_api.c index 52b236b..00ef375 100644 --- a/targets/TARGET_STM/rtc_api.c +++ b/targets/TARGET_STM/rtc_api.c @@ -65,7 +65,11 @@ #if MBED_CONF_TARGET_LSE_AVAILABLE RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; +#if MBED_CONF_TARGET_LSE_BYPASS + RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS; +#else RCC_OscInitStruct.LSEState = RCC_LSE_ON; +#endif if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { error("Cannot initialize RTC with LSE\n");