Hi,
I'm using nRF52840DK with a UART peripheral (on SDK 17.1). I'm wondering what's the right way to handle UART error. Every time the peripheral power cycles, I'll get an NRF_DRV_UART_EVT_ERROR event. However, the nrf_drv_uart_errorsrc_get() always returns 0. I tried using `nrf_uart_errorsrc_get_and_clear` to clear the error but it doesn't work. Could anyone suggest the right way to clear the error?
Thanks,
Ye-Sheng
static void uart0_event_handler(nrf_drv_uart_event_t * p_event, void * p_context) {
(void)p_context;
uint32_t error_code;
switch (p_event->type)
{
case NRF_DRV_UART_EVT_ERROR:
error_code = nrf_drv_uart_errorsrc_get(&m_uart0_driver);
NRF_LOG_INFO("Error code: %u", error_code);
break;
...
