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.

Parents Reply
  • Hi,

    Yes I have the error NRF_SERIAL_EVENT_DRV_ERR. and checking on the error it seems to be 

    NRF_UARTE_ERROR_FRAMING_MASK error in the nrf_uarte_error_mask_t.
    I would like to know how to overcome this.
    As of now I am just doing de-init and init of the serial instance. this works fine for some more time, again it goes into this state. this is random again, sometimes 50s sometimes 2mins. Sometimes the re-init also doesn't solve it, I get the same error till I do 4-5 re-inits
Children
Related