<?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>Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48459/dubble-buffered-uarte-reception</link><description>Hi NordicSemi 
 I have a project where we receive data via the UARTE. To avoid missing data caused by higher prioritized tasks we want to use the DMA facilities. 
 nrf52832 with softdevice and SDK version 15.2 
 But as we do not know how many bytes we</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Oct 2019 18:04:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48459/dubble-buffered-uarte-reception" /><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/216014?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 18:04:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74f9c090-8177-402c-ba6c-3820d3b562e1</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;Hi Kasper&lt;/p&gt;
&lt;p&gt;Seems I need something very similar to you, Have been struggeling with all the different UART(E) layers for a long time now.&lt;/p&gt;
&lt;p&gt;Did you ever find a solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/194595?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 10:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29f4e044-beed-4b82-b01b-d4657e833aa6</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Just like described by J&amp;oslash;rgen. I will give it a try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/194594?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 10:20:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28d144fd-fc34-4de0-a225-de18ac454a16</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Exactly. I will give it a try. I got an unused HW-timer for the purpose. :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/194560?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 09:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae5f56c-1e08-41a0-b4ce-c60fcaa333d8</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;to configure double buffering, set ENDRX-STARTRX shortcut and update RXD.PTR to next free buffer on RXSTARTED interrupt (I&amp;#39;m not sure that it can be done with nrf libraries, rather with direct programming of UARTE registers). You should not stop UARTE to manually switch buffers, as you will lose data sometimes. The main problem that you don&amp;#39;t know how many bytes actually received. This can be solved by connecting a timer in counter mode to RXDRDY event through PPI - a counter will increment at each received byte.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/194495?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 06:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b78298f-0f6d-4841-b63a-824bba9f2f23</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You will get an &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uarte.html?cp=3_1_0_34_9#topic"&gt;RXDRDY&lt;/a&gt;&lt;span&gt;&amp;nbsp;event when data is received in RXD, but note that the data might not have been transferred to RAM at this point. If you set up and start a timer whenever you start RX for UART, you can use PPI to clear the timer by triggering the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/timer.html?cp=3_1_0_23_4#topic"&gt;CLEAR task&lt;/a&gt;. Whenever the timer matches the compare register, you have a pause in your transfer.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/194493?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 05:56:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33823503-3a12-4ba2-a13d-f8b7509f2df9</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;If it was possible to trigger/retrigger a hw-timer each time a byte is recieved, then I have a signal indicating a pause in the reception. If there is a pause it will be for a significant periode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/194442?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2019 15:38:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8ae6601-32e6-4893-9644-f9bbd4eac268</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You could write your own driver and use PPI to connect the TO event to the STARTRX task, but this could cause issues and data loss if bytes are received during the timeout period. You will then lose the &amp;quot;up to 4 bytes&amp;quot; that can fit in the HW FIFO if the previous buffer is filled by the first byte, and you do not update the buffer pointer and trigger FLUSHRX&amp;nbsp;before STARTRX.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/193574?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 08:08:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95d2b5c0-71e9-4476-ac7d-265f50f7e7f1</guid><dc:creator>Kasper Leonhardt</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The 4 byte HW receive buffer is not much as the soft device has higher priority, and can take the resources in longer time that 4 bytes received on a UART at 921600 baud. I have analysed the behavior when I try to restart the reception after using the RX-abort, when simultaneously receiving data.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;I do not think the double buffering feature is created with variable length transfers in mind.&amp;quot;: You are probably right. But I can not be the first one needing this. And I believe that the HW supports it. But the SDK avoids using it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But it seems to be a problem I must handle elsewhere. :-(&lt;/p&gt;
&lt;p&gt;Kasper&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dubble buffered UARTE reception</title><link>https://devzone.nordicsemi.com/thread/193470?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2019 14:29:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87d05769-f4af-4e6f-ab81-dfeabcfb61c3</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure exactly how this should work. The rx_abort function triggers the STOPRX task in the peripheral. The UARTE has a HW FIFO that &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuarte.html&amp;amp;anchor=concept_uzb_p2m_wr__fig.stoprx"&gt;can receive up to 4 bytes before the TO event&lt;/a&gt;. The RX FIFO must be flushed after the timeout, in order to not lose data. There is no shortcut between the timeout event and STARTRX, so you will anyway have to start the RX through using CPU after this event is received.&lt;/p&gt;
&lt;p&gt;I do not think the double buffering feature is created with variable length transfers in mind.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>