Fix unlocking the backup domain when enabling LSE

Set PWREN bit to enable the power interface clock before enabling access to the backup domain.
This commit is contained in:
Bartek 2023-08-01 13:46:34 +09:30
parent a1fce1b554
commit 5fcebd28f4

View File

@ -412,6 +412,7 @@ pub(crate) unsafe fn init(config: Config) {
match config.rtc_mux { match config.rtc_mux {
RtcClockSource::LSE32 => { RtcClockSource::LSE32 => {
// 1. Unlock the backup domain // 1. Unlock the backup domain
RCC.apb1enr1().modify(|w| w.set_pwren(true));
PWR.cr1().modify(|w| w.set_dbp(true)); PWR.cr1().modify(|w| w.set_dbp(true));
// 2. Setup the LSE // 2. Setup the LSE