Skip to content

Commit

Permalink
fix(backup): enable RTC clock for TAMP backup registers
Browse files Browse the repository at this point in the history
Fixes #2152.

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Oct 30, 2023
1 parent 81583c5 commit ff98229
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cores/arduino/stm32/backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ static inline void enableBackupDomain(void)
/* Enable BKPSRAM CLK for backup SRAM */
__HAL_RCC_BKPSRAM_CLK_ENABLE();
#endif
#if defined(TAMP_BKP0R) && defined(__HAL_RCC_RTCAPB_CLK_ENABLE)
/* Enable RTC CLK for TAMP backup registers */
__HAL_RCC_RTCAPB_CLK_ENABLE();
#endif
}

static inline void disableBackupDomain(void)
Expand All @@ -102,6 +106,10 @@ static inline void disableBackupDomain(void)
/* Disable BKP CLK for backup registers */
__HAL_RCC_BKP_CLK_DISABLE();
#endif
#if defined(TAMP_BKP0R) && defined(__HAL_RCC_RTCAPB_CLK_DISABLE)
/* Disable RTC CLK for TAMP backup registers */
__HAL_RCC_RTCAPB_CLK_DISABLE();
#endif
}

static inline void setBackupRegister(uint32_t index, uint32_t value)
Expand Down

0 comments on commit ff98229

Please sign in to comment.