cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476 HAL_QSPI_Receive_DMA() hangs intermittently.

MMitc
Associate II

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

8 REPLIES 8
MMitc
Associate II

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

Hello,

What is the NAND memory that you are using ?

Best Regards,

Mohamed Aymen.

Panometric
Associate III

@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?

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
Up vote any posts that you find helpful, it shows what's working..

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.

Hello,

Can you please send me the memory datasheet.

Best regards,

Mohamed Aymen.

Here is datasheet.

Mohamed Aymen HZAMI
ST Employee

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.