aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c15
-rw-r--r--os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c12
-rw-r--r--testhal/STM32/multi/WSPI-MFS/.project7
-rw-r--r--testhal/STM32/multi/WSPI-MFS/main.c2
-rw-r--r--testhal/STM32/multi/WSPI-MFS/make/stm32l4r9_discovery.make2
5 files changed, 18 insertions, 20 deletions
diff --git a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
index e3cc607a4..f121e14bb 100644
--- a/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
+++ b/os/hal/ports/STM32/LLD/OCTOSPIv1/hal_wspi_lld.c
@@ -285,9 +285,6 @@ void wspi_lld_stop(WSPIDriver *wspip) {
*/
void wspi_lld_command(WSPIDriver *wspip, const wspi_command_t *cmdp) {
- /* Waiting for the previous operation to complete, if any.*/
- wspi_lld_sync(wspip);
-
#if 0 //STM32_USE_STM32_D1_WORKAROUND == TRUE
/* If it is a command without address and alternate phases then the command
is sent as an alternate byte, the command phase is suppressed.*/
@@ -309,6 +306,9 @@ void wspi_lld_command(WSPIDriver *wspip, const wspi_command_t *cmdp) {
if ((cmdp->cfg & WSPI_CFG_ADDR_MODE_MASK) != WSPI_CFG_ADDR_MODE_NONE) {
wspip->ospi->AR = cmdp->addr;
}
+
+ /* Waiting for the previous operation to complete.*/
+ wspi_lld_sync(wspip);
}
/**
@@ -338,9 +338,6 @@ void wspi_lld_send(WSPIDriver *wspip, const wspi_command_t *cmdp,
dmaStreamSetTransactionSize(wspip->dma, n);
dmaStreamSetMode(wspip->dma, wspip->dmamode | STM32_DMA_CR_DIR_M2P);
- /* Waiting for the previous operation to complete, if any.*/
- wspi_lld_sync(wspip);
-
wspip->ospi->CR &= ~OCTOSPI_CR_FMODE;
wspip->ospi->DLR = n - 1U;
wspip->ospi->TCR = cmdp->dummy;
@@ -381,9 +378,6 @@ void wspi_lld_receive(WSPIDriver *wspip, const wspi_command_t *cmdp,
dmaStreamSetTransactionSize(wspip->dma, n);
dmaStreamSetMode(wspip->dma, wspip->dmamode | STM32_DMA_CR_DIR_P2M);
- /* Waiting for the previous operation to complete, if any.*/
- wspi_lld_sync(wspip);
-
wspip->ospi->CR = (wspip->ospi->CR & ~OCTOSPI_CR_FMODE) | OCTOSPI_CR_FMODE_0;
wspip->ospi->DLR = n - 1U;
wspip->ospi->TCR = cmdp->dummy;
@@ -414,9 +408,6 @@ void wspi_lld_map_flash(WSPIDriver *wspip,
const wspi_command_t *cmdp,
uint8_t **addrp) {
- /* Waiting for the previous operation to complete, if any.*/
- wspi_lld_sync(wspip);
-
/* Starting memory mapped mode using the passed parameters.*/
wspip->ospi->CR = OCTOSPI_CR_FMODE_1 | OCTOSPI_CR_FMODE_0 | OCTOSPI_CR_EN;
wspip->ospi->TCR = cmdp->dummy;
diff --git a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c
index 5ef7b7f62..66b5696d6 100644
--- a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c
+++ b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c
@@ -52,6 +52,15 @@ WSPIDriver WSPID1;
/*===========================================================================*/
/**
+ * @brief Waits for completion of previous operation.
+ */
+static inline void wspi_lld_sync(WSPIDriver *wspip) {
+
+ while ((wspip->qspi->SR & QUADSPI_SR_BUSY) != 0U) {
+ }
+}
+
+/**
* @brief Shared service routine.
*
* @param[in] wspip pointer to the @p WSPIDriver object
@@ -232,6 +241,9 @@ void wspi_lld_command(WSPIDriver *wspip, const wspi_command_t *cmdp) {
if ((cmdp->cfg & WSPI_CFG_ADDR_MODE_MASK) != WSPI_CFG_ADDR_MODE_NONE) {
wspip->qspi->AR = cmdp->addr;
}
+
+ /* Waiting for the previous operation to complete.*/
+ wspi_lld_sync(wspip);
}
/**
diff --git a/testhal/STM32/multi/WSPI-MFS/.project b/testhal/STM32/multi/WSPI-MFS/.project
index 9b26e02af..1ea006f99 100644
--- a/testhal/STM32/multi/WSPI-MFS/.project
+++ b/testhal/STM32/multi/WSPI-MFS/.project
@@ -82,12 +82,7 @@
<locationURI>CHIBIOS/os</locationURI>
</link>
<link>
- <name>test/lib</name>
- <type>2</type>
- <locationURI>CHIBIOS/test/lib</locationURI>
- </link>
- <link>
- <name>test/mfs</name>
+ <name>test</name>
<type>2</type>
<locationURI>CHIBIOS/test/mfs</locationURI>
</link>
diff --git a/testhal/STM32/multi/WSPI-MFS/main.c b/testhal/STM32/multi/WSPI-MFS/main.c
index 30c7a9c89..73dcfb065 100644
--- a/testhal/STM32/multi/WSPI-MFS/main.c
+++ b/testhal/STM32/multi/WSPI-MFS/main.c
@@ -74,7 +74,7 @@ int main(void) {
halInit();
chSysInit();
- /*Board-dependent GPIO setup code.*/
+ /* Board-dependent GPIO setup code.*/
portab_setup();
/* Starting a serial port for test report output.*/
diff --git a/testhal/STM32/multi/WSPI-MFS/make/stm32l4r9_discovery.make b/testhal/STM32/multi/WSPI-MFS/make/stm32l4r9_discovery.make
index 47345c16f..64f290378 100644
--- a/testhal/STM32/multi/WSPI-MFS/make/stm32l4r9_discovery.make
+++ b/testhal/STM32/multi/WSPI-MFS/make/stm32l4r9_discovery.make
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O2 -gdwarf-3 -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).