<?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 Framing error / communication error on nrf52820</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79813/uart-framing-error-communication-error-on-nrf52820</link><description>HI DEV 
 Currently we found a UART Frame error on customer product: 
 Application scenario diagram 
 
 Figure1 
 nrf52820 ,SDK17.02, softdevice:S132 , gap event length=6*1.25ms =7.5ms 
 Issue description: 
 When user production working on above scenario</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Sep 2021 08:52:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79813/uart-framing-error-communication-error-on-nrf52820" /><item><title>RE: UART Framing error / communication error on nrf52820</title><link>https://devzone.nordicsemi.com/thread/330197?ContentTypeID=1</link><pubDate>Mon, 20 Sep 2021 08:52:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da24b633-0fd7-4933-a55e-0e926e2e7f9b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I recommend you use the &lt;span class="item"&gt;&lt;a title="Libuarte - advanced UARTE driver" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_libuarte.html?cp=8_1_3_28"&gt;Libuarte - advanced UARTE driver&lt;/a&gt;&lt;/span&gt; instead of the app uart library. The app uart library doesn&amp;#39;t support large DMA buffers (only supports 1 byte) and it can be difficult to prevent data loss unless you include HW flow control.&lt;/p&gt;
[quote userid="94184" url="~/f/nordic-q-a/79813/uart-framing-error-communication-error-on-nrf52820/330193#330193"]for example, after we &amp;quot;turn off&amp;quot; APP_UART_COMMUNICATION_ERROR handler, if the uarte received a corrupted packet, the uarte still can go to &amp;quot;NRF_DRV_UART_EVT_RX_DONE&amp;quot; then put the receive data into fifo.[/quote]
&lt;p&gt;Yes, but APP_UART_COMMUNICATION_ERROR means you have lost a packet due to an UARTE error condition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Framing error / communication error on nrf52820</title><link>https://devzone.nordicsemi.com/thread/330193?ContentTypeID=1</link><pubDate>Mon, 20 Sep 2021 08:47:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbfca308-15c8-43d6-955e-3166668e3756</guid><dc:creator>David Duan</dc:creator><description>&lt;p&gt;Hi Berg&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;we will try your suggestion.&lt;/p&gt;
&lt;p&gt;Just a quick question at here.&lt;/p&gt;
&lt;p&gt;do we have any setting to ignore or &amp;quot;turn off&amp;quot; the APP_UART_COMMUNICATION_ERROR handler?&lt;/p&gt;
&lt;p&gt;for example, after we &amp;quot;turn off&amp;quot; APP_UART_COMMUNICATION_ERROR handler, if the uarte received a corrupted packet, the uarte still can go to &amp;quot;NRF_DRV_UART_EVT_RX_DONE&amp;quot; then put the receive data into fifo.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Framing error / communication error on nrf52820</title><link>https://devzone.nordicsemi.com/thread/330179?ContentTypeID=1</link><pubDate>Mon, 20 Sep 2021 07:26:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b56d917-d141-45c1-97ed-a5e7d95d6ef1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]We have change the UARTE to libuarte, but this issue still happen.[/quote]
&lt;p&gt;&amp;nbsp;The code snippets you posted shows that you&amp;#39;re calling the UARTE driver APIs directly, not libuarte. Is that the old code?&lt;/p&gt;
[quote user=""]The project only have BLE, RTC and UARTE, we set the uarte interrupt as the highest priority but the issue still happen.[/quote]
&lt;p&gt;&amp;nbsp;I would rather recommend that you increase the DMA buffers to offload the CPU more.&lt;/p&gt;
[quote user=""]1. since uarte and BLE both will use the hfclk, and the this issue only happen will 5 BLE connection(see figure 1).do we have some specical ceritaria for using function &amp;quot;&lt;strong&gt;sd_clock_hfclk_request()&amp;quot;&lt;/strong&gt;&amp;nbsp;?[/quote]
&lt;p&gt;&amp;nbsp;Calling sd_clock_hflck_request() after ble_stack_init() is sufficient. This will make the SD keep the HFXO always on.&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;1. uart event error handler&amp;nbsp;&lt;/p&gt;
&lt;p&gt;we try to add the bleow code in UART error handler , but the issue still happen.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;we want to know,&amp;nbsp; when the error handler capture the &lt;strong&gt;APP_UART_COMMUNICATION_ERROR&lt;/strong&gt;, does it means uarte RX data is incorrect?&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes, APP_UART_COMMUNICATION_ERROR effectively means you recived a corrupted packet and that it is dropped/lost.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>