-
Notifications
You must be signed in to change notification settings - Fork 3k
Asynch serial: read #7360
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
Comments
The driver waits for 8 characters. There's no serial event for this (I can't think of what type of event this would be? We do not have time bounded callback here - no timeout). You can use your own timeout (use Timeout object or other similar functionality). if you haven't received 8 characters within defined time, abort (should flush rx fifo to discard characters that has been received) and restart the read. |
Ok thank you, maybe timeout could be an enhancement? or possibly fire event when read starts? |
ARM Internal Ref: MBOTRIAGE-963 |
I would not recommend the asynchronous serial API as it stands, as it has the limitations you describe. It's ill-suited for general stream comms traffic. And that API is a HAL API - revising it means revising every platform's HAL. I believe some serial HAL API work is planned, and this is a known issue which would be addressed, but for now I would suggest avoiding the asynchronous API. Your best bet for serial input is to use Although I believe the asynchronous HAL API is actually implemented via interrupt-based PIO rather than DMA on most platforms, due to the hardware having similar lack-of-timeout limitations, so the performance difference isn't as large as you might think. |
Thank you. That explains, why there is no official documentation available. I will have a look on |
Description
Lets consider following code
with this code i don't get
SERIAL_EVENT_RX_COMPLETE
until i receive 8 bytes, but if only 7 bytes are sent (by mistake for example) can i get them with some kind of SERIAL EVENT? otherwise next 8 bytes sent will follow and obviosly i getSERIAL_EVENT_RX_OVERFLOW
because there was 1 byte missing to complete and 7 left are overflow.Issue request type
[X] Question
[ ] Enhancement
[ ] Bug
The text was updated successfully, but these errors were encountered: