aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/rcc/h.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-stm32/src/rcc/h.rs')
-rw-r--r--embassy-stm32/src/rcc/h.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/embassy-stm32/src/rcc/h.rs b/embassy-stm32/src/rcc/h.rs
index 837210b6a..331bab7a0 100644
--- a/embassy-stm32/src/rcc/h.rs
+++ b/embassy-stm32/src/rcc/h.rs
@@ -1,7 +1,7 @@
1use core::ops::RangeInclusive; 1use core::ops::RangeInclusive;
2 2
3#[cfg(stm32h7rs)] 3#[cfg(stm32h7rs)]
4use stm32_metapac::rcc::vals::Plldivst; 4use stm32_metapac::rcc::vals::{Plldivst, Xspisel};
5 5
6use crate::pac; 6use crate::pac;
7pub use crate::pac::rcc::vals::{ 7pub use crate::pac::rcc::vals::{
@@ -430,6 +430,13 @@ pub(crate) unsafe fn init(config: Config) {
430 } 430 }
431 while !RCC.cr().read().hsirdy() {} 431 while !RCC.cr().read().hsirdy() {}
432 432
433 #[cfg(stm32h7rs)]
434 {
435 // Switch the XSPI clock source so it will use HSI
436 RCC.ahbperckselr().modify(|w| w.set_xspi1sel(Xspisel::HCLK5));
437 RCC.ahbperckselr().modify(|w| w.set_xspi2sel(Xspisel::HCLK5));
438 };
439
433 // 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
434 RCC.cfgr().modify(|w| w.set_sw(Sysclk::HSI)); 441 RCC.cfgr().modify(|w| w.set_sw(Sysclk::HSI));
435 while RCC.cfgr().read().sws() != Sysclk::HSI {} 442 while RCC.cfgr().read().sws() != Sysclk::HSI {}