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

Serial UARTE Rx fails with continuous timeout error

Hi,

I have a custom board with nrf52840 with UARTE1 instance enabled for RS485 communication.

I have 2 boards on the same configuration and trying to send data to each other.

below is the UARTE instance used

NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uarte1_drv_config,
                      24, 25,
                      RTS_PIN_NUMBER, CTS_PIN_NUMBER,
                      NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
                      NRF_UART_BAUDRATE_115200,
                      UART_DEFAULT_CONFIG_IRQ_PRIORITY);

NRF_SERIAL_QUEUES_DEF(serial1_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);
NRF_SERIAL_BUFFERS_DEF(serial1_buffs, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);
NRF_SERIAL_CONFIG_DEF(serial1_config, NRF_SERIAL_MODE_DMA,
                      &serial1_queues, &serial1_buffs, NULL, sleep_handler);
NRF_SERIAL_UART_DEF(serial1_uarte, 1);                      

Serial UARTE is initialized with the above configurations.

The problem is after sometimes randomly, the device gives me continuous timeout error when I try to read data.

But it is transmitting data I can confirm this because the other device is able to receive the data sent. 

Once it goes into this mode, the only way to come out is either a restart or a re-init of serial UARTE. If I re-init, it works for some more time and again goes back to this mode randomly.

could anyone please guide me in the right direction to fix this.

PS: I am also using a direction pin (pin no 40) which I CLEAR to Rx data and SET to Tx data.

Related