Skip to content

Commit e15e30a

Browse files
committed
fix: fix qspi waiting condition
1 parent ad2f7c3 commit e15e30a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

embassy-stm32/src/qspi/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<'d, T: Instance, M: PeriMode> Qspi<'d, T, M> {
172172
});
173173

174174
for b in buf {
175-
while !T::REGS.sr().read().tcf() && !T::REGS.sr().read().ftf() {}
175+
while !T::REGS.sr().read().tcf() && (T::REGS.sr().read().flevel() == 0) {}
176176
*b = unsafe { (T::REGS.dr().as_ptr() as *mut u8).read_volatile() };
177177
}
178178

@@ -402,7 +402,10 @@ impl<'d, T: Instance> Qspi<'d, T, Async> {
402402

403403
// STM32H7 does not have dmaen
404404
#[cfg(not(stm32h7))]
405-
T::REGS.cr().modify(|v| v.set_dmaen(true));
405+
T::REGS.cr().modify(|v| {
406+
v.set_en(true);
407+
v.set_dmaen(true)
408+
});
406409
transfer
407410
}
408411

0 commit comments

Comments
 (0)