AnsweredAssumed Answered

(LP)UART Error Flags

Question asked by overdamped on Jun 15, 2015
Latest reply on Aug 25, 2015 by overdamped



I was wondering what the recommended way of receiving with errors in the KSDK uart driver is? I've found that inserting the following into the DMA receive interrupt (and something similar into the first conditional of the receive interrupt driven approach) fix issues I'm having. This strategy was essentially pulled from legacy processor expert's generated code, but I'm not sure if this is the correct way to accomplish this? Has anyone else run into this problem?


if (LPUART_HAL_GetStatusFlag(base, kLpuartNoiseDetect) ||      LPUART_HAL_GetStatusFlag(base, kLpuartParityErr) ||      LPUART_HAL_GetStatusFlag(base, kLpuartFrameErr) ||      LPUART_HAL_GetStatusFlag(base, kLpuartRxOverrun)) {      LPUART_HAL_ClearStatusFlag(base, kLpuartNoiseDetect);      LPUART_HAL_ClearStatusFlag(base, kLpuartParityErr);      LPUART_HAL_ClearStatusFlag(base, kLpuartFrameErr);      LPUART_HAL_ClearStatusFlag(base, kLpuartRxOverrun);      LPUART_HAL_Getchar(base, &placeholderChar);      LPUART_HAL_ClearStatusFlag(base, kLpuartRxDataRegFull); }