diff options
| author | Rogan Morrow <[email protected]> | 2025-08-29 17:51:52 +1000 |
|---|---|---|
| committer | Rogan Morrow <[email protected]> | 2025-08-29 17:51:52 +1000 |
| commit | 5fb4bbfc3e954bca5eba334dbd9224469d8984b4 (patch) | |
| tree | 0677d11f0770f53842c434df41abe997a7c69a9a | |
| parent | 13fc222ef45e16980aca221044ae41d106065ce1 (diff) | |
don't save and reset XSPI clock source; let mux config handle it
| -rw-r--r-- | embassy-stm32/src/rcc/h.rs | 14 |
1 files 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) { | |||
| 431 | while !RCC.cr().read().hsirdy() {} | 431 | while !RCC.cr().read().hsirdy() {} |
| 432 | 432 | ||
| 433 | #[cfg(stm32h7rs)] | 433 | #[cfg(stm32h7rs)] |
| 434 | let (xspi1sel, xspi2sel) = { | 434 | { |
| 435 | // Save XSPI clock source settings and switch the clock source so it will use HSI | 435 | // Switch the XSPI clock source so it will use HSI |
| 436 | let xspi1sel = RCC.ahbperckselr().read().xspi1sel(); | ||
| 437 | let xspi2sel = RCC.ahbperckselr().read().xspi2sel(); | ||
| 438 | RCC.ahbperckselr().modify(|w| w.set_xspi1sel(Xspisel::HCLK5)); | 436 | RCC.ahbperckselr().modify(|w| w.set_xspi1sel(Xspisel::HCLK5)); |
| 439 | RCC.ahbperckselr().modify(|w| w.set_xspi2sel(Xspisel::HCLK5)); | 437 | RCC.ahbperckselr().modify(|w| w.set_xspi2sel(Xspisel::HCLK5)); |
| 440 | (xspi1sel, xspi2sel) | ||
| 441 | }; | 438 | }; |
| 442 | 439 | ||
| 443 | // Use the HSI clock as system clock during the actual clock setup | 440 | // Use the HSI clock as system clock during the actual clock setup |
| @@ -688,13 +685,6 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 688 | 685 | ||
| 689 | config.mux.init(); | 686 | config.mux.init(); |
| 690 | 687 | ||
| 691 | #[cfg(stm32h7rs)] | ||
| 692 | { | ||
| 693 | // Set the XSPI clock source back to what it was originally | ||
| 694 | RCC.ahbperckselr().modify(|w| w.set_xspi1sel(xspi1sel)); | ||
| 695 | RCC.ahbperckselr().modify(|w| w.set_xspi2sel(xspi2sel)); | ||
| 696 | } | ||
| 697 | |||
| 698 | set_clocks!( | 688 | set_clocks!( |
| 699 | sys: Some(sys), | 689 | sys: Some(sys), |
| 700 | hclk1: Some(hclk), | 690 | hclk1: Some(hclk), |
