Skip to content

Commit d695746

Browse files
FRASTMMaureenHelm
authored andcommitted
soc: arm: stm32g4 add rtc feature on this serie
This patch enables the rtc clock on the stm32g4 soc from STMicroelectronics. Even if the set by default (reset value of theRCC_APB1ENR) the bit is marked as 1. Signed-off-by: Francois Ramu <[email protected]>
1 parent 5291565 commit d695746

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/clock_control/clock_stm32g4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ void config_pll_init(LL_UTILS_PLLInitTypeDef *pllinit)
4646
*/
4747
void config_enable_default_clocks(void)
4848
{
49-
#ifdef CONFIG_CLOCK_STM32_LSE
50-
/* LSE belongs to the back-up domain, enable access.*/
51-
5249
/* Enable the power interface clock */
5350
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
5451

52+
#ifdef CONFIG_CLOCK_STM32_LSE
53+
/* LSE belongs to the back-up domain, enable access.*/
54+
5555
/* Set the DBP bit in the Power control register 1 (PWR_CR1) */
5656
LL_PWR_EnableBkUpAccess();
5757
while (!LL_PWR_IsEnabledBkUpAccess()) {

dts/arm/st/g4/stm32g4.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@
486486
compatible = "st,stm32-rtc";
487487
reg = <0x40002800 0x400>;
488488
interrupts = <41 0>;
489-
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>;
489+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>;
490490
prescaler = <32768>;
491491
status = "disabled";
492492
label = "RTC_0";

0 commit comments

Comments
 (0)