Skip to main content
MMitc
Associate III
January 7, 2020
Question

STM32L476 HAL_QSPI_Receive_DMA() hangs intermittently.

  • January 7, 2020
  • 4 replies
  • 4895 views

While doing heavy activity with a NAND flash, the code is generally working, but occasionally I get hung up waiting for an operation to finish. I trapped it on the logic analyzer several times, and it's never at the same time. In every instance the QSPI CLK, it stops after 16 bytes of indirect DMA transfer. It gets worse when I run faster.

Is there any reason why it would do this?

What would a good recovery strategy be?

Here is the state when it happens:

0690X00000Bvi37QAB.png0690X00000Bvi2TQAR.png

And what a partial transfer looks like.

0690X00000Bvi3RQAR.png

This topic has been closed for replies.

4 replies

MMitc
MMitcAuthor
Associate III
January 17, 2020

This has gone unanswered for a while. It does not make sense to me that a QSPI master using a DMA command would arbitrarily stop. Is it maybe debugger related? Can I get an ST review? @brk​ 

Mohamed Aymen HZAMI
ST Employee
January 20, 2020

Hello,

What is the NAND memory that you are using ?

Best Regards,

Mohamed Aymen.

Panometric
Associate III
January 27, 2020

@Mohamed Aymen HZAMI​ sorry for the late reply, I have been locked out of forum by login issue. It's still @MMitc​ here.

The flash is: Micron MT29F2G01ABAGDWB-IT:G (2G x 1) , but I don't see how that is relevant if the STM32 is QSPI master. Shouldn't a DMA operation complete to the size it was configured to regardless?

Tesla DeLorean
Guru
January 27, 2020

Does it lock up the core, or just stop the transaction?

Is the DMA unit reporting some status/fault code?

Perhaps have a transfer abort callback.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Panometric
Associate III
January 27, 2020

It's just the DMA controller stopping, and I timeout after 100ms.

HAL_QSPI_GetState() = 0x22 HAL_QSPI_STATE_BUSY_INDIRECT_RX

HAL_QSPI_GetError() = 0

HAL_DMA_GetState=2 HAL_DMA_STATE_BUSY

HAL_DMA_GetError() = 0

I have a HAL_QSPI_ErrorCallback() but it does not fire.

Mohamed Aymen HZAMI
ST Employee
February 7, 2020

Hello,

Does the issue occur only when using DMA read ?

I would like that you verify from your side:

what happens when you make read operation with CPU in QUADSPI indirect mode using HAL_QSPI_Receive_IT or HAL_QSPI_Receive ? Do you read correctly from the memory ?

Best regards,

Mohamed Aymen.