From 6ea5aa347db40a0f50b82ff9bc39f2f2c73fb04e Mon Sep 17 00:00:00 2001 From: JuliDi <20155974+JuliDi@users.noreply.github.com> Date: Sun, 10 Sep 2023 11:05:10 +0200 Subject: [PATCH] feature-gate errata workaround for h7 --- embassy-stm32/src/qspi/mod.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/embassy-stm32/src/qspi/mod.rs b/embassy-stm32/src/qspi/mod.rs index 92219e01..900dfa83 100644 --- a/embassy-stm32/src/qspi/mod.rs +++ b/embassy-stm32/src/qspi/mod.rs @@ -183,14 +183,17 @@ impl<'d, T: Instance, Dma> Qspi<'d, T, Dma> { while T::REGS.sr().read().busy() {} - // Apply precautionary steps according to the errata... - T::REGS.cr().write_value(Cr(0)); - while T::REGS.sr().read().busy() {} - T::REGS.cr().write_value(Cr(0xFF000001)); - T::REGS.ccr().write(|w| w.set_frcm(true)); - T::REGS.ccr().write(|w| w.set_frcm(true)); - T::REGS.cr().write_value(Cr(0)); - while T::REGS.sr().read().busy() {} + #[cfg(stm32h7)] + { + // Apply precautionary steps according to the errata... + T::REGS.cr().write_value(Cr(0)); + while T::REGS.sr().read().busy() {} + T::REGS.cr().write_value(Cr(0xFF000001)); + T::REGS.ccr().write(|w| w.set_frcm(true)); + T::REGS.ccr().write(|w| w.set_frcm(true)); + T::REGS.cr().write_value(Cr(0)); + while T::REGS.sr().read().busy() {} + } T::REGS.cr().modify(|w| { w.set_en(true);