<?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>Wake-up ble_app_uart device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52452/wake-up-ble_app_uart-device</link><description>Hi, 
 In &amp;quot;ble_app_uart&amp;quot; project, the system will enter sleep mode after 3 mins. 
 When system enter sleep mode, the &amp;quot;RTT view&amp;quot; will print following message. 
 
 How to modify this code if I want to wake-up the device by “GPOI 05&amp;quot; 
 Thank you, 
 Chian</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Sep 2019 15:44:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52452/wake-up-ble_app_uart-device" /><item><title>RE: Wake-up ble_app_uart device</title><link>https://devzone.nordicsemi.com/thread/211352?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 15:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c57402bd-7bd8-435f-bffd-b615a8f8246b</guid><dc:creator>chianglin</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Edvin,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your explain.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can I do following modification in bsp_btn_ble.c to enable an interrupt on pin 5?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;	#define BTN_ID_WAKEUP             5  /**&amp;lt; ID of button used to wake up the application. */
	#define BTN_ID_SLEEP              5  /**&amp;lt; ID of button used to put the application into sleep mode. */
	#define BTN_ID_DISCONNECT         0  /**&amp;lt; ID of button used to gracefully terminate a connection on long press. */
	#define BTN_ID_WAKEUP_BOND_DELETE 1  /**&amp;lt; ID of button used to wake up the application and delete all bonding information. */
	#define BTN_ID_WHITELIST_OFF      1  /**&amp;lt; ID of button used to turn off usage of the whitelist. */
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which pin 5 is connect a switch to GND.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Chianglin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake-up ble_app_uart device</title><link>https://devzone.nordicsemi.com/thread/211141?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 08:30:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2437f7fa-3b87-4f54-a211-7651ef208bf7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Chianglin,&lt;/p&gt;
&lt;p&gt;The reason you see the &amp;quot;app: Fatal error&amp;quot; is that you are debugging while trying to call sd_power_system_off(). If you look at the header file that contains this function, nrf_soc.h, on line 506-510, you can see that it can only return NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN (=0x2006).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, usually, when you are not debugging, this function doesn&amp;#39;t return, but powers off the chip (enter system off mode, which is the deepest sleep mode). When the device wakes up from this, it will act as a reset. When you&amp;nbsp;&lt;strong&gt;are&lt;/strong&gt; debugging, this function returns a value, which is passed onto APP_ERROR_CHECK(), which will cause an error. What I am trying to say is that this will always fail when you are debugging, but it doesn&amp;#39;t happen when you do not debug. It will just enter system off mode.&lt;/p&gt;
&lt;p&gt;You can see that if you define &amp;quot;DEBUG&amp;quot; in your preprocessor defines, the log will say that it receives the error 0x2006 on line 324 in main.c (line number may change if you have changed your main.c file).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]How to modify this code if I want to wake-up the device by “GPOI 05&amp;quot;[/quote]
&lt;p&gt;&amp;nbsp;You must modify your&amp;nbsp;bsp_btn_ble_sleep_mode_prepare() to enable an interrupt on pin 5 instead of the button that is already set.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>