2018-05-04 02:24 AM
Hi,
I found a bug in the quad spi driver for stm32l4xx. In the function HAL_QSPI_Receive_IT, the interrupts flags must be cleared before start transfer otherwise flag TC could be missed:
- WRITE_REG(hqspi->Instance->AR, addr_reg) -> transfer start
- An other task r or interrupt run... - The transfer qspi finish, flag TC set - __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TE | QSPI_FLAG_TC) -> the flag TC is cleared !BUG!My patch:
--- a/library/STM32Cube_FW_L4/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c
+++ b/library/STM32Cube_FW_L4/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c@@ -1098,12 +1098,12 @@ HAL_StatusTypeDef HAL_QSPI_Receive_IT(QSPI_HandleTypeDef *hqspi, uint8_t *pData) /* Configure QSPI: CCR register with functional as indirect read */ MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_FMODE, QSPI_FUNCTIONAL_MODE_INDIRECT_READ); - /* Start the transfer by re-writing the address in AR register */- WRITE_REG(hqspi->Instance->AR, addr_reg);- /* Clear interrupt */ __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TE | QSPI_FLAG_TC); + /* Start the transfer by re-writing the address in AR register */+ WRITE_REG(hqspi->Instance->AR, addr_reg);+ /* Process unlocked */ __HAL_UNLOCK(hqspi);#hal #stm32-l4 #quadspi #bug2018-05-04 08:35 AM
Hi d_ascenzio.julien,
I confirm that this limitation is already tracked for STM32CubeL4 and other STM32Cube packages for families embedding QSPI.
For STM32CubeL4, the preliminary planning is to have the fix available in next version of this package.
The suggested solution is as following:
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-07-26 04:07 AM
Hello,
Please note that the reported issue is fixed in the version 1.12.0 of STM32CubeL4 that is currently available on the web.
Please check it and share with us your feedback.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2019-02-25 09:28 PM
Hi Amel,
I am using STM32Cube_FW_H7_V1.3.0 drivers on STM32H750VB - QSPI 2 lines
The HAL_QSPI_Receive_IT() function remains at HAL_QSPI_STATE_BUSY_INDIRECT_RX state (0x22) indefinitely . Similar problem occured with HAL_QSPI_Receive_DMA() . HAL_QSPI_Receive() is working normally.
On related note, the fix suggested by jdascenzio, to clear interrupt flag prior to starting transfer, was not applied to this QSPI driver for this version.
Gary Cho
2019-02-26 12:21 AM
I just figured out that I forgot to enable QSPI Global Interrupt . That is the reason my QSPI state is stuck . My mistake.
Gary