UART APP_UART_COMMUNICATION_ERROR

Dear Sirs!

I used SDK 12.2. Product was developed some years ago and now I am working for upgrade. One of new features is UART. I faced very strange problem.

I send 14 bytes from PC via FTDI UART 3.3V cable to Nordic and Nordic send back different 14 bytes to PC.

This process repeats each 200 ms

Baud rate 115200 no flow control, no parity

#define UART_RX_PIN_NUMBER 3 //UART Rx
#define UART_TX_PIN_NUMBER 2 //UART Tx
#define UART_CTS_PIN_NUMBER 0xFFFFFFFF //Not connected
#define UART_RTS_PIN_NUMBER 0xFFFFFFFF //Not connected
#define UART_HWFC false


static app_uart_comm_params_t comm_params =
{
UART_RX_PIN_NUMBER,
UART_TX_PIN_NUMBER,
UART_RTS_PIN_NUMBER,
UART_CTS_PIN_NUMBER,
APP_UART_FLOW_CONTROL_DISABLED, //Flow control disabled
false, //No parity
UART_BAUDRATE_BAUDRATE_Baud115200
};

buffers.rx_buf = rx_buf;
buffers.rx_buf_size = 64;
buffers.tx_buf = tx_buf;
buffers.tx_buf_size = 64;

err_code = app_uart_init(&comm_params, &buffers, uart_event_handle, APP_IRQ_PRIORITY_HIGHEST);

despite I use EASY_DMA

#ifndef UART_EASY_DMA_SUPPORT
#define UART_EASY_DMA_SUPPORT 1
#endif

// <q> UART_LEGACY_SUPPORT - Driver supporting Legacy mode

#ifndef UART_LEGACY_SUPPORT
#define UART_LEGACY_SUPPORT 0
#endif

I get sometimes event APP_UART_COMMUNICATION_ERROR error_communication  = 1

It happens randomly. May happen.  immediately or after 2 bytes received or after 6 bytes received

As I understood this value is the same as in register ERRORSRC. Is it correct?

How can I prevent this situation? I put interrupt to highest priority, use easy dma and fifo and despite all this it happens.

What''s wrong? Please help

Best regards

Michael

Parents
  • In the other thread you asked, 

    Is it really Overrun error
    A start bit is received while the previous data still lies in RXD?

    Does it mean that EASY DMA does not work, and interrupt is too slow to read data to FIFO?

    The EasyDMA does work correctly and has nothing to do with this error. The overrun error is caused because the peer is transmitting data even after the RXD buffer is full in your nRF device and since you have disabled flowcontrol, there is no way to communicate this with the peer.

    This issue is happening because you have disabled flow control and using high baudrate. Do not focus your energy assuming that this is a hardware issue. Just reconfigure your firmware to enable flow control and/or reduce the baudrate and you will not see this error. The overrun error is working proper and this is how the UART works.

Reply
  • In the other thread you asked, 

    Is it really Overrun error
    A start bit is received while the previous data still lies in RXD?

    Does it mean that EASY DMA does not work, and interrupt is too slow to read data to FIFO?

    The EasyDMA does work correctly and has nothing to do with this error. The overrun error is caused because the peer is transmitting data even after the RXD buffer is full in your nRF device and since you have disabled flowcontrol, there is no way to communicate this with the peer.

    This issue is happening because you have disabled flow control and using high baudrate. Do not focus your energy assuming that this is a hardware issue. Just reconfigure your firmware to enable flow control and/or reduce the baudrate and you will not see this error. The overrun error is working proper and this is how the UART works.

Children
Related