<?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>WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72801/wakeup-from-sleep-mode</link><description>Hi, 
 we try to get the NRF52840 to sleep and then wake up from an GPIO interrupt. 
 We try it in debug mode which should give a emulated sleep mode. So we stop all processing and at a while(1) loop after calling sd_power_system_off. 
 The wakeup pin</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Apr 2021 13:50:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72801/wakeup-from-sleep-mode" /><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/306568?ContentTypeID=1</link><pubDate>Fri, 23 Apr 2021 13:50:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:316ce77c-024b-47d1-ab63-0732e89a2efd</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;The only way to do it is to stop advertising before. And this has to be done from&amp;nbsp; the same context otherwise it will always crash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/301583?ContentTypeID=1</link><pubDate>Wed, 24 Mar 2021 07:31:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4ff65e6-0a48-4dad-b06e-354bdd709e03</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Please check out the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fpower.html&amp;amp;anchor=unique_1707892264"&gt;System OFF mode section&lt;/a&gt; in the nRF52832 product specification. It states that &amp;quot;before entering system OFF mode, all ongoing EasyDMA transactions need to have completed. Advertising normally does not carry EasyDMA, but I think that when you&amp;#39;re in debug mode the emulated system OFF mode will need you to disable and wait for a moment before emulating sleep.&lt;/p&gt;
&lt;p&gt;Either way, when going to deep sleep, the logical path would be to disable advertising either way. In release mode I don&amp;#39;t think you should need to stop advertising before calling &lt;strong&gt;sd_power_system_off()&amp;nbsp;&lt;/strong&gt;as long as there are no EasyDMA transactions running.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/301321?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 07:26:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee695751-bbe4-4a67-b2dc-f862340e9124</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;don&amp;#39;t you think this might be good to document in the SDK description?&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=4_7_4_1_2_7_2_26&amp;amp;anchor=ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=4_7_4_1_2_7_2_26&amp;amp;anchor=ga774947ee0e200456ea3aec3fc7f8bd6b&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I could not find any hint? Kind regards,&lt;/p&gt;
&lt;p&gt;Constantin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/301315?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 06:48:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c074f2ef-b263-4a10-bd6d-83cc3a383c59</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Constantin&lt;/p&gt;
&lt;p&gt;You need to call &lt;span&gt;sd_ble_gap_adv_stop() before going to sleep with sd_power_system_off(). Please also add a small delay or a check to make sure that sd_ble_gap_adv_stop() is&amp;nbsp;finished before calling sd_power_system_off() to avoid these crashes. You need to do this because advertising needs to be stopped/closed properly before going to sleep.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/301231?ContentTypeID=1</link><pubDate>Mon, 22 Mar 2021 13:56:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba320036-959c-461d-abbc-11ea2ee256e0</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;okay we solved the first issue. The device can be now brought to sleep mode and it wakes up again. But the issue is that this is only possible when we call the sleep processing in the callback when the advertising switches to IDLE. If the the device is advertising ongoing and we call the sd_power_system_off it fails and cannot be brought to sleep mode.&lt;/p&gt;
&lt;p&gt;Do you have a explanation for this and how can be force the chip to sleep mode even in advertising?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Constantin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/300582?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 08:08:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bf954d7-1704-4223-8c26-587b71b95a09</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Okay, so it&amp;#39;s not related to the debug mode specifically. I would suggest you check out some of our example projects that go to sleep using the sleep_mode_enter() function which prepares wakeup buttons and goes to system-off mode like this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for putting the chip into sleep mode.
 *
 * @note This function will not return.
 */
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;/p&gt;
&lt;p&gt;See, I.E. the ble_app_hrs example for more details.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/300470?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 14:52:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2852583e-134d-4fe3-9240-fcaf1f6cf294</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;in Debug and Release mode it does not work. I&amp;#39;ve tested the following pins:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define IMU_INT1&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_GPIO_PIN_MAP(1, 6)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;#define IMU_INT2&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;NRF_GPIO_PIN_MAP(1, 3)&lt;/p&gt;
&lt;p&gt;Both did not work.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Constantin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/300393?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 12:27:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3586bc78-1e37-493b-900b-2bd3ff3932f6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Okay, what Pin are you using to wake up/trig the reset when the device is sleeping. The sleep and wake up works as expected in release mode, correct?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/300141?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 13:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:069516a7-a086-44b4-a66d-b61ab42d493c</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Sorry we already tried it but no success, here is the code snippet how we launche the sleep mode:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // Prepare wakeup buttons.
	nrf_gpio_cfg_input(IMU_INT2, NRF_GPIO_PIN_NOPULL);
	nrf_gpio_cfg_sense_set(IMU_INT2, NRF_GPIO_PIN_SENSE_HIGH);

	nrf_gpio_pin_set(LED_ERROR);
	nrf_delay_ms(500);
	nrf_gpio_pin_clear(LED_ERROR);

    // Go to system-off mode (this function will not return; wakeup will cause a reset).
	#ifdef DEBUG
	 (void) sd_power_system_off();
	 while(1);
	#else
	  APP_ERROR_CHECK(sd_power_system_off());
	#endif  // DEBUG_NRF&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Again the device is powered via USB and the usb+ nad usb- lines are connected to a PC. But we already tested with battery powered only. The Debugger was always disconnected.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;C.W.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WakeUp from sleep mode</title><link>https://devzone.nordicsemi.com/thread/300003?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 07:32:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c29ea7d-4541-4554-a4ee-41daee299f79</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;First off, I strongly recommend that you move your project to SDK v17.0.2, as the SDK v17.0.2 release is a bug fix release replacing version 17.0.0, which had quite a few issues. If that doesn&amp;#39;t solve anything for you, please show me how you put the device to sleep, and how you prepare the device to sleep before that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>