nRF9160 disconnecting uart

Hi

we are developing a successor for one of our products based on the nRF9160.
One important feature is the debug UART. There are 2 ways to connect to this UART. Either via an USB-UART bridge or an FTDI cable.
To save energy the UART gets initialised when RX changes to high.
So far everything works fine.

The problem is detecting when the UART gets disconnected.

Checking every second if RX is low for x seconds works only to a certain degree. If we transmit bigger amounts of data it can happen that we wrongfully detect a disconnect.

Another idea was to check for UART_BREAK but we ran into some problems.
When debugging and setting a break point in the UART callback function where we check the UART error reason it works fine. But as soon as we remove the break point it stops working.

Does anyone have an idea what might be the problem here, or has an even better way of detecting the disconnect?

The UART used is uart2 and it is configured as 8N1 with 115200 Baud. Flow control is not used.

We are using nRF Connect SDK version 1.8.0

Best regards
Johannes

Parents Reply Children
No Data
Related