<?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>Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50118/sleep-until-wdt-timesout</link><description>Hi All, 
 I have up to 8 nRF52832 devices sending data back to a base unit (another nRF52832 device.) What I&amp;#39;m trying to do is have the remote units wakeup at a given time, 
 read sensors and send message back to the base unit. (Each remote has a unique</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Aug 2019 11:38:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50118/sleep-until-wdt-timesout" /><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201836?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 11:38:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:270cf717-7452-4d59-a871-cf1571a75f8e</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;thanks for all the help.&lt;/p&gt;
&lt;p&gt;I appreciate it.&lt;/p&gt;
&lt;p&gt;Bob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201769?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 08:12:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d7d3ab2-3eec-45b7-9613-c0af2158e2c0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Then systemoff will not suit you. That is, you won&amp;#39;t be able to go to deepest sleep mode if any external sensor/input is not involved.&lt;/p&gt;
&lt;p&gt;RTC is your good bet, it will run on LFCLK and the example you can see in SDK15.3\examples\peripheral\rtc\main.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201622?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 13:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a850db0b-76d0-46b8-a2c8-e348014a871b</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;We don&amp;#39;t have the luxury of having something external running to wake up the nRF52832 device.&amp;nbsp; We need the device to wake itself up.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201617?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 13:30:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61cd36bb-9086-4b54-b3cf-e13f355f1e16</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="rshankle"]The device is a remote sensor and just needs to wake up read some IO, phone home, shut everything off and go back to sleep.&amp;nbsp; Maintaining connectivity with other devices isn&amp;#39;t needed.[/quote]
&lt;p&gt;&amp;nbsp;Then SystemOFF (deepest sleep mode) seems to suit your needs. You just need a proper wakeup mechanism configured with one GPIO pin, which could be an interrupt line from the externally powered sensor.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201611?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 13:23:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:900ee2f1-0bfd-4e93-97f8-335357690b83</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;I&amp;#39;m looking for ideas.&amp;nbsp; What is the deepest sleep and still have the device wake itself up.&amp;nbsp; The device is a remote sensor and just needs to wake up read some IO, phone home, shut everything off and go back to sleep.&amp;nbsp; Maintaining connectivity with other devices isn&amp;#39;t needed.&lt;/p&gt;
&lt;p&gt;The device does write to NVRAM before going to sleep so it can read that data on the next wakeup cycle.&lt;/p&gt;
&lt;p&gt;There is an external 32Khz crystal connected if that helps minimize power.&lt;/p&gt;
&lt;p&gt;(Under 20uA would probably be a solution.)&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Bob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201599?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 13:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9995134d-c5c3-422f-b4d4-c5da8a47d94f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Bob,&lt;/p&gt;
&lt;p&gt;Waking up from &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fpower.html&amp;amp;cp=3_1_0_17_1&amp;amp;anchor=unique_1707892264"&gt;system off&lt;/a&gt; mode is different than WFE. How are you intending to wake the chip from SystemOFF?&amp;nbsp;&lt;br /&gt;What is the acceptable power consumption in sleep mode you are aiming for?&amp;nbsp;&lt;br /&gt;Being in deep sleep will make your devices lose connection with each other&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="rshankle"]What is the deepest sleep mode I can put the nrf52832 into and leverage this crystal?&amp;nbsp; Goal being to wake up after a given time period (in seconds to minutes.)[/quote]
&lt;p&gt;The timers in the chip will be off, so you cannot reply on-chip timers to wake the chip here. Please read carefully the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fpower.html&amp;amp;cp=3_1_0_17_1&amp;amp;anchor=unique_1707892264"&gt;four ways&lt;/a&gt; that can wake the chip from system off mode.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201058?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 17:16:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a653e760-c8dc-4d9f-bad3-865e23550b12</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;I wanted to rule out that my hardware is drawing the high current, so I created a software build that just has:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define RAM_RETENTION_OFF       (0x00000003UL)  /**&amp;lt; The flag used to turn off RAM retention on nRF52. */

int main( void )
{
#ifdef NRF51
    NRF_POWER-&amp;gt;RAMON |= (POWER_RAMON_OFFRAM0_RAM0Off &amp;lt;&amp;lt; POWER_RAMON_OFFRAM0_Pos) |
                        (POWER_RAMON_OFFRAM1_RAM1Off &amp;lt;&amp;lt; POWER_RAMON_OFFRAM1_Pos);
#endif //NRF51
#ifdef NRF52
    NRF_POWER-&amp;gt;RAM[0].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[1].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[2].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[3].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[4].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[5].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[6].POWER = RAM_RETENTION_OFF;
    NRF_POWER-&amp;gt;RAM[7].POWER = RAM_RETENTION_OFF;
#endif //NRF52

    // Set nRF5 into System OFF. Reading out value and looping after setting the register
    // to guarantee System OFF in nRF52.
    NRF_POWER-&amp;gt;SYSTEMOFF = 0x1;
    (void) NRF_POWER-&amp;gt;SYSTEMOFF;
    while (true);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The current draw in this mode is 12uA.&lt;/p&gt;
&lt;p&gt;So I know I&amp;#39;m close just missing a setting somewhere.&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Bob&lt;/p&gt;
&lt;p&gt;(ps I couldn&amp;#39;t get the insert code feature to make the window larger above, if you click on it there is more.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/201031?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 14:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6185aa7-21b4-4356-bb01-f02a5ad847da</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;My board has an external 32KHz crystal.&amp;nbsp; What is the deepest sleep mode I can put the nrf52832 into and leverage this crystal?&amp;nbsp; Goal being to wake up after a given time period (in seconds to minutes.)&lt;/p&gt;
&lt;p&gt;Thanks much for any pointers. I have a multi-meter on my board measuring current and I can&amp;#39;t get it to stay below 170uA in sleep mode.&amp;nbsp; (I think I&amp;#39;m missing a power down mode of some sort.)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Bob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/200193?ContentTypeID=1</link><pubDate>Wed, 24 Jul 2019 07:16:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e51265d-df87-4ed3-a960-565b4cf61caa</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You can use an RTC to wake the system up from WFE sleep, the watchdog timeout inserts an unnecessary reset in between, which if I understood correctly is something you could avoid. Look at the example provided at&amp;nbsp;nRF5_SDK_15.3.0_59ac345\examples\peripheral\rtc\main.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/200137?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 15:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e4340f1-7976-468f-ab32-c59d20053991</guid><dc:creator>Otso Jousimaa</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Someone from Nordic can point you to their official examples, here&amp;#39;s how I did it at Ruuvi:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.ruuvi.com/ruuvi-firmware-part-11-scheduler-c95836f3105c"&gt;https://blog.ruuvi.com/ruuvi-firmware-part-11-scheduler-c95836f3105c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That blog is a part of lot larger series and quite heavy to grasp it on its own.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In essence the timer interrupt adds call to data update function to Nordic scheduler, and the timer interrupt brings the tag out of the sleep.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First thing once tag is out of the sleep is to execute scheduled function, including data update scheduled above.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After scheduler has run the main loop calls yield() which in turn will call the Nordic power management function. In your case I&amp;#39;d add calls to switch off the mofsets in yield and switch on once the tag has exited Nordic power management.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t necessarily need to use the scheduler, just having timer interrupt is enough to bring tag out of the sleep.&amp;nbsp;However I&amp;#39;d prefer to not run the sensor reads in timer interrupt context, as it could mask other interrupts such as SPI data ready and lock your program.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/200133?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 15:09:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:436d3b7e-72a9-4dfc-9c23-b2d158b13438</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;Ok, so I&amp;#39;m working on adding nrf_pwr_mgmt_run() to my project, which obviously needs nrf_pwr_mgmt.h, when I start compiling it starts complaining about wanting nrf_section_iter.... so I add that.&amp;nbsp; The latest complain is it wants __start_pwr_mgmt_data and __stop_pwr_mgmt_data defined.&amp;nbsp; &amp;nbsp;(Digging into that I find I need sections_placement.xml file updated, but I only see flash_placement.xml file.)&lt;/p&gt;
&lt;p&gt;So before I tunnel down this rabbit hole any further.&amp;nbsp; Is there a simple example that just puts the device in the lowest power mode (with some internal timer or WDT that will bring it out of sleep mode after a set period.&amp;nbsp; External input is not an option.)&lt;/p&gt;
&lt;p&gt;Thanks much!&lt;br /&gt;Bob&lt;/p&gt;
&lt;p&gt;FYI my current setup puts the device in sleep mode drawing 210uAmps&amp;nbsp; (When the device is awake it draws about 8mAmps.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/200034?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 11:44:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd3d3aeb-5145-4fc6-870e-f6b7b8e84895</guid><dc:creator>rshankle</dc:creator><description>&lt;p&gt;Hi Otso,&lt;/p&gt;
&lt;p&gt;Thanks for the response,&amp;nbsp; we have mosfets that turn on/off the sensors so I&amp;#39;m not thinking the problem is sensors draining batteries.&lt;/p&gt;
&lt;p&gt;Can you point to an example using nrf_pwr_mgmt_run()&amp;nbsp; with timer triggering it?&lt;/p&gt;
&lt;p&gt;thanks again!&lt;br /&gt;Bob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep until WDT timesout</title><link>https://devzone.nordicsemi.com/thread/199886?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2019 21:45:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc0cc2e6-dda1-44bb-ae19-d9098919deb6</guid><dc:creator>Otso Jousimaa</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First thing I&amp;#39;d check is if the external sensors are in low-power mode during sleep, if some sensor stays in measuring mode it can drain your battery regardless of what your device does.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Second, I&amp;#39;d use&amp;nbsp;`nrf_pwr_mgmt_run();` instead of direct call to `__WFE();`&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Third, nRF52 can spend relatively long time in active mode during boot, I&amp;#39;d rather use timer interrupt to wake up from sleep and let watchdog handle only the cases where program has hanged.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>