<?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>General LIBUARTE Questions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41215/general-libuarte-questions</link><description>Hello, I have recently updated our CLI backend to use LIBUARTE and it seems to be much more reliable. I have a few assumptions I would like to clarify and a few questions as well. This should be helpful to others planning to switch to LIBUARTE. 
 Assumptions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 08 Dec 2018 00:41:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41215/general-libuarte-questions" /><item><title>RE: General LIBUARTE Questions</title><link>https://devzone.nordicsemi.com/thread/160821?ContentTypeID=1</link><pubDate>Sat, 08 Dec 2018 00:41:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79a3ac41-7bd4-42cf-a9c7-ca9acde0b19f</guid><dc:creator>49bwjf8</dc:creator><description>&lt;p&gt;Hi Krzysztof,&lt;/p&gt;
&lt;p&gt;Thank you for your reply, it was very informative.&amp;nbsp;After experimenting I have a&amp;nbsp;few more questions about the nrf_libuarte specifically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I am waiting for async RX data and issue a dtm_cmd&amp;nbsp;command, I stop getting RX events on the timeout but I continue to get full buffer events. Do you have an idea as to why this is happening?&lt;/li&gt;
&lt;li&gt;When does the NRF_LIBUARTE_EVT_RX_DATA event occur in nrf_libuarte (there is no timeout config option here)? Is it when the buffer is full?&lt;/li&gt;
&lt;li&gt;When does the NRF_LIBUARTE_EVT_RX_BUF_REQ event occur?&amp;nbsp;Is this when the buffer specified in nrf_libuarte_rx_start is full?&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Is nrf_libuarte_rx_buf_rsp used to allocate extra buffer space for when the buffer specified in&amp;nbsp;nrf_libuarte_rx_start is full? If so, then when you run&amp;nbsp;nrf_libuarte_rx_start again will this pull in the data from that extra buffer?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: General LIBUARTE Questions</title><link>https://devzone.nordicsemi.com/thread/160503?ContentTypeID=1</link><pubDate>Thu, 06 Dec 2018 06:25:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2e67d77-1cd7-4747-a72b-2f60f87fc1e2</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I will try to touch on some of topics:&lt;/p&gt;
[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"]LIBUARTE is&amp;nbsp;a replacement to the existing UART and UARTE drivers and interfaces, including app_uart and nrf_serial, and so it is incompatible with them[/quote]
&lt;p&gt;It is not. It is more reliable (ensuring reliable reception without flow control) but it is using more resources (PPI, 2 TIMERS) so it cannot be considered generic enough. In theory HWFC must be used for reliable transfers.&lt;/p&gt;
[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"]LIBUARTE requires NRFX_PRS_BOX_4 to be set to&amp;nbsp;disabled for the UARTE0 peripheral since it needs to use its own LIBUARTE UARTE0_UART0_IRQHandler[/quote]
&lt;p&gt;Unfortunately, yes. As it first started as kind of proof of concept it&amp;#39;s not intergrated fully with SDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"]Is there a way to use one timer for both the&amp;nbsp;nrf_libuarte and&amp;nbsp;nrf_libuarte_async implementations?[/quote]
&lt;p&gt;No, one timer is used for counting bytes, second timer is used for timeouting. There are work ongoing to allow use of RTC instance for timeouting as on option. It may get to next release.&lt;/p&gt;
[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"]When using nrf_libuarte, is there an internal buffer for receiving data or is the only buffer the one provided&amp;nbsp;by the data parameter in nrf_libuarte_rx_start? What I mean is, does&amp;nbsp;&lt;span&gt;nrf_libuarte_rx_start pull the specified (by &amp;#39;len&amp;#39;) number of bytes from an internal buffer or is &amp;#39;len&amp;#39; the maximum number of bytes to &lt;span style="font-size:12px;"&gt;receive&lt;/span&gt;&amp;nbsp;until the buffer overflows?&lt;/span&gt;[/quote]
&lt;p&gt;nrf_libuarte only uses external memory provided (for example buffers from nrf_libuarte_async).&lt;/p&gt;
[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"]What happens when the buffer overflows?[/quote]
&lt;p&gt;If new buffer is not set in easydma on time then it will start overwriting current buffer. However, because there is double buffering, time to respond to buffer request equals time to fill single buffer (e.g. 255 bytes buffer @1Mbaud = ~255*10us).&amp;nbsp;&lt;/p&gt;
[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"]In the async implementation, how often is the NRF_LIBUARTE_ASYNC_EVT_RX_DATA event triggered? At what point would a stream of incoming data be split into multiple events?[/quote]
&lt;p&gt;Event comes on timeout (which may be interpreted as packet boundary) and on buffer getting full (e.g. every 255 bytes).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote userid="75481" url="~/f/nordic-q-a/41215/general-libuarte-questions"][/quote]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is there any issue in modifying the current DTM example implementation to use LIBUARTE instead of app_uart?&lt;/li&gt;
&lt;li&gt;Do I need to make a new implementation of retarget.c to work with LIBUARTE instead of app_uart?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any issues with using libuarte for those purposes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>