<?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>BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41812/ble-disconnects-after-sending-a-packet</link><description>HI, 
 i am using nrf51422 with sdk13.3.0 and soft device 130 
 i am receiving 69 byte of data through UART, i am compressing data in two packets. here after transmitting a packet BLE is disconnected 
 i don&amp;#39;t want BLE to be disconnected after sending</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Jan 2019 11:08:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41812/ble-disconnects-after-sending-a-packet" /><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/164492?ContentTypeID=1</link><pubDate>Tue, 08 Jan 2019 11:08:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fab2e873-2a73-4dd4-be63-11e4095f370b</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;sorry for late reply&lt;/p&gt;
&lt;p&gt;my application is now working fine&lt;/p&gt;
&lt;p&gt;thank you so much for your suggestion&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;shrushrutha&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163667?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 09:08:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df572339-34f6-4758-81f5-495bd34603e3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The issue is that you spend too much time in the UART event handler, so it can&amp;#39;t finish doing what it is doing before it receives a new byte.&lt;/p&gt;
&lt;p&gt;As you can see in the original ble_app_uart example, all it does in the UART event handler is to check whether the entire sting is received (either &amp;#39;\n&amp;#39; or the length of the buffer), and pass the string to the softdevice. So what you need to do is to make sure you exit the UART handler before the next character is received.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Copy the data_array to another buffer, and set a flag that this has to be processed in the application priority (lower than the UART priority).&lt;/p&gt;
&lt;p&gt;pseudo code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void uart_event_handle(app_uart_evt_t * p_event)
{
    ...
    switch(p_event-&amp;gt;evt_type)
    {
        case APP_UART_DATA_READY:
            if(condition1 &amp;amp;&amp;amp; condition2)
            {
                m_my_uart_buffer = data_array;
                m_my_uart_flag = true;
            }
            break;
    }
    ...
}

int main(void)
{
    ...
    for (;;)
    {
        if(m_my_uart_flag)
        {
            m_my_uart_flag = false;
            process_uart_function();
        }
        power_manage();
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163427?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 12:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ff433af-0553-46e4-be14-ea62c7ebe592</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app.rar"&gt;devzone.nordicsemi.com/.../ble_5F00_app.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;if i remove APP_ERROR_HANDLER() ,&amp;nbsp;after transmitting 29 packets successfully uart stops receiving.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163406?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 11:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:168ef04b-3f9d-4226-88a0-0293f0a18174</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What happens if you remove the APP_ERROR_HANDLER() line in the event? Do you receive all the data, or is some data missing? If you are missing some data, is it possible to send the project that you use? Just zip the ble_app_uart folder containing the project that you are using.&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163378?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 09:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16af36ca-34f5-4706-8318-ef50502d27e8</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;please suggest me how to check buffer is filled, if so how can i clear it.&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163373?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 09:20:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc793a31-9f63-404e-a9d3-2d428856bc99</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;yes i am using the same baud rate&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3755.1.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0624.2.JPG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163368?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 09:11:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b400e3f4-a1f4-426b-8552-1f0389fe909d</guid><dc:creator>Edvin</dc:creator><description>[quote user="Edvin Holmseth"]Do you use the&amp;nbsp;same&amp;nbsp;baud rate on both devices? Is your buffer filled? Can you check what the value of p_event-&amp;gt;data.error_communication has (by debugging)?[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163366?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 09:06:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aafa2e1-4e3c-440e-a935-83ce2a8ba112</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;yes, i am using same baud rate on both sides and i am clearing the buffer using&amp;nbsp;app_uart_flush()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;after sending around 30 packets&amp;nbsp; i am getting overrun error. even if i use hardware flow control and reduce the baud rate same error is coming.&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;
&lt;p&gt;with regards&lt;/p&gt;
&lt;p&gt;shrushruta&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/163358?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 08:35:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db85963c-b0cf-48b4-900c-e59fd3bc4429</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello shrushrutha,&lt;/p&gt;
&lt;p&gt;I am sorry for the late reply. Most of our support engineers have been away for Christmas holidays.&lt;/p&gt;
&lt;p&gt;I see. The way to avoid the fatal errors on Communication errors is simply to comment out the APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case APP_UART_COMMUNICATION_ERROR:
            // APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But you should be aware that when you get this event, something weird has happened on your UART, and you may have lost a UART Packet.&lt;/p&gt;
&lt;p&gt;Do you use the&amp;nbsp;same&amp;nbsp;baud rate on both devices? Is your buffer filled? Can you check what the value of p_event-&amp;gt;data.error_communication has (by debugging)?&lt;/p&gt;
&lt;p&gt;The bits of this is described in the reference manual.&lt;/p&gt;
&lt;p&gt;Please find the nRF51422 reference manual from &lt;a href="https://www.nordicsemi.com/DocLib/"&gt;this site&lt;/a&gt;. On page 155, you should see table 279: ERRORSRC which is the UART error register. The value from p_event-&amp;gt;data.error_communication is reflected here. Do you get a framing error? This suggests that you are either having a mismatch in baud rates, or that you have some floating pins (the UART is not connected).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162994?ContentTypeID=1</link><pubDate>Wed, 26 Dec 2018 07:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e47a68d7-ab10-4273-be10-2263314220a3</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;Hi Edvin, i am not able to come out of&amp;nbsp;&lt;span&gt;APP_UART_COMMUNICATION_ERROR, please suggest me solution for this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2211.Capture.JPG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thank you,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;with regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;shrushrutha&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162898?ContentTypeID=1</link><pubDate>Sat, 22 Dec 2018 09:30:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c1cbd33-c31b-4f1c-a253-f83ab7bd30ea</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;thank you for your suggestion&lt;/p&gt;
&lt;p&gt;i am able to find out the error, i am getting APP_UART_COMMUNICATION_ERROR&lt;/p&gt;
&lt;p&gt;with regards,&lt;/p&gt;
&lt;p&gt;shrushrutha&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162855?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 13:53:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9f7cd96-bb93-4803-8665-cb8f223fa53c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-e5205e86bac7448287365a6940905266/pastedimage1545400428762v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162833?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 11:54:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0063ac0c-dd8d-4b68-894c-d4b7356fe701</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;i am using keil&amp;nbsp;&amp;micro;5&lt;/p&gt;
&lt;p&gt;please let me know&amp;nbsp; (d&lt;span&gt;efine DEBUG in your preprocessor defines) how to do this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;with regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;shrushruta&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162830?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 11:40:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a19169a0-d693-4c52-bffc-352a12b694e1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you paste the log output from the nRF? Again, you need to use the J-Link RTT viewer, and not the UART to view the log.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, can you try to define DEBUG in your preprocessor defines. (Let me know if you don&amp;#39;t know how to do this, and specify what IDE you are using. Is it Keil?) Also disable optimization (set it to -O0).&lt;/p&gt;
&lt;p&gt;Then set a breakpoint on line 76 in app_error.c and start debugging. See if your application stops at this breakpoint. If it does, check .line_num, .err_code and .p_file_name, and see which APP_ERROR_CHECK() that triggered.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162818?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 10:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ce47fba-d213-4546-91ca-b5b2dc86714e</guid><dc:creator>shrushruta</dc:creator><description>&lt;p&gt;i have not modified any parameters used&amp;nbsp; in ble_app_uart&amp;nbsp; example, i only processing the data received through UART&lt;/p&gt;
&lt;p&gt;i sending data from docklight,&amp;nbsp;for the first transmission i am able to receive the packet in mobile app successfully, but if i try to send more than once i am not able to receive the packet and soon after ble will disconnets&lt;/p&gt;
&lt;p&gt;i connected nRF UART app in my mobile&lt;/p&gt;
&lt;p&gt;no it is not giving any reasons for disconnection&lt;/p&gt;
&lt;p&gt;yes i am using SDK 12.3.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnects after sending a packet</title><link>https://devzone.nordicsemi.com/thread/162794?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 08:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8925d86-4508-498d-b730-2103dcded6c6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Why does the device disconnect?&lt;/p&gt;
&lt;p&gt;Does the connection time out? What are you connected to? Does it give some reason for why it disconnected?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I assume you use SDK 1&lt;strong&gt;2&lt;/strong&gt;.3.0? My initial guess is that&amp;nbsp;ble_nus_string_send returns something other than NRF_SUCCESS.&lt;/p&gt;
&lt;p&gt;Try to define DEBUG in your preprocessor defines, and watch your log (RTT log, not UART). Use J-Link RTT Viewer to monitor the RTT log.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>