<?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>nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11124/nrf51822-and-s110-why-does-device-wake-from-sleep-and-call-main</link><description>I am working with the nRF51822 chip and the S110 softdevice on a device that uses an accelerometer to wake up. Battery life is a concern, so we have developed the device so that it advertises with a timeout of 10 seconds when the device is shaken (triggering</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Jan 2016 05:33:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11124/nrf51822-and-s110-why-does-device-wake-from-sleep-and-call-main" /><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41674?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 05:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4e82b00-8832-4bb2-96ad-03ad23b73e89</guid><dc:creator>Sam Lauffenburger</dc:creator><description>&lt;p&gt;I discovered the issue. My device is asleep most of the time and wakes up for events. The adv timeout event was waking up the chip and we were restarting advertising manually in our application code. Thank you very much for your help and time - I apologize that it ended up being an oversight on my part.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41675?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 04:12:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d542c4c5-492c-47d1-9005-31280df5f548</guid><dc:creator>monpetit</dc:creator><description>&lt;p&gt;That&amp;#39;s strange, my example has stopped advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41673?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 03:07:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b436e893-a8da-4a85-83dd-dee6b4c3afd7</guid><dc:creator>Sam Lauffenburger</dc:creator><description>&lt;p&gt;No - advertising continues if I comment out that line in &lt;code&gt;sleep_mode_enter()&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41682?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 07:49:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aac3624-c64d-4065-b4f2-816404e6dd1e</guid><dc:creator>monpetit</dc:creator><description>&lt;p&gt;I&amp;#39;m not aware of your purpose, but isn&amp;#39;t it sufficient to comment out &lt;code&gt;sd_power_system_off()&lt;/code&gt; in your code? Is the advertising still on going after timeout?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41681?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 04:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f283dd7a-1ca3-405f-b980-5187a527c403</guid><dc:creator>Sam Lauffenburger</dc:creator><description>&lt;p&gt;monpetit - yes! good catch. I inherited this code from another developer, so forgive my oversight.&lt;/p&gt;
&lt;p&gt;I believe that the behavior I was seeing is because in ble_advertising.c, we were calling sd_power_system_off() when we set the BLE_ADV_EVT_IDLE advertising mode.&lt;/p&gt;
&lt;p&gt;So this raises another question - what is the correct method of halting advertising without calling sd_power_system_off()? I have tried calling sd_ble_gap_adv_stop(), but it returns with an error code of 0x08.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41680?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 04:33:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5afe1194-b885-49ba-9a95-db887e9d710f</guid><dc:creator>monpetit</dc:creator><description>&lt;p&gt;Does your sleep module call function &lt;code&gt;sd_power_system_off()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41679?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 20:32:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43eba4b3-ec31-4ff7-807d-70fd5eca69a0</guid><dc:creator>Sam Lauffenburger</dc:creator><description>&lt;p&gt;Aryan - just letting you know that we figured out the issue. We had defined our own ble events, but also processed the same events in ble_advertising.c. An error occurred in the event processing in ble_advertising.c, but we did not define a ble error handler.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41678?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 19:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d487cae4-a968-44e9-83a1-403610bc5322</guid><dc:creator>Sam Lauffenburger</dc:creator><description>&lt;p&gt;Actually, Aryan, I don&amp;#39;t think that is the issue. We have a custom application error handler that gets called in every other case. Our program never enters the handler in app_error.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41677?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 17:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2218ebcf-1222-49f5-83be-99c05a1a0889</guid><dc:creator>Sam Lauffenburger</dc:creator><description>&lt;p&gt;Thanks - I&amp;#39;ll check it out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 and S110 why does device wake from sleep and call main?</title><link>https://devzone.nordicsemi.com/thread/41676?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 17:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fe57efd-ae29-49f6-8063-b067f0920279</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You device seems to be restarting on some error.
check &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this&lt;/a&gt; out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>