<?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>How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51648/how-to-put-nrf52840-to-deep-sleep-system-off</link><description>Hi all 
 I am using nrf52840 kit, and I have a simple BLE app(client/central that turn LED on to a connected server/peripheral) running on it(sdk 15.3). Now I want to put it on deep sleep(SYSTEM OFF) by default. When a button is pushed, then it will connect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Sep 2021 08:27:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51648/how-to-put-nrf52840-to-deep-sleep-system-off" /><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/331637?ContentTypeID=1</link><pubDate>Wed, 29 Sep 2021 08:27:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e34e62ac-26f3-45c0-9599-9512f1dcf61e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Please create a new support case for your own issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/331569?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 16:06:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fb6c5af-92ae-468a-9ac3-eca3a6aafc5d</guid><dc:creator>Ridhi</dc:creator><description>&lt;p&gt;hello Amanda,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As suggested by you :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Template Application is an application that you can use as a starting point for developing your own application, using the hardware delivered in the nRF5 Development Kit.&amp;nbsp;The application will stop advertising after 3 minutes and then go to system-off mode. To wake it up, press Button 1, and it will start advertising again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have followed this. I am able to find the device goes to system oFF mode.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I need help in this code that as:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. as i flash the code on dk, the device should be initally in System off without any button press , giving nearvly 0.5-0.7 micro amp current.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. then&amp;nbsp;The application will stop advertising after 3 minutes&amp;nbsp;&amp;nbsp;and then go to system-off mode.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3.&amp;nbsp;To wake it up, press Button 1, and it will start advertising again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i am able to fullfill point 2 and 3. pls help how can i do the point 1 in same code&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/329302?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 05:47:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afabb872-a303-4818-860c-4a79317c1b28</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Have a look at &lt;a href="https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble"&gt;Online Power Profiler for BLE&lt;/a&gt;&amp;nbsp;and&amp;nbsp;create a new support case if you need help.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/329299?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 05:08:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44edb79f-69b5-44c5-b6a5-91359612c8af</guid><dc:creator>Ridhi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want to measure the current values in nrf52832/40. pls assist and tell me what is the values ideally for any of the ble example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/297714?ContentTypeID=1</link><pubDate>Thu, 04 Mar 2021 09:48:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:973cbfe5-9f24-4ce9-96f1-70a5a8bdd809</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Roshan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The GPIO will keep the state that was set before the chip entered System OFF. You will not be able to control it during System OFF, but it will &amp;quot;glow&amp;quot; or not, depending on what it did when System OFF was entered.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/296210?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 10:56:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58303b98-56aa-4d52-a423-c1997ca86127</guid><dc:creator>Roshan Prajapati</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Amanda,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have one query!! what if my RGB LED &amp;amp; Buzzer is connected to GPIO?? I want to know if it&amp;#39;s connected to GPIO then RGB LED &lt;strong&gt;will stop glowing &amp;amp; Buzzer will stop beeping&lt;/strong&gt; when &lt;strong&gt;deep sleep mode is enabled&lt;/strong&gt; or&lt;strong&gt; it will glow&lt;/strong&gt; the RGB LED &amp;amp; buzzer?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Roshan.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/210603?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 07:20:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:085f935b-b0bd-4ffc-9de0-e725c1ce08c0</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suggest you study how to initial bsp and use bsp event to call the&amp;nbsp;sleep_mode_enter() in&amp;nbsp;&lt;a title="Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_template.html?cp=5_1_4_2_2_23"&gt;Template Application&lt;/a&gt;&lt;span&gt;&amp;nbsp;example.&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;bsp_init() -&amp;gt; app_button_enable() -&amp;gt;&amp;nbsp;app_button_enable() -&amp;gt; &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrfx__gpiote.html#ga126062c133d6a6ffda7813c5833e870e"&gt;nrfx_gpiote_in_event_enable&lt;/a&gt;():&amp;nbsp;&lt;span&gt;Function for enabling sensing of a GPIOTE input pin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/209736?ContentTypeID=1</link><pubDate>Sun, 15 Sep 2019 21:47:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:852ba6c4-a9f4-4a22-812b-66ff097f4cac</guid><dc:creator>davidm</dc:creator><description>&lt;p&gt;I tried to put my App in deep sleep but it doesn&amp;#39;t work the way&amp;nbsp; I want it to. This is what I did, I added a sleep_mode_enter() function to main.c and tried to call it in button_event_handler, after the button is pressed. The outcome was, the board seems to go sleep but when I press the button again, it doesn&amp;#39;t wake up.&lt;/p&gt;
