Skip to content

Commit 05e72dc

Browse files
authored
Merge pull request #6353 from jeromecoutant/PR_RTC_LSE
STM32 RTC init
2 parents 02130a2 + 2f86b3a commit 05e72dc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

targets/TARGET_STM/rtc_api.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ void rtc_init(void)
5858
}
5959

6060
#if MBED_CONF_TARGET_LSE_AVAILABLE
61-
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE;
61+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
6262
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
6363
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
64-
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
6564

6665
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
6766
error("Cannot initialize RTC with LSE\n");
@@ -81,9 +80,8 @@ void rtc_init(void)
8180
__HAL_RCC_BACKUPRESET_RELEASE();
8281

8382
// Enable LSI clock
84-
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE;
83+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
8584
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
86-
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
8785
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
8886
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
8987
error("Cannot initialize RTC with LSI\n");

0 commit comments

Comments
 (0)