cancel
Showing results for 
Search instead for 
Did you mean: 

QSPI TCIE self clearing? STM32H743I QSPI peripheral sometimes hangs Writing to external flash via QSPI transmit using MDMA and both MDMA and QSPI interrupts. Sometimes the QSPI peripheral gets hung up indefinitely.

Araknai
Associate

With the ICD I found that sometimes, between the MDMA IRQ Handler - where the QSPI TCIE bit is set, and the QUADSPI_IRQHandler, the TCIE bit is cleared.

But I haven't been able to determine where or how it is being cleared; I've eliminated all locations in code related to the QUADSPI->CR.

1) So the first question is why can't I see where the TCIE bit is being cleared? Or what exactly is doing it.

I recently discovered that my issue goes away by making the QUADSPI IRQ and MDMA IRQ the same priority, while making the MDMA sub priority higher (logically) than the QUADSPI IRQ.

Before: MDMA - priority 14, sub 0, QUADSPI - priority 15, sub 0

After: Both priority 14, MDMA sub 0, QUADSPI sub 1

2) Second question is how is this priority change solving the problem?

1 ACCEPTED SOLUTION

Accepted Solutions

Watch that looking at peripheral registers in the debugger view can touch/change states, they are not memory but tied to other synchronous logic. Assume the debugger is invasive.

QSPI Flash typically can only write up to whole sectors, at sector aligned addresses. ie Micron parts writing 256 bytes at a time maximum.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

1 REPLY 1

Watch that looking at peripheral registers in the debugger view can touch/change states, they are not memory but tied to other synchronous logic. Assume the debugger is invasive.

QSPI Flash typically can only write up to whole sectors, at sector aligned addresses. ie Micron parts writing 256 bytes at a time maximum.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..