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

nrf52 uarte receive timeout

Hi,

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)

Example: 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?

Parents
  • Hi,

    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 the timer reaches a certain timeout, you know that there have been no data received for that time and you can flush the DMA buffer.

    We are working on implementing this in the SDK driver.

    Ole

Reply
  • Hi,

    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 the timer reaches a certain timeout, you know that there have been no data received for that time and you can flush the DMA buffer.

    We are working on implementing this in the SDK driver.

    Ole

Children
Related