aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports')
-rw-r--r--os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c b/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c
index 637871255..84b71ce5d 100644
--- a/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c
+++ b/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c
@@ -472,6 +472,9 @@ void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) {
STM32_TDES0_IC | STM32_TDES0_LS | STM32_TDES0_FS |
STM32_TDES0_TCH | STM32_TDES0_OWN;
+ /* Wait for the write to tdes0 to go through before resuming the DMA.*/
+ __DSB();
+
/* If the DMA engine is stalled then a restart request is issued.*/
if ((ETH->DMASR & ETH_DMASR_TPS) == ETH_DMASR_TPS_Suspended) {
ETH->DMASR = ETH_DMASR_TBUS;
@@ -550,6 +553,9 @@ void mac_lld_release_receive_descriptor(MACReceiveDescriptor *rdp) {
/* Give buffer back to the Ethernet DMA.*/
rdp->physdesc->rdes0 = STM32_RDES0_OWN;
+ /* Wait for the write to rdes0 to go through before resuming the DMA.*/
+ __DSB();
+
/* If the DMA engine is stalled then a restart request is issued.*/
if ((ETH->DMASR & ETH_DMASR_RPS) == ETH_DMASR_RPS_Suspended) {
ETH->DMASR = ETH_DMASR_RBUS;