diff options
| -rw-r--r-- | embassy-stm32/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/h.rs | 9 |
3 files changed, 10 insertions, 2 deletions
diff --git a/embassy-stm32/CHANGELOG.md b/embassy-stm32/CHANGELOG.md index d8706ee39..c8ae7a357 100644 --- a/embassy-stm32/CHANGELOG.md +++ b/embassy-stm32/CHANGELOG.md | |||
| @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 19 | - chore: Updated stm32-metapac and stm32-data dependencies | 19 | - chore: Updated stm32-metapac and stm32-data dependencies |
| 20 | - feat: stm32/adc/v3: allow DMA reads to loop through enable channels | 20 | - feat: stm32/adc/v3: allow DMA reads to loop through enable channels |
| 21 | - fix: Fix XSPI not disabling alternate bytes when they were previously enabled | 21 | - fix: Fix XSPI not disabling alternate bytes when they were previously enabled |
| 22 | - fix: Fix stm32h7rs init when using external flash via XSPI | ||
| 22 | 23 | ||
| 23 | ## 0.3.0 - 2025-08-12 | 24 | ## 0.3.0 - 2025-08-12 |
| 24 | 25 | ||
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index e4a8ff0ab..3be98c462 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -526,7 +526,7 @@ fn init_hw(config: Config) -> Peripherals { | |||
| 526 | } | 526 | } |
| 527 | }); | 527 | }); |
| 528 | 528 | ||
| 529 | #[cfg(not(any(stm32f1, stm32wb, stm32wl)))] | 529 | #[cfg(not(any(stm32f1, stm32wb, stm32wl, stm32h7rs)))] |
| 530 | rcc::enable_and_reset_with_cs::<peripherals::SYSCFG>(cs); | 530 | rcc::enable_and_reset_with_cs::<peripherals::SYSCFG>(cs); |
| 531 | #[cfg(not(any(stm32h5, stm32h7, stm32h7rs, stm32wb, stm32wl)))] | 531 | #[cfg(not(any(stm32h5, stm32h7, stm32h7rs, stm32wb, stm32wl)))] |
| 532 | rcc::enable_and_reset_with_cs::<peripherals::PWR>(cs); | 532 | rcc::enable_and_reset_with_cs::<peripherals::PWR>(cs); |
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 @@ | |||
| 1 | use core::ops::RangeInclusive; | 1 | use core::ops::RangeInclusive; |
| 2 | 2 | ||
| 3 | #[cfg(stm32h7rs)] | 3 | #[cfg(stm32h7rs)] |
| 4 | use stm32_metapac::rcc::vals::Plldivst; | 4 | use stm32_metapac::rcc::vals::{Plldivst, Xspisel}; |
| 5 | 5 | ||
| 6 | use crate::pac; | 6 | use crate::pac; |
| 7 | pub use crate::pac::rcc::vals::{ | 7 | pub 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 {} |
