<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>UARTE dropping received characters @ 115,200</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60808/uarte-dropping-received-characters-115-200</link><description>I have written a UARTE driver, to conform to the kind of API we need, for NRF52840. It is very nearly working except that it drops single received characters and I&amp;#39;m trying to find out why. In summary I have: 
 
 four buffers each of length 256 characters</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Apr 2020 18:19:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60808/uarte-dropping-received-characters-115-200" /><item><title>RE: UARTE dropping received characters @ 115,200</title><link>https://devzone.nordicsemi.com/thread/247640?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 18:19:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de5c1783-5aa6-4891-ab0f-26177cffa9e9</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;FYI, I &lt;em&gt;believe&lt;/em&gt; I have eliminated the single character loss by adopting a strategy that is half way between the one in my first post and that shown immediately above.&amp;nbsp; Basically, when my 130 ms timer goes off I do still stop the short and I also wait for the RXTO event but I do not do the flush: I will pick those characters up on the next DMA run in any case so the flush is not necessary.&amp;nbsp; Instead I just trigger the STARTRX task once more.&lt;/p&gt;
&lt;p&gt;I guess that either the flush process means things take too long and characters end up being dropped or my implementation was at fault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE dropping received characters @ 115,200</title><link>https://devzone.nordicsemi.com/thread/247324?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 11:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a651e33-865a-49f1-979a-703c08e6ebbd</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;I have now read that diagram several times and coded what I believe is correct but it has not helped (actually made things worse) so I would like to check my understanding of the diagram, which I have laid out below.&lt;br /&gt;&lt;br /&gt;Recall that the design is to run a short timer (130 ms) which stops the DMA and flushes things through in order to avoid the situation where there is data lying around in the RX FIFO and/or DMA buffers that has not been forwarded to the application; this needs to work both when the flow of bytes from the far end is constant and when it is intermittent, which I trust the task/event/interrupt system is sufficiently fast to support with a&amp;nbsp;UART running at 115,200; in other words reference lines 23 to 37 below must be executed sufficiently fast to avoid character loss (the far end may not implement flow control). You can also find the&amp;nbsp;full code that is intended to implement my current understanding &lt;a href="https://pastebin.com/gdBirn2N"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;QUESTION: is my interpretation of the diagram correct and should it work without character loss at 115,200 in a non-flow-controllable scenario?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Ref.  Timeline                                    UART RX bytes    DMA destination   DMA bytes
1:  we set SHORT_ENDRX_STARTRX = true
2:  we set RXD.PTR = a
3:  we set RXD.MAXCOUNT = 10
4:  we trigger TASK_STARTRX
5:                                                       1
6:  event EVENT_RXSTARTED                                2                  a             1 
7:  we set RXD.PTR = b                                   3                  a             2
8:                                                       4                  a             3
9:                                                       5                  a             4
10:                                                      6                  a             5
11:                                                      7                  a             6
12:                                                      8                  a             7
13:                                                      9                  a             8
14:                                                      10                 a             9
15:                                                      11                 a             10
16: event EVENT_ENDRX (&amp;#39;cos DMA hit 10) triggers STARTRX 12                 b             11
17: event EVENT_RXSTARTED                                13                 b             12 
18: we set RXD.PTR = c                                   14                 b             13
19:                                                      15                 b             14
20: our timer goes off                                   16                 b             15
21: we set SHORT_ENDRX_STARTRX = false                   17                 b             16
22: we trigger TASK_STOPRX                               18                 b             17
23: event EVENT_ENDRX (&amp;#39;cos DMA has stopped)             19
24:    ...                                               20
25:    ...                                               21
26: event EVENT_RXTO
27: we trigger TASK_FLUSHRX to get bytes 18 to 21                           c             18
28:                                                                         c             19
29:                                                                         c             20
30:                                                                         c             21
31: event EVENT_ENDRX (&amp;#39;cos DMA has finished flushing)
32: to continue:
33:   we set SHORT_ENDRX_STARTRX = true
34:   we set RXD.PTR = d
35:   we set RXD.MAXCOUNT = 10
36:   we trigger TASK_STARTRX
37:                                                     22
38: event EVENT_RXSTARTED                               23                 d             22
39: we set RXD.PTR = e                                  34                 d             23
etc.
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE dropping received characters @ 115,200</title><link>https://devzone.nordicsemi.com/thread/247265?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 09:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c2cc843-5f36-48e0-8bc7-5abe6a7987cf</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;Actually, hold the bus, I&amp;#39;ve just read Figure 4 of the NRF52840 product specification UARTE Reception section in more detail, will post again when I&amp;#39;ve had another try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>