-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ports/rp2: Provide direct memory access to UART FIFOs. #13378
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Nicko van Someren <nicko@nicko.org>
Code size report:
|
@dpgeorge This works just fine for TX. Currently on the RX side there is a race condition, for which I'd appreciate your suggestions. Incoming data will raise an interrupt but in general the DMA controller will process the bytes much faster than the CPU can respond, so for small amounts of data this is not an issue. The problem comes when more data arrives after the interrupt handler has started; in this case the interrupt handler and the DMA controller will both try to read data from the FIFO, with some bytes going to each. It looks like we need a way to suppress the RX interrupt handler. One possible (fairly clean) solution to this would be to add a |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #13378 +/- ##
==========================================
- Coverage 98.40% 98.36% -0.05%
==========================================
Files 159 159
Lines 21088 21088
==========================================
- Hits 20752 20743 -9
- Misses 336 345 +9 ☔ View full report in Codecov by Sentry. |
An alternative would be to add a |
Having the DMA to transfer the data is just one element of the game. Information about how much data has been transferred is equally important, especially for receive. |
@robert-hh The amount of data received can trivially be read by looking at the value in the attribute |
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
This PR is similar in intent to #7650 but for UARTs, providing a way to easily get direct access to the FIFO register of a given UART so that the UART object can be passed directly to the
read
orwrite
argument on a DMA controller.The change introduces a new
MICROPY_PY_MACHINE_UART_FIFO_BUFFER
configuration inmpconfigport.h
because parts of themachine.UART
code are implemented in theextmod
directory rather than the port directory.Below is a simple example of how this can be used. (For the purpose of the example, pins 16 and 17 are connected together.)