<?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>Ultra low power mode - nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43169/ultra-low-power-mode---nrf52832</link><description>Hi, 
 I am using nRF52832 with sdk 15, freertos. 
 I need to implement the following logic: 
 1. Get into low power mode, while keeping a timer running. 
 2. Every 10 mins the system needs to &amp;#39;wake up&amp;#39;, run some commands and return to low power mode.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Feb 2019 15:09:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43169/ultra-low-power-mode---nrf52832" /><item><title>RE: Ultra low power mode - nRF52832</title><link>https://devzone.nordicsemi.com/thread/169772?ContentTypeID=1</link><pubDate>Wed, 06 Feb 2019 15:09:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a6b1b6c-6c45-4407-a518-506100ebd03d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI Shaked,&lt;/p&gt;
&lt;p&gt;Yes, you need to use FreeRTOS in Tickless Idle mode, so that the idle task calls&amp;nbsp;portSUPPRESS_TICKS_AND_SLEEP, which is defined as&amp;nbsp;&lt;span&gt;vPortSuppressTicksAndSleep().&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;br /&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ultra low power mode - nRF52832</title><link>https://devzone.nordicsemi.com/thread/169526?ContentTypeID=1</link><pubDate>Tue, 05 Feb 2019 13:31:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:229fde3a-4944-4a66-9650-49de561707ee</guid><dc:creator>Shaked</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Keeping it as &amp;#39;if 0&amp;#39; will cause it to ignore the whole part in the &amp;#39;ifdef&amp;#39;, so it seems it isn&amp;#39;t getting into sleep mode at all.&lt;/p&gt;
&lt;p&gt;Let me make my question clearer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using the next code in order for the device to go into sleep mode:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;	sd_nvic_ClearPendingIRQ(Reset_IRQn);
	while(1) //#65 while button isn&amp;#39;t pressed
	{
		ret_code_t ret_code = sd_app_evt_wait();
		ASSERT((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_SOFTDEVICE_NOT_ENABLED));
		sd_nvic_ClearPendingIRQ(Reset_IRQn);

	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;but I see the device isn&amp;#39;t going into sleeping mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;May it be because i am using ticks as well? maybe i need to use &amp;quot;vPortSuppressTicksAndSleep&amp;quot; ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How can i get it so go into sleep mode ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Shaked.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ultra low power mode - nRF52832</title><link>https://devzone.nordicsemi.com/thread/169501?ContentTypeID=1</link><pubDate>Tue, 05 Feb 2019 12:34:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f894356b-a100-403e-986c-f4959537e8ea</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;As the comment states:&amp;nbsp;With FreeRTOS sd_app_evt_wait increases power consumption with FreeRTOS compared to _WFE (NRFFOSDK-11174).&amp;nbsp;&lt;br /&gt;Hence I would leave the implementation as it is, i.e. with the #if 0 statement.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ultra low power mode - nRF52832</title><link>https://devzone.nordicsemi.com/thread/169492?ContentTypeID=1</link><pubDate>Tue, 05 Feb 2019 12:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9e429b1-7674-459a-8734-f863891e528b</guid><dc:creator>Shaked</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am now using sd_app_evt_wait() like you advised, and I am removing all interrupts before-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	sd_nvic_ClearPendingIRQ(Reset_IRQn);
	while(1) //#65 while button isn&amp;#39;t pressed
	{
		ret_code_t ret_code = sd_app_evt_wait();
		ASSERT((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_SOFTDEVICE_NOT_ENABLED));
		sd_nvic_ClearPendingIRQ(Reset_IRQn);

	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In order to the sd_app_evt_wait() function to work, in &amp;#39;port_cmsis_systick.c&amp;#39; file, i changed the &amp;#39;if 0&amp;#39; to be &amp;#39;if 1&amp;#39; as following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if 1  // With FreeRTOS sd_app_evt_wait increases power consumption with FreeRTOS compared to _WFE (NRFFOSDK-11174)
#ifdef SOFTDEVICE_PRESENT
            if (nrf_sdh_is_enabled())
            {
                uint32_t err_code = sd_app_evt_wait();
                APP_ERROR_CHECK(err_code);
            }
            else
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;without changing it, the function isn&amp;#39;t called at all (since it is in the &amp;#39;ifdef&amp;#39;), and after changing it, the current gets higher than the original one.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please advise.&lt;/p&gt;
&lt;p&gt;Thank you,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Shaked.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Ultra low power mode - nRF52832</title><link>https://devzone.nordicsemi.com/thread/168907?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 14:41:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25aeaf6c-ed8a-430a-b733-eafc7b49b6d5</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Shaked,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q1: Yes, going to System On with full RAM retention and then waking up on a timer interrupt sounds like the way to go.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q2: If the SoftDevice is enabled you simply call sd_app_evt_wait() and the SoftDevice will go to System ON: Low Power mode untill the next interrupt occurs. If you&amp;#39;re not using the SoftDevice then you call _WFE() ( wait for event )&lt;/p&gt;
&lt;p&gt;Q3: See&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S132/v6-1-0/group_nrf_soc_functions?1815#ga11d88d38ac99fb72cde74c9385d36433"&gt;sd_app_evt_wait&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.keil.com/support/man/docs/armasm/armasm_dom1361289926047.htm"&gt;http://www.keil.com/support/man/docs/armasm/armasm_dom1361289926047.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Q4: The FreeRTOS kernel takes care of this automatically, i.e. whenever there is no task to run it will call&amp;nbsp;__WFE(); or&amp;nbsp;sd_app_evt_wait();&lt;/p&gt;
&lt;p&gt;Q5: No, the SoftDevice will manage the connections for you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>