-
Notifications
You must be signed in to change notification settings - Fork 990
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
UART interrupts incompletely enabled for FIFO mode #500
Comments
Interesting... All of which combined (using my naive understanding), suggests that the receive interrupt will only trigger when the receive fifo contains at least @kilograham Maybe we want a test similar to https://github.com/raspberrypi/pico-examples/blob/master/uart/uart_advanced/uart_advanced.c but which doesn't turn off the FIFOs? |
That does sound like what we want! Thanks, I'll open a PR. |
Fixing this bug allows us to enable the FIFO on the UART See raspberrypi/pico-sdk#500 Fixed in the SDK by raspberrypi/pico-sdk#504 Scheduled for merge in SDK 1.2.1.
Using the SDK interface routines to the UART, enabling FIFO mode doesn't work correctly on receive.
Symptom: the last few characters of a burst are not received promptly.
Explanation: uart_set_irq_enables() only enables the receive data ready interrupt for receive. In FIFO mode, that interrupt only fires when the receive FIFO fills up to the threshold. If a few more characters are received, but not enough to reach the FIFO threshold, that does not trigger another receive data ready interrupt (see 4.2.6.2 of the RP2040 data sheet). In order to get an interrupt for those last few characters, we also need to enable the receive timeout interrupt (see 4.2.6.4).
Proposed solution: in uart_set_irq_enables():
The text was updated successfully, but these errors were encountered: