<?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>cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10345/cause-uart-to-crash-by-transmit-data-continuously</link><description>Our project use 51822 and another MCU stm32 to transmit heart rate data by uart. then 51822 SPP heart rate to smart phone APP. Now, We meet a issue that 51822 UART will crash if coninuously transmit data over several minutes (i.e over 5 minutes) between</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Nov 2016 12:04:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10345/cause-uart-to-crash-by-transmit-data-continuously" /><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38401?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2016 12:04:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:499b1431-c726-4ebd-952b-f8f8c047f9d2</guid><dc:creator>baptiste</dc:creator><description>&lt;p&gt;Hi Leif,
I suppose to have the same problem with my uart on NRF51822 after a time (between 30 and 1H30), the nrf51 stop to receive frame on rx (without any error reported by the driver), the frame is sent every 5 minutes. The only way is to reset the chip by the STM32. I would like to know how you resolve your issue ?, because at current time, i&amp;#39;ve no idea what is the problem, thank you for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38400?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 09:03:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92e954e3-4b5e-4441-9c3e-951b7849e742</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Leif,&lt;/p&gt;
&lt;p&gt;please let us know what and how you fixed it. This thread will be complete when others are able to read what the actual problem was and the solution for it. Thanks for your patience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38399?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 02:28:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cb8d05c-9bac-4b6f-88dd-3e0b51e2e82a</guid><dc:creator>leif</dc:creator><description>&lt;p&gt;Anyway, still thank you for your reply. The issue have be fixed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38398?ContentTypeID=1</link><pubDate>Sat, 21 Nov 2015 08:32:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5de5bb1a-36ae-4b45-be48-6eaf38aaa9f1</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;The UART doesn&amp;#39;t crash, it&amp;#39;s a piece of hardware. And your last sentence doesn&amp;#39;t really make any sense, you can&amp;#39;t over-interrupt. The UART demonstrably works for a long time at high baud rates, the Nordic BLE sniffer for instance pumps data out at that kind of baud rate and runs for hours or days at a time.&lt;/p&gt;
&lt;p&gt;So you have a software issue and you need to go looking for it. Is APP_ERROR_HANDLER being called? I can&amp;#39;t tell from what you wrote whether it is or whether it isn&amp;#39;t. If it is, what&amp;#39;s the error code, that will tall you what the error is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38397?ContentTypeID=1</link><pubDate>Sat, 21 Nov 2015 08:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bc2cc8f-7511-471e-b15a-51e4c2ef9144</guid><dc:creator>leif</dc:creator><description>&lt;p&gt;Thanks for your reply. we use SDK8.1.0 ble_app_uart to develop our application. According to RK&amp;#39;advice. we add hardware flow control with baud rate 57600. but UART still crash.when it happened. we can&amp;#39;t find no error in ERRORSRC register and if happen error  uart_event_handle function will call  APP_ERROR_HANDLER function to reset it and it will disconnect .but in fact  it not reset and still connect APP all the time. if we change baud rate 9600 from 57600. it is ok  by  transmiting 20Min data more. but we can&amp;#39;t accept it that  will take  long time to SPP data to APP. i suspect  that UART interrupt over often cause the problem when using high baud rate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38396?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 06:17:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f815aee-0d55-48d8-9ad7-b1bc602948c9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Not sure if my reply would fit as an answer so i am putting it as a comment.
I am assuming that you are using SDK9.0 ble_app_uart as an template. In that example main.c &lt;code&gt;uart_event_handle&lt;/code&gt; function is called whenever serial data is received. This function will send a notification by calling &lt;code&gt;ble_nus_string_send&lt;/code&gt;. If your UART is receiving data too fast then it is possible that TX buffers are full and your app should handle the error BLE_ERROR_NO_TX_BUFFERS returned by sd_ble_gatts_hvx (ble_nus_string_send).&lt;/p&gt;
&lt;p&gt;I also agree with RK, that even without flow control, UART hardware should keep on working, ERRORSRC will be set accordingly and internal buffers will be overwritten, but hardware should not crash as it is tested to be still in valid working state.&lt;/p&gt;
&lt;p&gt;app_uart.c library handles all errors by just clearing ERRORSRC register in hardware and calling the registered uart event handler with error code &lt;code&gt;APP_UART_COMMUNICATION_ERROR&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38395?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 06:09:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:344f726f-38e9-4b50-a1db-ffeff35ea5ff</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;so have you looked to see if there is an error on the UART when your timeout times out? If so, what is it, have you overrun? Does that code clear any outstanding error, like overrun? Why are you delaying 1/2 a second at the end of the reset as well? Depending on what other things you&amp;#39;re doing you may just instantly overrun the buffer again.&lt;/p&gt;
&lt;p&gt;you need to understand what error is on the uart peripheral, whether you&amp;#39;re clearing it and you need to look at the uart code to see what it does on overrun to understand why you stop getting data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38394?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 05:08:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:087bfca1-20c2-4655-a96f-ee23d6b98333</guid><dc:creator>leif</dc:creator><description>&lt;p&gt;Thanks for your reply. we set 1S timeout  to re-initialize  UART. if receiving STM32 UART data it will reset 1S timeout. if not receiving  STM32 UART data after 1S time out  we will  re-initialize UART every 1S. the code as below:   function check_reset_uart_time is called in main loop.&lt;/p&gt;
&lt;p&gt;void check_reset_uart_time(void)
{
uint32_t                     err_code;
if((reset_uart_data.reset_uart_state == RESET_RUN)
&amp;amp;&amp;amp;(reset_uart_data.reset_uart_timeout == 0)
)
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	reset_uart_data.reset_uart_state = RESET_RUN;
	reset_uart_data.reset_uart_timeout = RESET_UART_TIME_NUM;
    const app_uart_comm_params_t comm_params =
    {
        RX_PIN_NUMBER,
        TX_PIN_NUMBER,
        RTS_PIN_NUMBER,
        CTS_PIN_NUMBER,
        APP_UART_FLOW_CONTROL_DISABLED, //APP_UART_FLOW_CONTROL_ENABLED
        false,
        UART_BAUDRATE_BAUDRATE_Baud57600
    };
	  buffers.rx_buf      = rx_buf;                                                              
      buffers.rx_buf_size = sizeof (rx_buf);                                                    
      buffers.tx_buf      = tx_buf;                                                              
      buffers.tx_buf_size = sizeof (tx_buf);                                                    
      err_code = app_uart_init(&amp;amp;comm_params, &amp;amp;buffers, uart_event_handle, APP_IRQ_PRIORITY_LOW, &amp;amp;APP_UART_UID);   
	  
     APP_ERROR_CHECK(err_code);
     
     Send_Data_Status.Flag.F_SendUploadNextPkt = true;
 nrf_delay_ms(500);

}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}
variable APP_UART_UID is the value which first initial UART set .  pls check if there was an outstanding error. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cause UART to crash by transmit data continuously</title><link>https://devzone.nordicsemi.com/thread/38393?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 01:53:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb9e6a3-8a48-459a-9b4d-96d78b1fdbc6</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You&amp;#39;re probably overrunning the UART since you don&amp;#39;t have flow control on and are using a high bitrate, eventually the softdevice interrupts for long enough the buffer fills, an error is flagged and depending on what the code does when there&amp;#39;s an error (look at the code and see) the UART may appear to stop working. Have you checked the ERRORSRC register in the UART when you have this issue to see if any bits are set?&lt;/p&gt;
&lt;p&gt;I doubt the UART has &amp;#39;crashed&amp;#39;, I&amp;#39;m sure it&amp;#39;s still working away, but it&amp;#39;s in an error condition the code you&amp;#39;re using to drive it is not recovering from.&lt;/p&gt;
&lt;p&gt;If you completely re-initialize the UART it should start receiving again, so it rather depends what you mean by &amp;#39;even though we re-initialize .. &amp;#39; and what the code you&amp;#39;re using does on init if there was an outstanding error.&lt;/p&gt;
&lt;p&gt;High baudrates + no flow control + softdevice isn&amp;#39;t a recipe for success. STM32 MCUs support flow control, why don&amp;#39;t you use it and make all your problems go away.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>