diff options
| author | Bartek <[email protected]> | 2023-08-01 13:46:34 +0930 |
|---|---|---|
| committer | Bartek <[email protected]> | 2023-08-01 13:46:34 +0930 |
| commit | 5fcebd28f477f9e34ae2075b0cb6afdd545689ce (patch) | |
| tree | ad4cd2b3b737f1f2d399b23a2479c0c579c47cde | |
| parent | a1fce1b554bea8cad7f87073748145aaeca634f8 (diff) | |
Fix unlocking the backup domain when enabling LSE
Set PWREN bit to enable the power interface clock before enabling access to the backup domain.
| -rw-r--r-- | embassy-stm32/src/rcc/l4.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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) { | |||
| 412 | match config.rtc_mux { | 412 | match config.rtc_mux { |
| 413 | RtcClockSource::LSE32 => { | 413 | RtcClockSource::LSE32 => { |
| 414 | // 1. Unlock the backup domain | 414 | // 1. Unlock the backup domain |
| 415 | RCC.apb1enr1().modify(|w| w.set_pwren(true)); | ||
| 415 | PWR.cr1().modify(|w| w.set_dbp(true)); | 416 | PWR.cr1().modify(|w| w.set_dbp(true)); |
| 416 | 417 | ||
| 417 | // 2. Setup the LSE | 418 | // 2. Setup the LSE |
