This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART Communication error hangs RX/TX nRF52

Hi, I'am having an issue with UART using app_uart_fifo.c (SDK 0.9.2). At times I get communication error (usually at attaching and detaching uart connector) and my error handler:

  switch(app_uart_evt_p->evt_type){

    case APP_UART_COMMUNICATION_ERROR:
    {
      TRACE("UART_COMM_ERROR\r\n");
      dbg1("Err:0x%04lX :0x%04lX\n",app_uart_evt_p->data.error_communication,nrf_drv_uart_errorsrc_get());
    } break;
    default : break;

gives me two different numbers with dbg1 (printf over RTT); I thought these should be the same values of ERRORSRC, but no. Usually numebrs are 0x0004 and 0x0008;

Moreover after this UART stops working; receiveing doesn't work and sending bytes gives comm error with ERRORSRC value 0x0001 (overrun) which confirms that the UART stopped sending/receving bytes.

I don't want to reinit the whole UART and fifo module and there is no support for "reinit" at the SDK level. Could you please point me what to check or how to quickly reinit UART without the whole fifo buffer init procedure?

I have seen in nrf51.h that:

 __I  uint32_t  RXD;                /*!< RXD register. On read action the buffer pointer is displaced.
                                             Once read the character is consumed. If read when no character
                                             available, the UART will stop working.                               */

but it is not mentioned in nrf52.h, so?

Related