From 62e66cdda39d3689c5884bd883621f5fb7553117 Mon Sep 17 00:00:00 2001 From: Adam Rizkalla Date: Thu, 17 Aug 2023 19:16:03 -0500 Subject: [PATCH] stm32l4: set pwren in rcc regardless of clock source --- embassy-stm32/src/rcc/l4.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embassy-stm32/src/rcc/l4.rs b/embassy-stm32/src/rcc/l4.rs index b2828e58e..b34b8caab 100644 --- a/embassy-stm32/src/rcc/l4.rs +++ b/embassy-stm32/src/rcc/l4.rs @@ -410,10 +410,11 @@ pub(crate) unsafe fn init(config: Config) { while RCC.cfgr().read().sws() != Sw::MSI {} } + RCC.apb1enr1().modify(|w| w.set_pwren(true)); + 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