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

mpfs_serial.c: Add RX flowcontrol #290

Merged
merged 1 commit into from
Sep 30, 2024
Merged

mpfs_serial.c: Add RX flowcontrol #290

merged 1 commit into from
Sep 30, 2024

Conversation

jpaali
Copy link

@jpaali jpaali commented Sep 26, 2024

This is very basic functionality what we have here as we don't have RTS / CTS Flow Control in Saluki.
Disable RX interrupts and clear the FIFO in case of full RX buffer. Enable RX interrupts in case of empty buffer.

@jlaitine
Copy link

I didn't understand this... so if the rx buffer is full ( 1 queued ? ), we disable rx interrupt and start loosing data?

What is the issue this PR fixes?

@jpaali
Copy link
Author

jpaali commented Sep 27, 2024

I didn't understand this... so if the rx buffer is full ( 1 queued ? ), we disable rx interrupt and start loosing data?

What is the issue this PR fixes?

DP-10022.
UART4 (gps) goes to situation where it is unable to get out of while loop in interrupt handler (DR bit does not get cleared -> rxbuf gets full).

while (uart_rxavailable(dev))

Looping for a while also RX FIFO of UART goes overrun condition.

@jlaitine
Copy link

Looping for a while also RX FIFO of UART goes overrun condition.

Got it, thanks!

struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
bool ret = false;

if (nbuffered == 0 || upper == false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some bug in upper layers, or what is the reason for buffer empty check (nbuffered == 0)?

Just out of curiosity, it is fine to have it there

@jlaitine
Copy link

Please upstream the same patch to apache/nuttx before merging to our master, if possible!

Disable RX interrupts and clear the fifo in case of full RX buffer.
Enable RX interrupts in case of empty buffer.
@jpaali jpaali merged commit f19371d into master Sep 30, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants