<?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>NRF52 Restarts from Main() Instantly on Connect when using CCC Characteristic Notification (Intermittent)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38742/nrf52-restarts-from-main-instantly-on-connect-when-using-ccc-characteristic-notification-intermittent</link><description>Hi 
 I have followed this example: https://github.com/bjornspockeli/custom_ble_service_example through to the end, but am now having issues with some intermittent behaviour. Sometimes when I try and connect to the device using nRF Connect (Android), it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Sep 2018 14:21:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38742/nrf52-restarts-from-main-instantly-on-connect-when-using-ccc-characteristic-notification-intermittent" /><item><title>RE: NRF52 Restarts from Main() Instantly on Connect when using CCC Characteristic Notification (Intermittent)</title><link>https://devzone.nordicsemi.com/thread/150089?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 14:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c88e2b-dcff-418d-a49f-88ae273b25ef</guid><dc:creator>veletron</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thanks for that. I think some it it was down to the way I had ordered the calls vs yourself, but my main issue was my removal of the code for case:&amp;nbsp;&lt;span&gt;BLE_CUS_EVT_NOTIFICATION_ENABLED without removing the APP_ERROR_CHECK!!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;No default value was set for the variable err_code , it usually ended up with a zero and hence it worked (NRF_SUCCESS = 0), but if it had another value from a previous use of the memory then it failed - hence my random connect fail issue. So like I said - my code did not change, but due to my&amp;nbsp;failing to specify an initial value for err_code, the underlying value for that variable did change.&lt;/p&gt;
&lt;p&gt;I shall get into the habit of initialising err_code with NRF_SUCCESS like the code in bsp.c / etc does.&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;
&lt;p&gt;Nigel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 Restarts from Main() Instantly on Connect when using CCC Characteristic Notification (Intermittent)</title><link>https://devzone.nordicsemi.com/thread/150040?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 12:03:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93a306f7-a833-4508-bba2-63d88b949cdf</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what could be wrong, as I don&amp;#39;t have access to your code. I&amp;#39;ve therefore attached my project when I did this example.&lt;/p&gt;
&lt;p&gt;Perhaps you could compare what I&amp;#39;ve done to what you have done?&lt;/p&gt;
&lt;p&gt;Download here: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c269bc04b0e94acc83b72ce9d09e1fd4/custom_5F00_ble_5F00_service.zip"&gt;devzone.nordicsemi.com/.../custom_5F00_ble_5F00_service.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 Restarts from Main() Instantly on Connect when using CCC Characteristic Notification (Intermittent)</title><link>https://devzone.nordicsemi.com/thread/149682?ContentTypeID=1</link><pubDate>Thu, 20 Sep 2018 15:51:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f16c347-313f-4f2d-9aa9-9d183fbb1b5c</guid><dc:creator>veletron</dc:creator><description>&lt;p&gt;This appears to be related to the commented out code from the example which goes off on the connect event.&lt;/p&gt;
&lt;p&gt;&lt;span class="pl-c1"&gt;&lt;/span&gt;&lt;span class="pl-k"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_connect(ble_cus_t * p_cus, ble_evt_t const * p_ble_evt)

{

    p_cus-&amp;gt;conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;

    /*ble_cus_evt_t evt;

    evt.evt_type = BLE_CUS_EVT_CONNECTED;

    p_cus-&amp;gt;evt_handler(p_cus, &amp;amp;evt);*/

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;God knows why it sometimes works and sometimes doesn&amp;#39;t, but removing it fixes the example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>