<?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>NRF51822 UART hangs and requires power cycle</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28130/nrf51822-uart-hangs-and-requires-power-cycle</link><description>Hi, 
 I am making a GPS tracking system using NRF51822-QFAC. I am using 2 UARTs, one of the (external) GPRS IC and one for (external) RS485 communication. 
 The UART peripheral hangs after some time. I don&amp;#39;t know if it is UART1 or UART2. As a result</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Dec 2017 13:31:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28130/nrf51822-uart-hangs-and-requires-power-cycle" /><item><title>RE: NRF51822 UART hangs and requires power cycle</title><link>https://devzone.nordicsemi.com/thread/111040?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 13:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d763ca9-5b1d-48a7-b89b-7f74182ad318</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;You should check what kind of events you get in the error handler:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void uart_error_handle_A(app_uart_evt_t * p_event)
{
    if (p_event-&amp;gt;evt_type == APP_UART_COMMUNICATION_ERROR)
    {
        APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
    }
    else if (p_event-&amp;gt;evt_type == APP_UART_FIFO_ERROR)
    {
        APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I suspect you get APP_UART_COMMUNICATION_ERROR so you should check the value in &lt;code&gt;p_event-&amp;gt;data.error_communication&lt;/code&gt; and compare it to the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=2_1_0_49_9_3#register.ERRORSRC"&gt;ERRORSRC register&lt;/a&gt; to get a hint of what is wrong. When you are in the event handler you should also check what sensor you are communicating with at that time to figure out where the error stems from.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 UART hangs and requires power cycle</title><link>https://devzone.nordicsemi.com/thread/111039?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2017 06:44:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de26a3e3-09d3-421c-afa9-87483080bbfe</guid><dc:creator>srijan12</dc:creator><description>&lt;p&gt;It happens once in couple of days, and also not on each device. It seems to be framing issue. Also feels like overflow.&lt;/p&gt;
&lt;p&gt;As of now, the uart_error_handle_A() does nothing. What should I write into it? Probably resetting all registers, clearing all buffers and restarting UART there should work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 UART hangs and requires power cycle</title><link>https://devzone.nordicsemi.com/thread/111038?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 14:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc3cac8e-f6ef-40e1-ab88-9cd9fe6c9727</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I can&amp;#39;t see anything wrong with using the library or FIFO.&lt;/p&gt;
&lt;p&gt;Could it be that the UART experiences an error (framing or parity error for example) and ends up in an endless loop in an error handler somewhere? If this is the case it is strange that it doesn&amp;#39;t help with a pin reset though. Have you used a debugger to check where the code is at when it hangs? Are you checking for, and gracefully handling, errors in your uart_error_handle_A() handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>