<?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>Button Causing CPU freeze/SystemOff</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8921/button-causing-cpu-freeze-systemoff</link><description>I have this odd issue which creeps up in field testing. Upon a button push the board goes immediately to System Off. 99.99% of the time Button pushes are handled normally, but in these rare cases while connected to a phone, the device will go straight</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Sep 2015 08:56:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8921/button-causing-cpu-freeze-systemoff" /><item><title>RE: Button Causing CPU freeze/SystemOff</title><link>https://devzone.nordicsemi.com/thread/32840?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2015 08:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:888c3b4d-4cf5-4453-aaf3-9be209a239fa</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;@Dave_coupling&lt;/p&gt;
&lt;p&gt;Were you able to fix this issue?&lt;/p&gt;
&lt;p&gt;I am having the same problem with my timers suddenly executing instantly (&lt;a href="https://devzone.nordicsemi.com/question/52292/suddenly-app_timer-events-trigger-instantly/)."&gt;devzone.nordicsemi.com/.../).&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I added the same rtc1_stop()/rtc_start() code into my button handler and can reliably re-create the problem too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Causing CPU freeze/SystemOff</title><link>https://devzone.nordicsemi.com/thread/32839?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2015 10:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d54ca7e2-ed5c-4d1e-b5e0-478b3e499371</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I do not know what your button hold timers are doing, can you upload your project and I can have a look at it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Causing CPU freeze/SystemOff</title><link>https://devzone.nordicsemi.com/thread/32838?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2015 22:27:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a9a5c1d-eeb8-4a87-b29e-29c10246a681</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;The above code will cause my Button hold state machine to rapidly execute.   Normally the Button must be hold for 5seconds before the System_off event it pushed.   However adding the above rtc1 code, causes the System off event to be executed immediately after the Button push.&lt;/p&gt;
&lt;p&gt;This tells me that during normal operation, somehow the SDK gets into a scenario where is executes rtc1_stop(); and rtc1_start();,  which immediately seems to halt my system on Button pushes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Causing CPU freeze/SystemOff</title><link>https://devzone.nordicsemi.com/thread/32837?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2015 22:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fce965d9-cb42-4f14-ad41-dc0c61389e4c</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;Hi Aryan,  you are correct.  I added a while(1) loop with LEDs to catch if it ever reached the Flash Error system_off code.   However we again saw the fault and it didn&amp;#39;t reach the while(1).  So the fault lies somewhere else.&lt;/p&gt;
&lt;p&gt;How our button section works is on a Button push, I start a 1second Repeating timer.   At each timeout I use app_sched_event_put() to scheduler events according to how long the button as been held.&lt;/p&gt;
&lt;p&gt;Looking into the differences between app_timer.c in SDK6.1 and later versions  I see the use of rtc1_stop() which is not used in later version.   I found if execute the following (psuedo) code on a Button Push Handler I can re-create the issue:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;button_handler()
{
    if(PUSHED)
{
rtc1_stop();     //Added to simulate app_timer.c  error condition of SDK 6.1
rtc1_start();    //to restart RTC1

stop_button_hold_timer();
start_button_hold_timer();
}
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Causing CPU freeze/SystemOff</title><link>https://devzone.nordicsemi.com/thread/32836?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2015 07:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f9e2f34-e18c-455f-8c42-e5d8daa2f4df</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Dave,
Is this behavior reproducable even in debug mode?
If you do not use pstorage anywhere, why dont you just delete all its code, escpecially the one calling system_off_enter.
DRGN-5153, might not be the cause for this, because you say this happens only when button is pressed. This to me does not look anything softdevice related but seems like your application or button_library could be culprits.&lt;/p&gt;
&lt;p&gt;I did not understand fully your scheduler analysis, if the queue is full, it wont allow to add anything in the queue and hence the call should return with error. I would like to see some code and possible way to reproduce this error to help you further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>