I have a question regarding the nrf uart driver. The RXTO event is never triggered even though the Interrupt itself is enabled (and the line is idle after a packet, so the timeout should happen unless it's set as something unusably long, > 1 sec). I've seen this similar question, but it's over a year old and there were quite a few updates of the SDK in between, plus there is a event_rxto in the SDK / UARTE, it just never fires. Just to be clear, the uarte rxto interrupt nor the endrx interrupt are triggered when the line is idle, I get the endrx interrupt/event when the buffer is full and that's it.
Is there something special I should set to enable that event/interrupt? What is the actual timeout time set as? Did anyone else manage to get the rxto event workng, and if, could you share the code relating to the config / function calls, please and thank you :) ?
I'm setting the UARTE RX transfer size to 32 bytes, but I would like to get the interrupt when the packet ends -> the line is idle -> rxto event should happen. We're using nrf52840 and nrf52832 chips with sdk13.1.
Thanks for the help.
Hi Jørgen, I could not find any direct reference to this in the changelog for SDK15, now that that's out. Is this feature now available in SDK 15?
RXTO event should only be generated by forced stop via STOPRX task, as shown in timing diagram in Figure 4. UARTE reception with forced stop via STOPRX. Are you triggering the STOPRX task?
"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."
from here has not yet happened?
Unfortunately, this has not yet been added to the SDK. We have put some work into this, but it is not completed and tested yet. We previously shared some code in another DevZone thread that might be of interest.
In the meantime I was testing something else and noticed that I get the RXTO when I abort...although honestly, I don't really see the point in that, given that we also get the ENDRX event.
On a similar note, is it possible to somehow get the amount of bytes already copied by the dma to our buffer (or pointer to the "head" or something similar) while the DMA is still running, to be able to abort when I get the end of message byte in our protocol? I know the RXD.AMOUNT is only valid (copied from the actual register used) on the ENDRX event. Thanks
From the description in the page I linked above, this should explain this: "After the RXTO event is generated the internal RX FIFO may still contain data, and to move this data to RAM the FLUSHRX task must be triggered." It is the FLUSHRX task that triggers the ENDRX event after the RXTO event.
Unfortunately, there is no way of knowing what have been written to RAM by DMA before getting the ENDRX event, indicating that all the data is written and valid.