From bdfd3e824834b1faf47ffcb5b32a8a2bed202617 Mon Sep 17 00:00:00 2001 From: Lok Tep Date: Tue, 21 Jun 2016 14:02:53 +0200 Subject: [PATCH] flush cache before setup --- arch/arm/src/stm32f7/stm32_sdmmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32f7/stm32_sdmmc.c b/arch/arm/src/stm32f7/stm32_sdmmc.c index 4f2b7a8d01b..dbeb880f93a 100644 --- a/arch/arm/src/stm32f7/stm32_sdmmc.c +++ b/arch/arm/src/stm32f7/stm32_sdmmc.c @@ -2694,6 +2694,10 @@ static int stm32_dmasendsetup(FAR struct sdio_dev_s *dev, stm32_sampleinit(); stm32_sample(priv, SAMPLENDX_BEFORE_SETUP); + /* Flush cache to physical memory */ + + arch_flush_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); + /* Save the source buffer information for use by the interrupt handler */ priv->buffer = (uint32_t *)buffer; @@ -2712,10 +2716,6 @@ static int stm32_dmasendsetup(FAR struct sdio_dev_s *dev, stm32_sample(priv, SAMPLENDX_BEFORE_ENABLE); - /* Flush cache to physical memory */ - - arch_flush_dcache((uintptr_t)buffer, (uintptr_t)buffer + buflen); - /* Start the DMA */ stm32_dmastart(priv->dma, stm32_dmacallback, priv, false);