I have a question regarding the nrf52 UARTE driver. I have the basics setup and working, I can send and receive data using the UARTE.
What I need to do now, is find a way to receive incoming data BEFORE the rx buffer is full (if incoming data stops coming)
I start a dma reception with a rx buffer of size 10.
Then I receive 5 bytes on the uart, and nothing more. I don't want to wait (forever?) for another 5 bytes to fill up the buffer, but rather (after a certain timeout) receive the 5 bytes.
On other platforms this can be done for example by configuring a rx timeout in the driver/hw, or by letting a hw timer monitor the rx buffer and stop the reception after a certain time if no new data has arrived.
Any hints on how I can do this on the nRF52 platform?
Unfortunately, there is no way to do this only with the UARTE peripheral.
A solution is to connect GPIOTE IN event to the UARTE RX pin and reset a timer when there is any activity on the pin. If…
Newtom: There is a nrf_drv_uart_rx_abort command which does what you want, stops the reception and gives you the received bytes (in the same event as when the dma buffer is full)
yes it would be awesome to implement that soon in the SDK driver !!!!
we are planning to work in the future projects more with Nordic
I implemented a solution similar to what Ole proposes below. Unfortunately I don't have the code available at this time so I cannot help you with the details.
Thanks, adding this functionality to the SDK driver would be very useful!
Hi hcr, will you have access to the code soon or I better shouldn't wait for that? Thx!
No, sorry not any time soon. But if I remember correctly there are examples from nordic for all the parts you need.