AnsweredAssumed Answered

QSPI flag 'QSPI_FLAG_BUSY' sometimes stays set

Question asked by Peter Olsson on Oct 30, 2017
Latest reply on Apr 19, 2018 by Peter Olsson



We're having an issue on STM32F765IGT - when trying to use flash on QSPI, configured in "Indirect mode", using HAL v1.8.0, and DMA enabled.


It's quite hard to replicate, but it seems to occur when there are lots of DMA and interrupts going on. The result is that QSPI_FLAG_BUSY stays set, and it stays that way forever.


As a workaround I've used the following code, right before sending HAL_QSPI_Command(). Before executing this, I check my internal state to make sure that QSPI is in fact not busy. In 'stm32f7xx_hal_qspi.c' I've found some ifdef's for 'QSPI_V1_0', which kind of gave me the idea to use the abort command like this. However, it was not possible to just enable the compiler directive, since we must also make sure to set 'State' to 'HAL_QSPI_STATE_BUSY', or the abort function won't do anything at all.


if ((FlagStatus)(__HAL_QSPI_GET_FLAG(&qspiHandle, QSPI_FLAG_BUSY)) == SET)
    qspiHandle.State = HAL_QSPI_STATE_BUSY;


Has anyone else seen any similar issues?




Peter Olsson