diff options
-rw-r--r-- | os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c | 9 | ||||
-rw-r--r-- | testhal/STM32/multi/QSPI-MFS/.project | 12 |
2 files changed, 17 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c index 523a6471e..7e42b6ffb 100644 --- a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c +++ b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c @@ -77,12 +77,15 @@ static void qspi_lld_serve_dma_interrupt(QSPIDriver *qspip, uint32_t flags) { */
static void qspi_lld_serve_interrupt(QSPIDriver *qspip) {
- /* Stop everything.*/
- dmaStreamDisable(qspip->dma);
-
/* Portable QSPI ISR code defined in the high level driver, note, it is
a macro.*/
_qspi_isr_code(qspip);
+
+ /* Stop everything, we need to give DMA enough time to complete the ongoing
+ operation. Race condition hidden here.*/
+ while (dmaStreamGetTransactionSize(qspip->dma) > 0U)
+ ;
+ dmaStreamDisable(qspip->dma);
}
/*===========================================================================*/
diff --git a/testhal/STM32/multi/QSPI-MFS/.project b/testhal/STM32/multi/QSPI-MFS/.project index f3561b950..fd02d3c02 100644 --- a/testhal/STM32/multi/QSPI-MFS/.project +++ b/testhal/STM32/multi/QSPI-MFS/.project @@ -84,7 +84,17 @@ <link>
<name>test</name>
<type>2</type>
- <locationURI>CHIBIOS/test</locationURI>
+ <locationURI>virtual:/virtual</locationURI>
+ </link>
+ <link>
+ <name>test/lib</name>
+ <type>2</type>
+ <locationURI>CHIBIOS/test/lib</locationURI>
+ </link>
+ <link>
+ <name>test/mfs</name>
+ <type>2</type>
+ <locationURI>CHIBIOS/test/mfs</locationURI>
</link>
</linkedResources>
</projectDescription>
|