<?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>System off wakeup by release of key</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52525/system-off-wakeup-by-release-of-key</link><description>Hello, 
 I am developing a remote device which uses system off mode for idle state. I also have the condition where extra long press of any key that is beyond the long press timeout will force device to enter in system off mode. But due to this i am facing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Sep 2019 10:58:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52525/system-off-wakeup-by-release-of-key" /><item><title>RE: System off wakeup by release of key</title><link>https://devzone.nordicsemi.com/thread/211505?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 10:58:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03d56ee7-03c3-4af8-a027-4375e3afe654</guid><dc:creator>cbd</dc:creator><description>&lt;p&gt;I&amp;#39;d be wary of storing key press data in flash as you&amp;#39;ll be limiting the life of your flash and also drawing more current in order to write and erase data than you would potentially save.&lt;/p&gt;
&lt;p&gt;I also don&amp;#39;t see how it would get you around your issue as you would still react to the reset and then have to check flash value, GPIO value before trying to shutdown and the cycle would then potentially start over again again.&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t set the sense of the GPIO detection if the GPIO line is already in that state as you will immediately get a detection trigger (from 52840 datasheet, but will be applicable to other MCUs):&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;span style="background-color:#ffffff;"&gt;Make sure that a pin is in a level that cannot trigger the sense mechanism before enabling it. The DETECT&lt;br /&gt;signal will go high immediately if the SENSE condition configured in the PIN_CNF registers is met when the&lt;br /&gt;sense mechanism is enabled. This will trigger a PORT event if the DETECT signal was low before enabling&lt;br /&gt;the sense mechanism.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Hence my suggestion of waiting until the button is released before triggering SYSTEM OFF.&lt;/p&gt;
&lt;p&gt;I see that you are using the button app library code, so there is no reason why you can&amp;#39;t capture time of button press and then time of button release in your button event handler. If the difference is greater than your long button press you can then trigger SYSTEM OFF.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System off wakeup by release of key</title><link>https://devzone.nordicsemi.com/thread/211503?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 10:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fe9a34a-74c6-406b-9a9b-224a83dc77f2</guid><dc:creator>Kenneth</dc:creator><description>[quote user="cbd"]Another option is to check the time that a button has been pressed for, but don&amp;#39;t trigger the shutdown into SYSTEM OFF until after the button has been released.&amp;nbsp;[/quote]
&lt;p&gt;I think that is the way to go,&amp;nbsp;I do not see how that should affect current consumption (since the time can be measured with RTC) unless the user repeatedly go to system OFF.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System off wakeup by release of key</title><link>https://devzone.nordicsemi.com/thread/211496?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 10:29:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1300476a-78f5-4b3a-b072-5f86119c9483</guid><dc:creator>ssc</dc:creator><description>[quote userid="72220" url="~/f/nordic-q-a/52525/system-off-wakeup-by-release-of-key/211462"]Another option is to check the time that a button has been pressed for, but don&amp;#39;t trigger the shutdown into SYSTEM OFF until after the button has been released.[/quote]
&lt;p&gt;We need very low current consumption also as it is the product requirement i cant do this.&lt;/p&gt;
[quote userid="72220" url="~/f/nordic-q-a/52525/system-off-wakeup-by-release-of-key/211462"]You can, however, specify the sense e.g. release or press, of the pin used to trigger the wakeup with nrf_gpio_cfg_sense_set(), but I suspect that you&amp;#39;ve probably already done that.[/quote]
&lt;p&gt;Yes i am already doing this but no luck.&lt;/p&gt;
&lt;p&gt;I am now trying to store key press data to flash memory as it can read out on every reset&amp;nbsp; condition.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please suggest me if there is another way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System off wakeup by release of key</title><link>https://devzone.nordicsemi.com/thread/211462?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 08:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b14ff378-eaa6-4d00-b027-a2b43755f0c0</guid><dc:creator>cbd</dc:creator><description>&lt;p&gt;RESETREAS will only tell you that the reset was triggered by a pin reset.&lt;/p&gt;
&lt;p&gt;You can, however, specify the sense e.g. release or press, of the pin used to trigger the wakeup with nrf_gpio_cfg_sense_set(), but I suspect that you&amp;#39;ve probably already done that.&lt;/p&gt;
&lt;p&gt;Another option is to check the time that a button has been pressed for, but don&amp;#39;t trigger the shutdown into SYSTEM OFF until after the button has been released.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>