From 167663462f7e4d4674e96856f1ad95bb5d522408 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Tue, 9 Oct 2018 06:35:43 -0600 Subject: [PATCH] arch/arm/src/stm32f7/stm32_serial.c: force invalidate of data cache after DMA re-enable when returning from low-power mode --- arch/arm/src/stm32f7/stm32_serial.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32f7/stm32_serial.c b/arch/arm/src/stm32f7/stm32_serial.c index 1d871e98573..b20227489aa 100644 --- a/arch/arm/src/stm32f7/stm32_serial.c +++ b/arch/arm/src/stm32f7/stm32_serial.c @@ -2628,11 +2628,14 @@ static void up_dma_reenable(struct up_dev_s *priv) RXDMA_BUFFER_SIZE, SERIAL_DMA_CONTROL_WORD); - /* Reset our DMA shadow pointer to match the address just - * programmed above. + /* Reset our DMA shadow pointer and Rx data availability count to match + * the address just programmed above. */ - priv->rxdmanext = 0; + priv->rxdmanext = 0; +#ifdef CONFIG_ARMV7M_DCACHE + priv->rxdmaavail = 0; +#endif /* Start the DMA channel, and arrange for callbacks at the half and * full points in the FIFO. This ensures that we have half a FIFO @@ -2643,7 +2646,7 @@ static void up_dma_reenable(struct up_dev_s *priv) /* Clear DMA suspended flag. */ - priv->rxdmasusp = false; + priv->rxdmasusp = false; } #endif