From 00b2567fbf6b264a77dbe63ca2424939957f3128 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 30 Jun 2025 00:19:47 +0200 Subject: [PATCH] stm32/dma: add missing fence on BDMA start. --- embassy-stm32/src/dma/dma_bdma.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/embassy-stm32/src/dma/dma_bdma.rs b/embassy-stm32/src/dma/dma_bdma.rs index 7dbbe7b72..caf135989 100644 --- a/embassy-stm32/src/dma/dma_bdma.rs +++ b/embassy-stm32/src/dma/dma_bdma.rs @@ -344,6 +344,9 @@ impl AnyChannel { peripheral_size: WordSize, options: TransferOptions, ) { + // "Preceding reads and writes cannot be moved past subsequent writes." + fence(Ordering::SeqCst); + let info = self.info(); #[cfg(feature = "_dual-core")] { @@ -362,9 +365,6 @@ impl AnyChannel { let state: &ChannelState = &STATE[self.id as usize]; let ch = r.st(info.num); - // "Preceding reads and writes cannot be moved past subsequent writes." - fence(Ordering::SeqCst); - state.complete_count.store(0, Ordering::Release); self.clear_irqs();