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)

  • ok that's what I'd expect to happen - however reading the original query and all the follow ups, it seems that all 4 bytes end up in the data buffer. or perhaps I've misunderstood what the OP was saying. I would expect that if the EasyDMA transaction is stopped, the very most that would get transferred would be any byte currently being transferred if there is one. That's especially true given this application is just going at 9600 baud.

    He definitely says 'more bytes are being put in the buffer', so that sounds like more than one. I got the impression the manual talking about flushing the RX FIFO was in the case the transaction stopped because the data buffer was full, in which case they have nowhere else to go.

    I dunno - I haven't tested it - I'm just going on what I read and my interpretation of it.

  • I will contact the engineer now. I have to do that tomorrow. Will update this thread later.

  • Exactly, I really don't mind the delay, its the fact that bytes received after a STOPRX are also being put in the same buffer, when I feel they should either stay in the FIFO or be put in the second buffer that I switched to in RXSTARTED.

  • Hi,

    I have now contacted the engineer. This is not good news, the EasyDMA will continue to put bytes from FIFO to the buffer between STOPRX task and ENDRX event. The engineer's point was that when you have set the RXD.MAXCNT to 'x' bytes then the UARTE architecture assumed that you expect x bytes to come and moving bytes from FIFO between STOPRX and ENDRX should not matter. But I see that in your case this does not help. Can you open a portal page so that I can give you more information regarding using this and a possible workaround for your case.

Related