diff options
| author | everdrone <[email protected]> | 2025-10-23 12:22:31 +0200 |
|---|---|---|
| committer | everdrone <[email protected]> | 2025-10-23 12:22:31 +0200 |
| commit | 647c6f5f6969ab291130a50384cd2f26b167e008 (patch) | |
| tree | e391c58d17bc0a2fc8ec9d9d113c0a0a62c7234e | |
| parent | 97b0afb8d000bcc72582a09e3b9c2d7c33b66e7a (diff) | |
add dbgmcu
| -rw-r--r-- | embassy-stm32/src/lib.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 6abd60eb0..4ea38b414 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -175,7 +175,6 @@ pub use crate::_generated::interrupt; | |||
| 175 | /// } | 175 | /// } |
| 176 | /// ); | 176 | /// ); |
| 177 | /// ``` | 177 | /// ``` |
| 178 | |||
| 179 | // developer note: this macro can't be in `embassy-hal-internal` due to the use of `$crate`. | 178 | // developer note: this macro can't be in `embassy-hal-internal` due to the use of `$crate`. |
| 180 | #[macro_export] | 179 | #[macro_export] |
| 181 | macro_rules! bind_interrupts { | 180 | macro_rules! bind_interrupts { |
| @@ -496,6 +495,16 @@ fn init_hw(config: Config) -> Peripherals { | |||
| 496 | critical_section::with(|cs| { | 495 | critical_section::with(|cs| { |
| 497 | let p = Peripherals::take_with_cs(cs); | 496 | let p = Peripherals::take_with_cs(cs); |
| 498 | 497 | ||
| 498 | #[cfg(dbgmcu_n6)] | ||
| 499 | { | ||
| 500 | crate::pac::RCC.miscensr().write(|w| w.set_dbgens(true)); | ||
| 501 | crate::pac::RCC.miscenr().read(); // volatile read | ||
| 502 | crate::pac::DBGMCU | ||
| 503 | .cr() | ||
| 504 | .modify(|w| w.set_dbgclken(stm32_metapac::dbgmcu::vals::Dbgclken::B_0X1)); | ||
| 505 | crate::pac::DBGMCU.cr().read(); | ||
| 506 | } | ||
| 507 | |||
| 499 | #[cfg(dbgmcu)] | 508 | #[cfg(dbgmcu)] |
| 500 | crate::pac::DBGMCU.cr().modify(|cr| { | 509 | crate::pac::DBGMCU.cr().modify(|cr| { |
| 501 | #[cfg(dbgmcu_h5)] | 510 | #[cfg(dbgmcu_h5)] |
| @@ -510,7 +519,7 @@ fn init_hw(config: Config) -> Peripherals { | |||
| 510 | } | 519 | } |
| 511 | #[cfg(any( | 520 | #[cfg(any( |
| 512 | dbgmcu_f1, dbgmcu_f2, dbgmcu_f3, dbgmcu_f4, dbgmcu_f7, dbgmcu_g4, dbgmcu_f7, dbgmcu_l0, dbgmcu_l1, | 521 | dbgmcu_f1, dbgmcu_f2, dbgmcu_f3, dbgmcu_f4, dbgmcu_f7, dbgmcu_g4, dbgmcu_f7, dbgmcu_l0, dbgmcu_l1, |
| 513 | dbgmcu_l4, dbgmcu_wb, dbgmcu_wl | 522 | dbgmcu_l4, dbgmcu_wb, dbgmcu_wl, dbgmcu_n6 |
| 514 | ))] | 523 | ))] |
| 515 | { | 524 | { |
| 516 | cr.set_dbg_sleep(config.enable_debug_during_sleep); | 525 | cr.set_dbg_sleep(config.enable_debug_during_sleep); |
