Skip to content

Commit

Permalink
fix: remove RTC clock source selection
Browse files Browse the repository at this point in the history
This prevents the RTC clock to be reset when clock source is not
the same and a poweroff with VBAT or software reset occurs.
Moreover, LSI does not count when power off and VBAT so it is not
useful.

Fixes stm32duino#1919

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Jan 11, 2023
1 parent 96e32aa commit 8ce924f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions variants/STM32F4xx/F446R(C-E)T/variant_NUCLEO_F446RE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,13 @@ WEAK void SystemClock_Config(void)
Error_Handler();
}

PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S_APB1 | RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S_APB1;
PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
PeriphClkInitStruct.PLLI2S.PLLI2SP = RCC_PLLI2SP_DIV2;
PeriphClkInitStruct.PLLI2S.PLLI2SM = 16;
PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
PeriphClkInitStruct.PLLI2S.PLLI2SQ = 2;
PeriphClkInitStruct.PLLI2SDivQ = 1;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
PeriphClkInitStruct.I2sApb1ClockSelection = RCC_I2SAPB1CLKSOURCE_PLLI2S;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
/* Initialization Error */
Expand Down

0 comments on commit 8ce924f

Please sign in to comment.