Hi
I use
// UART 0 error interrupt
//
static __interrupt void _SCI0_Error_Interrupt(void) // independent error interrupt handler
{
// Used to clear framing error in DMA rx mode
//
(void)UART0_S1; // read the error source
(void)UART0_D; // read the data register (resets the framing error flag which otherwise inhibits further reception)
ulFrameingErrors[0]++; // count the number of framing errors detected for statistic purposes
}
However framing errors can lead to various other problems since the reaction to the interrupt handler can be delayed (when the UART speed is fast - eg. 5Mb/s) and so also overruns take place in the meantime.
In the worst case multiple bytes can be lost, during which you need to keep clearing errors and overruns until the input is synchronised again (either when there is a gap between reception bytes or it gets lucky).
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements
For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html