Hi,
I am running into some problems with libuarte. I have two nRF52840-DKs talking to each other over UART. My setup is not ordinary however. The hardware configuration looks like this:
I am basically trying to communicate over a 1-wire bus using libuarte. The way I'm doing it is by having the TX pin configured as an input when in "RX mode" and have the TX pin configured as an output pin when in "TX mode". One problem that is faced with such a configuration is that the transmitted data will also be received by the transmitter. But this data can be discarded by comparing each incoming packet with the latest transmitted packet.
My code looks like this:
This implementation works fine up until a certain point. The problem I am facing is that after a while, the communication stops working...The problem can be remedied by increasing the rx_buf_size in the NRF_LIBUARTE_ASYNC_DEFINE macro call. I don't understand why this could be happening, I am calling nrf_libuarte_async_rx_free in every instance the libuarte event handler is called with event type NRF_LIBUARTE_ASYNC_EVT_RX_DATA. It's worth noting that both sides (both nRF52840-DKs) experience this issue.
Am I missing something?
I am using arm-gcc 9.2.1 on MacOS with nRF5SDK v.17.0.2.
Best regards,
Tofik