Skip to content

fix(backup): enable RTC clock for TAMP backup registers #2153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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