<?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>Can&amp;#39;t start advertising in timer callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16240/can-t-start-advertising-in-timer-callback</link><description>I want to make my nRF52 turn on every 5 minutes, send data to a device over BLE and go back to sleep. For some reason once I turn on BLE advertising LED1 becomes solid and i can&amp;#39;t connect to my device even though nothing is paired with it. Here is my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Sep 2016 08:34:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16240/can-t-start-advertising-in-timer-callback" /><item><title>RE: Can't start advertising in timer callback</title><link>https://devzone.nordicsemi.com/thread/62052?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2016 08:34:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e7d8cba-daba-47e7-90ab-735a059d68b1</guid><dc:creator>Vaibhav Aggarwal</dc:creator><description>&lt;p&gt;Awesome thanks! Is the only way to react to the connection event through &lt;code&gt;on_ble_evt&lt;/code&gt;? I&amp;#39;d like my code for this action to all be in one place if possible. If not, I could just call a function from &lt;code&gt;on_ble_evt&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't start advertising in timer callback</title><link>https://devzone.nordicsemi.com/thread/62051?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2016 08:02:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5978f5cc-2a73-4d42-b3ca-d347d73e45e6</guid><dc:creator>Thomas R.</dc:creator><description>&lt;p&gt;The problem is the while loop inside the interrupt handler, thereby you are blocking all interrupts at this and lower levels. Therefore you are never getting any ble event (these are usually delivered at APP_IRQ_PRIORITY_LOW level) and so the advertising module can not work properly. Usually the m_conn_handle variable is also changed in an event handler, but due to the fact, that you&amp;#39;re blocking these event handlers, this variable will never change.&lt;/p&gt;
&lt;p&gt;To solve this, you should get rid of the while loop, so just start advertising in the rtc handler, and do the the rest when you get the connection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't start advertising in timer callback</title><link>https://devzone.nordicsemi.com/thread/62050?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2016 20:23:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:086c7b0f-2874-430d-8cc2-afe607133c5a</guid><dc:creator>Vaibhav Aggarwal</dc:creator><description>&lt;p&gt;@Aryan Please look at my edit. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't start advertising in timer callback</title><link>https://devzone.nordicsemi.com/thread/62049?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2016 07:08:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f517dfa7-719d-4ebc-83af-02e075ea96fa</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;what is the priority for the RTC IRQ handler? Are you using app_timer library? It is perfectly OK to start advertising from RTC callbacks ONLY if you use APP_IRQ_PRIORITY_LOW     = 6 or  APP_IRQ_PRIORITY_LOWEST  = 7, This is because you need to be in lower priority (higher number) than SVC priority (currently set to 4 in nRF52). Else you will get a hardfault. Other than that i do not see anything wrong with this function atleast.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>