[stm32] Disable MASRX in STM32H7 SPI #1230
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to 678fd9a and #1223.
The previous PR fixed the core bug but I still see conditions under which the peripheral enters "suspended" state and doesn't recover. I added some in-memory logging to trace execution of the function and I can see the following:
It seems that once the RX FIFO has been cleared and emptied, the next transmitted byte always enters SUSP mode. It is unclear why this happens. This seems like a peripheral bug to me. There isn't any mention of this behavior in the errata.
I found that either limiting the FIFO usage to only 15 bytes or disabling MASRX is sufficient to fix the issue. When MASRX is not set, neither SUSP nor OVR are seen for the same transmit sequence. In other words, the SUSP state clearly isn't just triggered by the overrun state (it is attempting to suspend before it overruns) and it seems the suspend logic is buggy, or at least, doesn't work how I'd expect.
Since we don't use the suspend state, I disabled it.