<?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 connection issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8078/ble-connection-issue</link><description>HI,all! 
 Recently my nrf51822 device encountered a tough issue,the detials are: 
 My device connected to an android app, which has some bugs about ble connection so the connection is not stable and secure. And because of that, my device&amp;#39;s code run</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Jul 2015 07:28:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8078/ble-connection-issue" /><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28984?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 07:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f28fd599-9939-41d5-bfa2-6f1c09b39907</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;press the break button on the debugger and post where in your code you are.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28983?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 07:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5765e4eb-8d38-4d49-b6fc-6d8528313083</guid><dc:creator>kk</dc:creator><description>&lt;p&gt;actually i am not sure if my code loops or not, i just said my code runing out of control( can not go back to main funtion), so I ask &amp;quot;Will some inlegal behaviours about ble connection cause the code be stuck in someplace&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28982?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 07:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab504c99-6d1e-4708-9c6a-2261fed3159b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;OK, if you know that you are not looping here, can you please tell us where you are looping?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28981?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 07:10:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b89ddf6-ca47-42b3-ae38-5855ce37625f</guid><dc:creator>kk</dc:creator><description>&lt;p&gt;I check my code, it is the &amp;quot;ble_debug_assert_handler&amp;quot; will enter the loop, and my code uncomment it, so I guess it is not the reason&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;{
nrf_gpio_pin_set(ASSERT_LED_PIN_NO);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// ble_debug_assert_handler(error_code, line_num, p_file_name);

// On assert, the system can only recover with a reset.
NVIC_SystemReset();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28989?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 06:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a94c66ac-52bf-476e-9870-66c7e13d543f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks RK for pitching in :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28988?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 06:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ad4c906-e92d-40b1-a32f-6d0d0413c802</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;The flag is &amp;#39;DEBUG&amp;#39;, ie if you compile with DEBUG set, as with any debug build, then the behaviour on the default handler is to turn all the LEDs on and loop. In anything where DEBUG is not defined, ie release mode, you get a system reset.&lt;/p&gt;
&lt;p&gt;And as I say often - everyone should put a breakpoint in the app_error_handler() routine as a matter of course.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28987?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 05:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08a36283-458a-4f04-a119-689cdb9350ce</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The default behaviour is system reset, but there is flag (i cannot remember it from top of my head, i will check when i go to office)i have seen debug_assert_handlers looping. If you did not enable any debug flags then this is not a reason for you.
Can you give me your code for me to try it out? if not please give more information about the loop function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28986?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 05:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0ea7314-36b5-4b1d-a6a9-fee8d885f4a2</guid><dc:creator>kk</dc:creator><description>&lt;p&gt;thanks for your fast reply, but APP_ERROR_CHECK will cause a system reset instead of stucking in someplace, is that right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble connection issue</title><link>https://devzone.nordicsemi.com/thread/28985?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 05:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e864a024-5993-4b6d-8fa6-609f2adcfc1c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Seems like your code is stuck in some APP_ERROR_CHECK condition failure .. when you are in the loop function you mentioned, check the call stack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>