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

UART Overrun Error after Reset

Hi all,

I see there are similar questions posted on this forum, but none answers my question satisfactorily.

What I have:

  • we use the nRF52 we use UART0 to
  • transmit / receive data (totally
  • straight forward circuit) we use the nrf_drv_uart driver plus our own event handler, as per Nordic example

What I experience:

  • with the Softdevice S132 disabled, data transmission / reception works flawlessly
  • with the S132 enabled, we experience more than not that UART0 is unable to receive data. Instead, overruns are reported (event->data.error.error_mask = 0x00000001)
  • if the nRF52 starts up without overrun error, Tx / Rx works fine
  • once I see overrun errors reported, I need to reset the device a couple of times before I get Tx / Rx back again.

What is your suggestion?

Thank you for your help M

Parents
  • This can happen if you disable hardware flow control on one or both sides. The softdevice can reserve CPU when there is BLE activity and when the peer side is transmitting data in UART fast while the RX buffer overflow then there will be overrun errors. Enable hardware flow control so that the other side stops transmitting uart data when the DUT have RX buffer filled.

    If the data loss is not a big problem then you can clear this error in uart irq handler so that the uart driver continues working as normal.

  • Yes, when there is no error then it is event->data.rxtx.bytes represent number of bytes received in the buffer you provided. Also event.data.rxtx.p_data should be equal to &mRecvByte[0];

    when there is error then it is event.data.error.rxtx.bytes represent number of bytes received in the buffer you provided. Also event.data.error.rxtx.p_data should be equal to &mRecvByte[0];

Reply Children
No Data
Related