UARTE RX count

I have configured EasyDMA RX.MAXCNT=256 and set EVENTS_ENDRX. If >=256 bytes arrive, an interrupt occurs immediately.
And if only 128 or 10 or 203 come.. byte, then I'll never know.
I can look at the EVENTS_RXDRDY register, and see that something has arrived. But I can't figure out exactly how many bytes came. In the RXD.AMOUNT register, it is always 0 until 256 bytes arrive, and then 256 immediately appears. How do I find out the exact number of bytes received?

Parents Reply
  • The thing is that the UARTE peripheral does not have any register that counts received bytes, so there is no straight-forward way to know from it if you have received a byte of not. The only thing you can know is when the receive buffer is full. This is a limitation in the HW

    The libuarte library use PPI and a set of events to (among other things) count received bytes. Due to this not being directly supported by the HW this is quite complex. If you want to know the details I suggest you refer to the implementation (though I would recommend you use the library instead of re-implementing yourself.)

Children
Related