From 5fcebd28f477f9e34ae2075b0cb6afdd545689ce Mon Sep 17 00:00:00 2001 From: Bartek Date: Tue, 1 Aug 2023 13:46:34 +0930 Subject: [PATCH] Fix unlocking the backup domain when enabling LSE Set PWREN bit to enable the power interface clock before enabling access to the backup domain. --- embassy-stm32/src/rcc/l4.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-stm32/src/rcc/l4.rs b/embassy-stm32/src/rcc/l4.rs index 237b7bc91..36c9eb2f5 100644 --- a/embassy-stm32/src/rcc/l4.rs +++ b/embassy-stm32/src/rcc/l4.rs @@ -412,6 +412,7 @@ pub(crate) unsafe fn init(config: Config) { match config.rtc_mux { RtcClockSource::LSE32 => { // 1. Unlock the backup domain + RCC.apb1enr1().modify(|w| w.set_pwren(true)); PWR.cr1().modify(|w| w.set_dbp(true)); // 2. Setup the LSE