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

UARTE STOPRX on exact byte

Hi there,

I'm issuing a STOPRX at a specific time but I'm noticing that more bytes are being put into the buffer from after the STOPRX was issued.

Is there a way to stop the UARTE on the exact byte and process, and receive all bytes from that point on to a different buffer?

Please advise.

UPDATE

After triggering a STOPRX, the UARTE will hang around for a few more bytes, placing them in the same buffer and then calling ENDRX. This is problematic since these new bytes are part of a different message.

image description

Here you can see that STOPRX is triggered during some small idle times, yet the ENDRX doesn't happen till much later.

This results in ENDRX being called with 11, 6 and 1 bytes read (when it should be 6, 6 and 6 bytes read)

  • Aha - so my deduction/guesswork about how the UARTE treated DMA turned out to be about right. It does kind of makes sense, the UART itself just gets bytes and puts them in a FIFO and sets control lines, EasyDMA reads the lines to know when there's a byte, takes the byte and stuffs it in memory, two independent processes. So it's not that surprising that when you force stop it with the buffer not full, the EasyDMA just keeps on doing its thing. Only when you stop because the buffer is full will you then queue up bytes in the FIFO.

    One piece of good which could come out of this perhaps .. some updates to the UARTE documentation to expand and clarify some of this. A casual read of the current docs leads you think STOPRX would do what the OP expected, an in-depth read leaves you scratching your head about possible edge cases.

  • I also feel that the documentation regarding how EasyDMA moves the bytes from FIFO to buffer could be updated. I will put this forward to the designers.

  • Sorry we are not supposed to talk about internal registers here as they are not tested with production quality. Sorry for my previous remarks. I have edited (deleted part of it) one comment.

Related