2022-06-23 10:03 AM
Hello!
I'm receiving data in UART Rx with DMA and I need to make it inmunne to disconnections. Now, sometimes I can recover the communication after a disconnection, but I need it always.
Using the debugger I realized that huart1.ErrorCode change its value from 0 to 2,4 or 6. I guess they are noise, frame and noise+frame(?) errors, and after this error the UART stops.
How can I handle this error with my HAL_UART_ErrorCallback and resume UART communication?
Thank you!
2022-06-24 12:47 AM
"ErrorCode change its value from 0 to 2,4 or 6"
Sounds like a bit map ?
"I guess they are noise, frame and noise+frame(?) errors"
Would work for a bit map - surely, this must be described in the documentation?
"How can I handle this error"
That's really down to you - what makes sense for your particular application?
You might:
2022-06-24 09:02 AM
You might want to take a look at the MIN protocol:
GitHub - min-protocol/min: The MIN protocol specification and reference implementation
2022-06-24 10:23 AM
It seems that wouldn't give any indication that a frame has been lost (eg, due to corruption)?
From the Wiki:
Also (under 'Flow Control'):
https://github.com/min-protocol/min/wiki
This may or may not be a problem - depending on the application ...
2022-06-27 01:11 AM
Hi @Andrew Neil,
The protocol has a "transport part" with "delivery guarantees". Although it is not clearly said on the wiki, from what I understood in the source code, provided that an option is activated (it is, by default), the sender of a packet will expect an ACK for each frame sent ; or will send the frame again and again, as long as the corresponding ACK is not received.