Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DMA for debug interface communication #1306

Open
3 tasks
asmodai27 opened this issue Aug 12, 2022 · 0 comments
Open
3 tasks

Use DMA for debug interface communication #1306

asmodai27 opened this issue Aug 12, 2022 · 0 comments
Assignees
Labels
Controller code hardware controller project PRIORITY Important! Need to solve this soon! Software Umbrella: GUI, Controller or CI

Comments

@asmodai27
Copy link
Contributor

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:

  • Add frame markers in both controller and debug scripts debug messages
  • Enable DMA on the debug interface UART (controller side)
  • Get rid of the temporary fix from Fix issue 1298 #1305

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.

@asmodai27 asmodai27 added Controller code hardware controller project PRIORITY Important! Need to solve this soon! Software Umbrella: GUI, Controller or CI labels Aug 12, 2022
@asmodai27 asmodai27 self-assigned this Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Controller code hardware controller project PRIORITY Important! Need to solve this soon! Software Umbrella: GUI, Controller or CI
Projects
None yet
Development

No branches or pull requests

1 participant