<?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>Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36806/reliable-uarte-reception-with-active-softdevice</link><description>Hi 
 I&amp;#39;ve done a few attempts in the last years to implement a reliable reception by using the UARTE. In the past we used the UART periphery from the nRF51, but we thought it should be the right way to use the new UARTE that comes with the nRF52. There</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Aug 2018 11:03:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36806/reliable-uarte-reception-with-active-softdevice" /><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/142991?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 11:03:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15f589ca-f547-4f7b-a28b-a236f8c1bf1b</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I can confirm that the usage of the libuarte/libuarte_async solves the problem if they are used with a correct chunk size. In my example I used 1 which surely doesn&amp;#39;t work. I&amp;#39;ve increased the number to 32 and it now works.&lt;/p&gt;
&lt;p&gt;The solution with with libuarte/libuarte_async&amp;nbsp; works, but somehow it gives me a bad feeling if I need two timers and 10 PPI channels to implement a UART communication...&lt;/p&gt;
&lt;p&gt;I think we can close the issue here. Thanks for your help!&lt;/p&gt;
&lt;p&gt;Regards Adrian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/142557?ContentTypeID=1</link><pubDate>Thu, 02 Aug 2018 09:14:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a227a9fb-237a-4c41-b752-94e595a557ad</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi Adrian,&lt;/p&gt;
&lt;p&gt;I turned of HW flow control (assuming you won&amp;#39;t be using this) and tested your application. As far as I can see you have set up the maxcnt to 1 which means the cpu will have to interact with the uarte on every byte, this will not be possible while running Bluetooth so you will lose bytes (looks like I am loosing 3-4 bytes). The Legacy uart has buffer space for 6 bytes.&lt;/p&gt;
&lt;p&gt;The async uart driver was designed with the assumption that you cannot use HW flow control, and that the other end would be aware of the limitations of the async driver. I have only tested the driver with 255 byte (max size) buffers and sending chunks of data. And with this configuration I have been able to send data for hours without loss, BLE-&amp;gt;UARTE and UARTE-&amp;gt;BLE. (If I remember correctly) The driver is designed so it will change over to the secondary (free) buffer, either on max_cnt or when the timer expires (in case of shorter transmits). The recommended operation is to copy the received data to a secondary buffer, e.g a ringbuffer in the uarte handler, and handle the data in main context later. Also possible to handle in uart handler, but be aware that if you get a max_cnt packet followed by a short packet you should be finished processing before the timeout of the short packet (and BLE events will interrupt this...).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/141659?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 10:41:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06da3257-b8bf-43c8-b051-39515158e430</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thanks for the update. I&amp;#39;m looking forward to your findings concerning this behavior.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/141655?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 10:26:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7b54efc-6089-446c-88aa-d68d1e6d95b9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Adrian,&lt;/p&gt;
&lt;p&gt;You are right, the UARTE driver is not capable of&amp;nbsp;continuous asynchronous reception. The&amp;nbsp;nrf_libuarte_async is intended to work around that (using a lot of PPI). I do not have any more info yet, but I will look into this and discuss with the developer next week and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/141532?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 12:58:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac1fa6a5-db13-4ee8-a3ac-b4ef5a8ce9a2</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;I would prefere to use the UART driver for the UARTE, but is this driver capable of continuous asynchronous reception?&lt;/p&gt;
&lt;p&gt;Regards Adrian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/141509?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 12:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0ac5e1b-5300-48a6-ad57-27d269cf3534</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Adrian,&lt;/p&gt;
&lt;p&gt;I see. I have tested your code and can reproduce it on my side. Unfortunately, I have not been able to go in depth yet, so I do not have any explanation or suggestion for a fix at this point.&lt;/p&gt;
&lt;p&gt;By the way, why are you using the experimental nrf_libuarte_async instead of the UART driver (which also support UARTE)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/141306?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 10:43:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56719881-92c7-4496-a122-47f334be874c</guid><dc:creator>Adrian Eggenberger</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;I agree that for reliable communication the flow control must be used. Maybe &amp;quot;reliable&amp;quot; wasn&amp;#39;t the correct word in my description.&lt;/p&gt;
&lt;p&gt;My point is that the UARTE implementation looses bytes where the (much easier) legacy UART implementations doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;This is problem is independent from the flow control, but to be sure I&amp;#39;ve modified the example the following way:&lt;br /&gt;1) I&amp;#39;ve enabled the flow control in the test firmware and C# test application.&lt;br /&gt;2) I&amp;#39;ve added a new project configuration that allows to switch between an implementation for legacy UART (works) and a UARTE implementation based on the libuarte modules that looses octets.&lt;/p&gt;
&lt;p&gt;Regards Adrian&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/uarte_5F00_test_5F00_v2.zip"&gt;devzone.nordicsemi.com/.../uarte_5F00_test_5F00_v2.zip&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/SerialTest_5F00_v2.zip"&gt;devzone.nordicsemi.com/.../SerialTest_5F00_v2.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reliable UARTE reception with active softdevice</title><link>https://devzone.nordicsemi.com/thread/141284?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 09:10:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6234c948-ed70-425e-9e34-39851f83a8d4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Adrian,&lt;/p&gt;
&lt;p&gt;I see from your code that you are not using flow control (&lt;code&gt;NRF_UARTE_HWFC_DISABLED&lt;/code&gt;). You should always use flow control if you need reliable UART and you are doing something else with higher priority (such as BLE).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>