From 5fb4bbfc3e954bca5eba334dbd9224469d8984b4 Mon Sep 17 00:00:00 2001 From: Rogan Morrow Date: Fri, 29 Aug 2025 17:51:52 +1000 Subject: don't save and reset XSPI clock source; let mux config handle it --- embassy-stm32/src/rcc/h.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/embassy-stm32/src/rcc/h.rs b/embassy-stm32/src/rcc/h.rs index 331db1968..331bab7a0 100644 --- a/embassy-stm32/src/rcc/h.rs +++ b/embassy-stm32/src/rcc/h.rs @@ -431,13 +431,10 @@ pub(crate) unsafe fn init(config: Config) { while !RCC.cr().read().hsirdy() {} #[cfg(stm32h7rs)] - let (xspi1sel, xspi2sel) = { - // Save XSPI clock source settings and switch the clock source so it will use HSI - let xspi1sel = RCC.ahbperckselr().read().xspi1sel(); - let xspi2sel = RCC.ahbperckselr().read().xspi2sel(); + { + // Switch the XSPI clock source so it will use HSI RCC.ahbperckselr().modify(|w| w.set_xspi1sel(Xspisel::HCLK5)); RCC.ahbperckselr().modify(|w| w.set_xspi2sel(Xspisel::HCLK5)); - (xspi1sel, xspi2sel) }; // Use the HSI clock as system clock during the actual clock setup @@ -688,13 +685,6 @@ pub(crate) unsafe fn init(config: Config) { config.mux.init(); - #[cfg(stm32h7rs)] - { - // Set the XSPI clock source back to what it was originally - RCC.ahbperckselr().modify(|w| w.set_xspi1sel(xspi1sel)); - RCC.ahbperckselr().modify(|w| w.set_xspi2sel(xspi2sel)); - } - set_clocks!( sys: Some(sys), hclk1: Some(hclk), -- cgit