&lt;p&gt;Basically all I want to do is the board to be in deep sleep at all times.It will only wake up only when the button is pushed.&amp;nbsp;&lt;span&gt;When a button is pushed, then it will connect to the nearby server-peripheral kit and turn the LED on that board/server.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The reason I don&amp;#39;t want to start from&amp;nbsp; &lt;a title="Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_template.html?cp=5_1_4_2_2_23"&gt;Template Application&lt;/a&gt;&lt;span&gt;&amp;nbsp;is that I already have an Application with several features, so it would just be easier to add deep sleep capability to the existing application instead of starting from scratch again.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have attached my project below, I would greatly appreciate your help.I am using SDK 15.3.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;

static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    ret_code_t err_code;

    switch (pin_no)
    {
        case LEDBUTTON_BUTTON_PIN:
            NRF_LOG_INFO(&amp;quot;Button 1 is pressed&amp;quot;);
            err_code = ble_lbs_led_status_send(&amp;amp;m_ble_lbs_c, button_action);
            if (err_code != NRF_SUCCESS &amp;amp;&amp;amp;
                err_code != BLE_ERROR_INVALID_CONN_HANDLE &amp;amp;&amp;amp;
                err_code != NRF_ERROR_INVALID_STATE)
            {
                APP_ERROR_CHECK(err_code);
            }
            if (err_code == NRF_SUCCESS)
            {
                NRF_LOG_INFO(&amp;quot;LBS write LED state %d&amp;quot;, button_action);
                sleep_mode_enter();
            }
            break;
            }
..........


