<?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>Watchdog problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32507/watchdog-problem</link><description>SDK 14.2 
 I try to use the watchdog using this code 
 static void nrf_wdt_event_handler(void) { NRF_LOG_INFO(&amp;quot;&amp;gt;&amp;gt;&amp;gt; nrf_wdt_event_handler&amp;quot;) } 
 int main(void) { 
 ... 
 nrf_drv_wdt_config_t wdtConfig; wdtConfig.reload_value= 3*32768; wdtConfig.behaviour</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Mar 2018 15:06:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32507/watchdog-problem" /><item><title>RE: Watchdog problem</title><link>https://devzone.nordicsemi.com/thread/125036?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 15:06:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a098dae6-01ac-45ba-8b31-3f303b589ab4</guid><dc:creator>JB21</dc:creator><description>&lt;p&gt;I tried that already but gave up because #include &amp;quot;nrf51_bitfields.h&amp;quot; gave lots of compilation errors.&lt;/p&gt;
&lt;p&gt;For a test I just used&lt;/p&gt;
&lt;p&gt;wdtConfig.behaviour= NRF_WDT_BEHAVIOUR_RUN_SLEEP;&lt;/p&gt;
&lt;p&gt;wdtConfig.reload_value= 3000;&lt;/p&gt;
&lt;p&gt;and now it triggers after&amp;nbsp;3 seconds as expected.&lt;/p&gt;
&lt;p&gt;Thanks for your advice creating a case. But I can&amp;#39;t even repeat this problem reliably here. It happens only occasionly. Not something wishes for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog problem</title><link>https://devzone.nordicsemi.com/thread/125028?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 14:24:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbc6a3c8-cb46-496b-ba54-050640032129</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You can enable the watchdog to run while in sleep mode, it will however not run in &amp;quot;deep-sleep&amp;quot; mode, because the timers are not running in this state, and the watchdog timer would not have a way of running.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use the line below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_WDT-&amp;gt;CONFIG = (WDT_CONFIG_HALT_Pause &amp;lt;&amp;lt; WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run &amp;lt;&amp;lt; WDT_CONFIG_SLEEP_Pos);   //Configure Watchdog. a) Pause watchdog while the CPU is halted by the debugger.  b) Keep the watchdog running while the CPU is sleeping.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It is used in &lt;a href="https://github.com/NordicPlayground/nrf51-watchdog-resetreas-example/tree/master/watchdog_simple_with_interrupt" target="_blank" rel="noopener noreferrer"&gt;this project&lt;/a&gt; from github.&lt;/p&gt;
&lt;p&gt;I know it is made for the nRF51, but it should still be relevant for the WDT.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Perhaps it would be more interresting to find out why the button does not wake up the device. I suggest you create a new case with the corresponding subject. Then describe the problem there, and also describe how you have set up the wakeup button.&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog problem</title><link>https://devzone.nordicsemi.com/thread/125021?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 14:08:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:552ad00b-3b22-4e49-a749-24a20be3bc3f</guid><dc:creator>JB21</dc:creator><description>&lt;p&gt;Yes I do.&lt;/p&gt;
&lt;p&gt;I assumed the 3 seconds are&amp;nbsp;realtime, only that it would not trigger during sleep periods. Now I realize that it just doesn&amp;#39;t tick.&lt;/p&gt;
&lt;p&gt;The watchdog is my last hope in desperation, because my system scans for advertisements briefly every few seconds, and also responds&amp;nbsp;to a button press using&amp;nbsp;&amp;nbsp;bsp_event_handler.&amp;nbsp;&amp;nbsp;Occasionly after a few hours the button press is not detected anymore, and scanning stopped. I have no idea why. If it was simply asleep the button-press would wake it up, but it does not in this case. The button handler simply calls sd_nvic_SystemReset(). So I would be happy if I could get a reset behavior in this problematic case, and user experience will remain the same.&lt;/p&gt;
&lt;p&gt;Not sure if a watchdog would really help in my case. I can&amp;#39;t let it run during sleep, because it would then wake it up during deep-sleep that is entered several hours after idleing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog problem</title><link>https://devzone.nordicsemi.com/thread/124998?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 13:27:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ce25932-5711-4ce5-b55a-9b8e44bfd5a8</guid><dc:creator>Anders Westrup</dc:creator><description>&lt;p&gt;Do you enter sleep in your main loop (with sd_app_evt_wait() or similar?&lt;/p&gt;
&lt;p&gt;The watchdog counter will not tick when system is in sleep, since you use NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT. In this case it will take a very long time to get 3 seconds cpu time on an idle system.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>