Skip to content

Commit ff98229

Browse files
committed
fix(backup): enable RTC clock for TAMP backup registers
Fixes stm32duino#2152. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 81583c5 commit ff98229

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cores/arduino/stm32/backup.h

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ static inline void enableBackupDomain(void)
8686
/* Enable BKPSRAM CLK for backup SRAM */
8787
__HAL_RCC_BKPSRAM_CLK_ENABLE();
8888
#endif
89+
#if defined(TAMP_BKP0R) && defined(__HAL_RCC_RTCAPB_CLK_ENABLE)
90+
/* Enable RTC CLK for TAMP backup registers */
91+
__HAL_RCC_RTCAPB_CLK_ENABLE();
92+
#endif
8993
}
9094

9195
static inline void disableBackupDomain(void)
@@ -102,6 +106,10 @@ static inline void disableBackupDomain(void)
102106
/* Disable BKP CLK for backup registers */
103107
__HAL_RCC_BKP_CLK_DISABLE();
104108
#endif
109+
#if defined(TAMP_BKP0R) && defined(__HAL_RCC_RTCAPB_CLK_DISABLE)
110+
/* Disable RTC CLK for TAMP backup registers */
111+
__HAL_RCC_RTCAPB_CLK_DISABLE();
112+
#endif
105113
}
106114

107115
static inline void setBackupRegister(uint32_t index, uint32_t value)

0 commit comments

Comments
 (0)