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 RX FIFO threshold to batch copy bytes #24

Open
MabezDev opened this issue Jul 13, 2023 · 4 comments
Open

Use RX FIFO threshold to batch copy bytes #24

MabezDev opened this issue Jul 13, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@MabezDev
Copy link
Member

Currently, the uart is being interrupted on every byte this is not optimal for performance, and especially at higher bauds we make miss single bytes. We should use the AT-CMD feature to detect end the end of slip packets and fetch a packet at a time in the interrupt.

@MabezDev MabezDev added the enhancement New feature or request label Jul 13, 2023
@igrr
Copy link
Contributor

igrr commented Jul 13, 2023

Alternatively, we could rely on rxfifo_full_thrhd to raise an interrupt only when some moderately large number of bytes (e.g. 100 bytes) are in the FIFO? That would still gave enough time for the interrupt handler to copy those bytes out of the FIFO before an overflow happens.

@MabezDev
Copy link
Member Author

Yeah, I think that would work better actually, because our slip packets are quite small.

@MabezDev MabezDev changed the title Use AT-CMD feature of the uart to detect end of slip packets Use RX FIFO threshold to batch copy bytes Jul 13, 2023
@DNedic
Copy link
Collaborator

DNedic commented Jul 17, 2023

@igrr How would this work when the packet exchange ends and there are say 90 bytes left in the FIFO?

@igrr
Copy link
Contributor

igrr commented Jul 17, 2023

The simplest option is probably to enable the RX timeout interrupt. It will fire if no byte has been received for a given number of cycles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants