error_cb design patterns when using WAIT
Posted: Mon Feb 09, 2026 7:52 am
Hiya,
I'm interested in some advice on intended design patterns for error_cb.
I'm in the process of tracking down an issue with QSPI on STM32F7. I'm using wspiSend and wspiReceive with WSPI_USE_WAIT = TRUE.
I have a thread that makes periodic calls to wspiSend and (very occasionally) that thread just never wakes up when wspiSend is waiting to complete.
I *think* I might be getting something like an QUADSPI_SR_TEF (error flag) interrupt. Out of the box, wspisend look like it gets the interrupt (any QSPI interrupt) and just wakes the wspiSend thread. The thread then thinks that the transmit is complete, then tries to transmit more on the next tick around, gets stuck, then waits forever for an interrupt that never comes.
Since wspiSend etc, don't return any error status, any error handling must be done through error_cb (or end_cb). I imagine I should add any checks for error interrupts in one of those callbacks.
However, this means there is no way to signal back to wspiSend that the transmission failed and it should abort.
How do you folks intend for this to be used? Can you point me to any examples of how others have used it? I've had a dig around in testhal (eg spi examples), but they just halt on error_cb.
Thanks
I'm interested in some advice on intended design patterns for error_cb.
I'm in the process of tracking down an issue with QSPI on STM32F7. I'm using wspiSend and wspiReceive with WSPI_USE_WAIT = TRUE.
I have a thread that makes periodic calls to wspiSend and (very occasionally) that thread just never wakes up when wspiSend is waiting to complete.
I *think* I might be getting something like an QUADSPI_SR_TEF (error flag) interrupt. Out of the box, wspisend look like it gets the interrupt (any QSPI interrupt) and just wakes the wspiSend thread. The thread then thinks that the transmit is complete, then tries to transmit more on the next tick around, gets stuck, then waits forever for an interrupt that never comes.
Since wspiSend etc, don't return any error status, any error handling must be done through error_cb (or end_cb). I imagine I should add any checks for error interrupts in one of those callbacks.
However, this means there is no way to signal back to wspiSend that the transmission failed and it should abort.
How do you folks intend for this to be used? Can you point me to any examples of how others have used it? I've had a dig around in testhal (eg spi examples), but they just halt on error_cb.
Thanks