static void sleep_mode_enter(void)
{
    ret_code_t err_code;

    err_code = bsp_indication_set(BSP_INDICATE_IDLE);
    APP_ERROR_CHECK(err_code);

    // Prepare wakeup buttons.
    err_code = bsp_btn_ble_sleep_mode_prepare();
    APP_ERROR_CHECK(err_code);

    // Go to system-off mode (this function will not return; wakeup will cause a reset).
    err_code = sd_power_system_off();
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_blinky_5F00_c.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_blinky_5F00_c.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/208439?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 10:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4673f57-7bcb-496b-8c69-1ce2458be039</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Yes,&amp;nbsp;&lt;span&gt;I would suggest starting with this&amp;nbsp;&lt;/span&gt;&lt;a title="Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_template.html?cp=5_1_4_2_2_23"&gt;Template Application&lt;/a&gt;&lt;span&gt;&amp;nbsp;example which might be closed to your requirement.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/208366?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 05:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66fc7c08-f8f6-4d9f-bd7e-d4b9f82cd38b</guid><dc:creator>davidm</dc:creator><description>&lt;p&gt;Thank you Amanda for clarification. So since all I want is to simply put the kit to sleep, button_init(), followed by sleep_mode_enter() and&amp;nbsp;&lt;a title="sd_power_system_off" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_4_3_2_2_7_2_26#ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;sd_power_system_off&lt;/a&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html"&gt;()&lt;/a&gt;&lt;span&gt;&amp;nbsp; directly&amp;nbsp; in Main.c should do it?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/208112?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2019 07:41:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bedcb0ba-84a4-4611-a21a-a4350f9005d8</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;shut_down_handler function uses&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fgroup__nrf__pwr__mgmt.html&amp;amp;anchor=gab81cb0d4c56fd0317094f6327ca2a9a4"&gt;shutdown events&lt;/a&gt;&amp;nbsp;to prepare the wakeup button and registered by&amp;nbsp;&lt;a title="NRF_PWR_MGMT_HANDLER_REGISTER" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__pwr__mgmt.html?cp=5_1_6_11_36_1#ga4adfb2cc1fcbfe94a0fb1453b0cf30ec"&gt;NRF_PWR_MGMT_HANDLER_REGISTER&lt;/a&gt;. If you need to handle different shutdown events,&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_c.html"&gt;ble_app_uart_c&lt;/a&gt;&amp;nbsp;is a good example.&amp;nbsp;&lt;a title="Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_template.html?cp=5_1_4_2_2_23"&gt;Template Application&lt;/a&gt;&amp;nbsp;/sleep_mode_enter() &lt;span&gt;prepares the wakeup button&lt;/span&gt; without event handler and then&amp;nbsp;&lt;a title="sd_power_system_off" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_4_3_2_2_7_2_26#ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;sd_power_system_off&lt;/a&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html"&gt;()&lt;/a&gt;&lt;span&gt;&amp;nbsp;put the system to sleep&lt;/span&gt; directly.&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Fgroup__nrf__pwr__mgmt.html&amp;amp;anchor=gacc5acf4fd976c9288c7549c8acf16d64"&gt;nrf_pwr_mgmt_shutdown&lt;/a&gt;&amp;nbsp;(used in&amp;nbsp;&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_c.html"&gt;ble_app_uart_c&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a title="Power Profiling Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_pwr_mgmt.html?cp=5_1_4_2_2_20"&gt;Power Profiling Application&lt;/a&gt;&amp;nbsp;) schedules a callback to put the system to sleep.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/208080?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2019 03:44:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:debd7a06-c2c6-4938-87d7-ad231b9ea9d5</guid><dc:creator>davidm</dc:creator><description>&lt;p&gt;Thank you Amanda.&lt;/p&gt;
&lt;p&gt;So it seems like all I need to do is include &lt;em&gt;button_init&lt;/em&gt; to enable pin sense mechanism, add &lt;em&gt;shutdown_handler&lt;/em&gt; function and register it....and call&amp;nbsp;&lt;span&gt;&lt;em&gt;nrf_pwr_mgmt_shutdown&lt;/em&gt; to put it to sleep, is that correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding prepare buttons for wake up, in&amp;nbsp;SDK 15.3&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_c.html"&gt;ble_app_uart_c&lt;/a&gt;, &lt;em&gt;shut_down_handler&lt;/em&gt; is being used , but in other examples(&lt;a title="Power Profiling Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_pwr_mgmt.html?cp=5_1_4_2_2_20"&gt;Power Profiling Application&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a title="Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_template.html?cp=5_1_4_2_2_23"&gt;Template Application&lt;/a&gt;&amp;nbsp;) is not there, what are they using instead?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/207902?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2019 11:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c30493eb-6adc-4854-bfa8-5e0e4896828e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="davidm"]First I need to enable GPIO sense mechanism. And this can be done in bsp_init, but the question is where do I pass the value to enable?&amp;nbsp; &amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;buttons_init() -&amp;gt; bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, NULL); -&amp;gt; app_button_init -&amp;gt; GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);&lt;/p&gt;
&lt;p&gt;The sense mechanism will be set for that pin.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="davidm"]how is NRF_PWR_MGMT_HANDLER_REGISTER used?[/quote]
&lt;p&gt;Please this page&amp;nbsp;&lt;a title="NRF_PWR_MGMT_HANDLER_REGISTER" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__pwr__mgmt.html?cp=5_1_6_11_36_1#ga4adfb2cc1fcbfe94a0fb1453b0cf30ec"&gt;NRF_PWR_MGMT_HANDLER_REGISTER&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="davidm"]which files I need to include in order to use&amp;nbsp;&lt;span&gt;nrf_pwr_mgmt_shutdown?&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;nRF5_SDK_15.3.0_59ac345\components\libraries\pwr_mgmt\nrf_pwr_mgmt.c&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suggest starting with this &lt;a title="Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_template.html?cp=5_1_4_2_2_23"&gt;Template Application&lt;/a&gt;&amp;nbsp;example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Template Application is an application that you can use as a starting point for developing your own application, using the hardware delivered in the nRF5 Development Kit.&amp;nbsp;The application will stop advertising after 3 minutes and then go to system-off mode. To wake it up, press Button 1, and it will start advertising again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/207775?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2019 04:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7de07b00-4387-4657-b0aa-7e4b2684b880</guid><dc:creator>davidm</dc:creator><description>&lt;p&gt;Thank you Amanda,thank you again for the explanation. According to the details you provided above,my understanding is, In order to add deep sleep capability, I need to do to 3 things (and please correct my understanding if is wrong).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First I need to enable GPIO sense mechanism. And this can be done in bsp_init, but the question is where do I pass the value to enable?&amp;nbsp; &amp;nbsp;&lt;/li&gt;
&lt;li&gt;The second thing is I need to configure wake up buttons, and I should be able to do this by registering shutdown_handler as it&amp;#39;s done in 15.3 ble_app_uart_c. Question is how is NRF_PWR_MGMT_HANDLER_REGISTER used?&lt;/li&gt;
&lt;li&gt;Third thing is to call nrf_pwr_mgmt_shutdown anywhere inside main(void). But the question is, which files I need to include in order to use&amp;nbsp;&lt;span&gt;nrf_pwr_mgmt_shutdown?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/207661?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2019 11:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eb19097-5492-448c-be01-d859065d2447</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="davidm"]You mentioned that in&amp;nbsp;&lt;a title="Power Profiling Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_pwr_mgmt.html?cp=5_1_4_2_2_20"&gt;Power Profiling Application&lt;/a&gt;&lt;span&gt;&amp;nbsp;example shows how to configure wakeup buttons, but I didn&amp;#39;t see, where they are doing that , also I tried to look for&amp;nbsp;&amp;nbsp;&lt;a title="nrf_gpio_cfg_sense_input" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0_10#ga91f72be8204a892956fa5d5dd59c32b2"&gt;nrf_gpio_cfg_sense_input&lt;/a&gt;&amp;nbsp;method in the example I didn&amp;#39;t find it in the example.&lt;/span&gt;[/quote]
&lt;p&gt;It&amp;#39;s the DETECT signal that wakes the chip up from the system off sleep. So the gpio needs to enable sense mechanism. This is done in as part of buttons_init() -&amp;gt; bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, NULL);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="davidm"]In the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45355/how-optimize-high-current-consumption-in-sleep-mode-using-nrf52840"&gt;post&lt;/a&gt; I referenced above Simonr used&amp;nbsp;&amp;nbsp;bsp_btn_ble_sleep_mode_prepare() to prepare wake up buttons, what is the difference between&amp;nbsp;&amp;nbsp;bsp_btn_ble_sleep_mode_prepare() and&amp;nbsp;&lt;a title="nrf_gpio_cfg_sense_input" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0_10#ga91f72be8204a892956fa5d5dd59c32b2"&gt;nrf_gpio_cfg_sense_input&lt;/a&gt;&amp;nbsp;,which one should I use?[/quote]
&lt;p&gt;In the SDK12.3 ble_app_uart_c, we use&amp;nbsp;sleep_mode_enter(); -&amp;gt; bsp_btn_ble_sleep_mode_prepare(); -&amp;gt; bsp_wakeup_button_enable() -&amp;gt; wakeup_button_cfg(button_idx, true); -&amp;gt; &lt;a href="https://devzone.nordicsemi.com/support-private/support/235285/nrf_gpio_cfg_sense_set"&gt;nrf_gpio_cfg_sense_set()&lt;/a&gt; to prepare wake up buttons. Please also see&amp;nbsp;&lt;a title="Software Development Kit" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?resultof=%22%6e%72%66%5f%67%70%69%6f%5f%63%66%67%5f%73%65%6e%73%65%5f%73%65%74%22%20"&gt;nRF5 SDK v15.3.0: GPIO HAL&lt;/a&gt;.&amp;nbsp;In SDK 15.3 &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_c.html"&gt;ble_app_uart_c&lt;/a&gt;, it&amp;#39;s done in shutdown_handler.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="davidm"]I know I can use&amp;nbsp;&amp;nbsp;&lt;a title="sd_power_system_off" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_4_3_2_2_7_2_26#ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;sd_power_system_off&lt;/a&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html"&gt;()&lt;/a&gt;&amp;nbsp;but my question still remains where can I put that, Can I place it anywhere I want in the Main.c &amp;#39;s &lt;em&gt;int main(void){}&lt;/em&gt; without causing any issues?[/quote]
&lt;p&gt;&amp;nbsp;It supposes not causing any issues. In the examples, it calls &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__pwr__mgmt.html?cp=5_1_6_11_36_8#gacc5acf4fd976c9288c7549c8acf16d64"&gt;&lt;span lang="en-US"&gt;nrf_pwr_mgmt_shutdown&lt;/span&gt;&lt;/a&gt;&lt;span lang="nb-NO"&gt;() -&amp;gt; shutdown_process(); -&amp;gt; sd_power_system_off();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/207506?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 21:40:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db694aad-ec7b-4c83-b8cb-6621d6470087</guid><dc:creator>davidm</dc:creator><description>&lt;p&gt;Thank you, Amanda, for the response.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You mentioned that in&amp;nbsp;&lt;a title="Power Profiling Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_pwr_mgmt.html?cp=5_1_4_2_2_20"&gt;Power Profiling Application&lt;/a&gt;&lt;span&gt;&amp;nbsp;example shows how to configure wakeup buttons, but I didn&amp;#39;t see, where they are doing that , also I tried to look for&amp;nbsp;&amp;nbsp;&lt;a title="nrf_gpio_cfg_sense_input" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0_10#ga91f72be8204a892956fa5d5dd59c32b2"&gt;nrf_gpio_cfg_sense_input&lt;/a&gt;&amp;nbsp;method in the example I didn&amp;#39;t find it in the example.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;In the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45355/how-optimize-high-current-consumption-in-sleep-mode-using-nrf52840"&gt;post&lt;/a&gt; I referenced above Simonr used&amp;nbsp;&amp;nbsp;bsp_btn_ble_sleep_mode_prepare() to prepare wake up buttons, what is the difference between&amp;nbsp;&amp;nbsp;bsp_btn_ble_sleep_mode_prepare() and&amp;nbsp;&lt;a title="nrf_gpio_cfg_sense_input" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0_10#ga91f72be8204a892956fa5d5dd59c32b2"&gt;nrf_gpio_cfg_sense_input&lt;/a&gt;&amp;nbsp;,which one should I use?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;I know I can use&amp;nbsp;&amp;nbsp;&lt;a title="sd_power_system_off" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_4_3_2_2_7_2_26#ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;sd_power_system_off&lt;/a&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html"&gt;()&lt;/a&gt;&amp;nbsp;but my question still remains where can I put that, Can I place it anywhere I want in the Main.c &amp;#39;s &lt;em&gt;int main(void){}&lt;/em&gt; without causing any issues?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put nrf52840 to deep sleep(SYSTEM OFF)</title><link>https://devzone.nordicsemi.com/thread/207410?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2019 13:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7e4290c-04e0-4a82-81b7-b20dd27c4a7c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The nRF52840 can be put into &lt;a title="System OFF mode" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=3_0_0_4_2_2#unique_1227688711"&gt;System OFF mode&lt;/a&gt;&amp;nbsp;by calling &lt;a title="sd_power_system_off" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_4_3_2_2_7_2_26#ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;sd_power_system_off&lt;/a&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v3.0.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html"&gt;()&lt;/a&gt;,&amp;nbsp;which puts the system to the deepest power-saving mode&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The system can be woken up through a DETECT signal generated by GPIO pins&lt;/span&gt;&lt;span&gt;. Configurations of individual pins are done through the SENSE field in the PIN_CNF[n] register and can be set by calling &lt;a title="nrf_gpio_cfg_sense_input" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0_10#ga91f72be8204a892956fa5d5dd59c32b2"&gt;nrf_gpio_cfg_sense_input&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v9.0.0%2Fgroup__nrf__gpio.html"&gt;(...)&lt;/a&gt;&lt;/span&gt;&lt;span&gt;. However, system OFF will disable all peripherals except for GPIO, LPCOMP, and NFC, and after waking up the system gets reset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Another possibility is to put the system into System ON sleep mode, where the system will wake up on any event, and can be invoked by calling &lt;a title="sd_app_evt_wait" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_4_3_2_2_7_2_0#ga11d88d38ac99fb72cde74c9385d36433"&gt;sd_app_evt_wait&lt;/a&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=/com.nordic.infocenter.s132.api.v3.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga11d88d38ac99fb72cde74c9385d36433"&gt;()&lt;/a&gt;.&amp;nbsp;All the peripherals can be used and you can use GPIOTE interrupts to wake it up.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can refer to the&amp;nbsp;&lt;a title="Power Profiling Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_pwr_mgmt.html?cp=5_1_4_2_2_20"&gt;Power Profiling Application&lt;/a&gt;&amp;nbsp;example.&amp;nbsp;This sample application starts up, configures wakeup buttons, and enters the System OFF mode. On button presses, the application wakes up and goes into either &amp;#39;Connectable mode&amp;#39; or &amp;#39;Non-connectable mode&amp;#39; based on which button is pressed.&lt;/p&gt;
&lt;p&gt;For more information on both modes, see&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html#ga11d88d38ac99fb72cde74c9385d36433"&gt;sd_app_evt_wait&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and the nRF5 Series User Specification (Section: POWER - Power control).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>