<?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>UART RX double buffering</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102951/uart-rx-double-buffering</link><description>Hi Nordic experts, 
 I&amp;#39;m working for Particle Inc. We are using nRF52840 on our dev boards (Argon / Boron / etc.). We are experiencing a UART RX data lost issue using a single buffer for receiving. We designed our own UART driver that is independent from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Aug 2023 13:29:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102951/uart-rx-double-buffering" /><item><title>RE: UART RX double buffering</title><link>https://devzone.nordicsemi.com/thread/442320?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 13:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8062b78-9c09-4175-a24e-0c930cd5bd1c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Okay, so even double buffering won&amp;#39;t&amp;nbsp;&lt;strong&gt;guarantee&lt;/strong&gt; that you won&amp;#39;t lose data when using the UART peripheral, to be certain you&amp;#39;re not missing anything you&amp;#39;d need to enable flow control, which is an application choice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART RX double buffering</title><link>https://devzone.nordicsemi.com/thread/442016?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 07:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6e81ade-b2c3-4a4a-8eb5-2f956c0cc0ef</guid><dc:creator>guohui</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What I meant is by default the&amp;nbsp;&lt;span&gt;NRF_UARTE_SHORT_ENDRX_STARTRX is not enabled, so&lt;/span&gt; the receiver is automatically stopped by hardware when the&amp;nbsp;&lt;span&gt;NRF_UARTE_EVENT_ENDRX is asserted, right? If so, we have to re-start the receiver manually by software&amp;nbsp;when&amp;nbsp;servicing the UART ISR to handle&amp;nbsp;the&amp;nbsp;NRF_UARTE_EVENT_ENDRX event. If the UART ISR is interrupted/suspended by whatever ISR that has higher priority, then the receiver is not enabled during this period, so that we might loss data if the peer UART device is keeping sending data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Guohui&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART RX double buffering</title><link>https://devzone.nordicsemi.com/thread/442009?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 07:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1469bbd-489c-41bb-b394-ad2d4eb1996c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I understand your first sentence, but yes, processes with higher priority can postpone UARTE peripheral handling, and the SoftDevice will always take precedence over other peripherals. If so I think you need to add a STOP event when the UARTE is interrupted for example to make sure the transmitting device stops transmitting when you&amp;#39;re interrupted on the receiver for example.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART RX double buffering</title><link>https://devzone.nordicsemi.com/thread/441888?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 10:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b8d709d-594f-4735-85f9-764a9f024217</guid><dc:creator>guohui</dc:creator><description>&lt;p&gt;The data loss can happen if&amp;nbsp;&lt;span&gt;NRF_UARTE_SHORT_ENDRX_STARTRX is not enabled and&lt;/span&gt;&amp;nbsp;the&amp;nbsp;&lt;span&gt;NRF_UARTE_EVENT_ENDRX is not handled in time, i.e. the receiver is not re-started in time while the peer device is&amp;nbsp;sending data, right?&amp;nbsp;Or other ISRs with higher priority may also postpone the handling of the&amp;nbsp;NRF_UARTE_EVENT_ENDRX event, such as SoftDevice interrupts? In our case, the buffer doesn&amp;#39;t overflow, but we did lost data in the middle of a transaction.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Guohui&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART RX double buffering</title><link>https://devzone.nordicsemi.com/thread/441887?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 08:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b0e9fdf-c41c-488c-96a7-ac0ecc291657</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, but we can&amp;#39;t do reviews of custom drivers as we won&amp;#39;t be liable for any drivers developed outside of our R&amp;amp;D team and review process I&amp;#39;m afraid. Additionally we&amp;#39;re not too many used to working with C++, so you might not get the most thorough review of a C++ driver.&lt;/p&gt;
&lt;p&gt;Regarding the UART RX buffering, we do not use double buffering in our driver, but you&amp;#39;re welcome to implement it on your end to improve data loss, although it should not be necessary. The most common cause for data loss in the buffers is the buffers not being large enough or the UART transmitting more data than the receiver is able to process, thus eventually overflowing buffers eventually no matter the size if you don&amp;#39;t give it time to do only processing now and then.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>