Use DMA for debug interface communication #1306
Labels
Controller code
hardware controller project
PRIORITY
Important! Need to solve this soon!
Software
Umbrella: GUI, Controller or CI
Milestone
UART being asynchronous, we don't know in advance when and how much data we receive on a UART channel, which prevents us to use DMA unless the messages are properly framed and we can use character match interrupts rather than DMA transfer complete interrupts.
This will mean that the debug interface will be less resource heavy, and require less frequent interrupts (currently, at 115200 bauds, when receiving or sending data on the debug interface, we get an interrupt approximately every 80 µs. With proper framing, we should get two interrupts per debug message, at least 240µs apart since the messages are at least 4 bytes long).
Subtasks:
How do you know it has to be done
When investigating #1298, it was determined that our debug_uart could occasionally not read bytes fast enough, leading to overrun errors on the uart channel. This is due to us blocking interrupts for longer than 80µs at some point, and that by the time the interrupts were unblocked so the software could read the RxRegister, we had received a second byte, which overwrote the RxRegister.
Using DMA should alleviate this issue.
The text was updated successfully, but these errors were encountered: