<?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 timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/266/watchdog-timer</link><description>Is there an app-note, tutorial, or example of how to use the watchdog timer to reset the MCU if the application hangs?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Dec 2014 13:09:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/266/watchdog-timer" /><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1448?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2014 13:09:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7602485a-a18f-42b9-b1e5-27526c7f33a7</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;There are watchdog examples &lt;a href="https://github.com/NordicSemiconductor/nrf51-watchdog-resetreas-example"&gt;here&lt;/a&gt; for the nRF51&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1432?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 16:10:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a77bd011-4178-4ca7-8d3a-1e77e4935256</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;Being new at this...
We&amp;#39;re attempting to use the WDT w/ nrf_wait_for_app_event to pause execution of loop.&lt;/p&gt;
&lt;p&gt;Is there a better mechanism to let the CPU/PPI power relax &amp;amp; time the loop? What is it? Examples?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1433?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 16:10:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccd8bbc0-f947-476d-ae5b-6785775a1fec</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;Being new at this...
We&amp;#39;re attempting to use the WDT w/ nrf_wait_for_app_event to pause execution of loop.&lt;/p&gt;
&lt;p&gt;Is there a better mechanism to let the CPU/PPI power relax &amp;amp; time the loop? What is it? Examples?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1445?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2013 23:00:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38bb1d11-5af4-4166-bdec-ae22eafaa022</guid><dc:creator>Gil dePaula</dc:creator><description>&lt;p&gt;Another update:
It is going to the WDT_IRQHandler() ISR as intended.  I couldn&amp;#39;t tell earlier because it&amp;#39;s only there for 2 clock cycles (of the 32 kHz clock - 60 us) before it finally resets.
So, it works!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1446?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 16:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d98afb18-5943-4396-bad1-127f17d6b05a</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;An update:
It now resets.  I&amp;#39;m going into sleep mode, so I had to change WDT_CONFIG_SLEEP_Pause to WDT_CONFIG_SLEEP_Run.&lt;/p&gt;
&lt;p&gt;But it still does not go to the WDT_IRQHandler() ISR.  So I&amp;#39;m guessing the problem is in the INTENSET and NVIC instructions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1444?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 16:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed28fb45-b8f7-4ae7-a662-3c3cb34598e7</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;An update:
It now resets.  I&amp;#39;m going into sleep mode, so I had to change WDT_CONFIG_SLEEP_Pause to WDT_CONFIG_SLEEP_Run.&lt;/p&gt;
&lt;p&gt;But it still does not go to the WDT_IRQHandler() ISR.  So I&amp;#39;m guessing the problem is in the INTENSET and NVIC instructions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1443?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 15:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:067f29e1-a9e4-4146-a15b-ef37efdc1ae6</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;Thank you Sébastien,
Unfortunately it still does not work.  I tried it with this:
NVIC_SetPriority(WDT_IRQn, APP_IRQ_PRIORITY_LOW);
Regards,
Gil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1447?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 15:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fae09b6-9b2b-402e-91b2-1c409aaf0ae3</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;Thank you Sébastien,
Unfortunately it still does not work.  I tried it with this:
NVIC_SetPriority(WDT_IRQn, APP_IRQ_PRIORITY_LOW);
Regards,
Gil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1442?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 15:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a41843d0-6faf-4e36-9621-2f44ae16f1ba</guid><dc:creator>S&amp;#233;bastien Despont</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you are using the soft device, you cannot set the priority level as high which is reserved in this case. Try to set it to low priority.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1441?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 14:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e6bb659-b55d-41f1-a47f-48248d06203d</guid><dc:creator>Gil DePaula</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;I tried the code below, but it doesn&amp;#39;t work.  It does not go to the handler, and it doesn&amp;#39;t reset either.  I closed the debugger and did a power cycle as required.  In the handler, all I do is turn the LED on (LED function works with a button press, for example).  I&amp;#39;m not reloading it anywhere yet either.  What am I doing wrong?&lt;/p&gt;
&lt;p&gt;void watchdog_init(void)
{
NRF_WDT-&amp;gt;CONFIG = (WDT_CONFIG_HALT_Pause &amp;lt;&amp;lt; WDT_CONFIG_HALT_Pos) | (WDT_CONFIG_SLEEP_Pause &amp;lt;&amp;lt; WDT_CONFIG_SLEEP_Pos);&lt;/p&gt;
&lt;p&gt;NRF_WDT-&amp;gt;CRV = (32768 * 1);   // Timeout period of 1 s&lt;/p&gt;
&lt;p&gt;NRF_WDT-&amp;gt;RREN |= WDT_RREN_RR0_Msk;  //Enable reload register 0&lt;/p&gt;
&lt;p&gt;NRF_WDT-&amp;gt;INTENSET = WDT_INTENSET_TIMEOUT_Msk;&lt;/p&gt;
&lt;p&gt;NVIC_ClearPendingIRQ(WDT_IRQn);
NVIC_SetPriority(WDT_IRQn, APP_IRQ_PRIORITY_HIGH);
NVIC_EnableIRQ(WDT_IRQn);&lt;/p&gt;
&lt;p&gt;NRF_WDT-&amp;gt;TASKS_START = 1;   // Watchdog start
}&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;Gil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1440?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 07:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b5469a1-3c60-4cd7-beb5-e148db64327e</guid><dc:creator>Hans-Christian Otto</dc:creator><description>&lt;p&gt;Ah now it works, the problem was: At the beginning I set the 3V_enable_switch to on. After the WDT reset+pull down the 3V_enable_switch the uC reset very fast and have enough power to reach the row with the 3V_enable_switch command.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1439?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 07:40:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b268971e-cbf8-40da-abcb-2b828ec8525e</guid><dc:creator>Hans-Christian Otto</dc:creator><description>&lt;p&gt;Sorry but this doesnt work, too. I use this steps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lfclk_config(); CRV = (32768) - 1;
NRF_WDT-&amp;gt;RREN = (WDT_RREN_RR0_Enabled INTENSET = 1;
NVIC_EnableIRQ(WDT_IRQn);
NVIC_SetPriority(WDT_IRQn,0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in the ISR I pull down the enable pin from my 3V LDO to power off the uC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1438?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 06:56:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c5630d7-52f8-446a-8455-bae01b14b608</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;This would probably have been better as a separate question. :-)&lt;/p&gt;
&lt;p&gt;A quick guess is however that you haven&amp;#39;t done a pin reset after enabling the watchdog. The watchdog doesn&amp;#39;t run as long as the debugger is enabled, and the debug interface stays enabled till a power-cycle or a pin-reset (which can be done with for example nrfjprog -p).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1437?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2013 06:53:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e9bd749-ac2f-4712-914a-c65ab6ae851c</guid><dc:creator>Hans-Christian Otto</dc:creator><description>&lt;p&gt;The watchdog timer doesnt work on my nrf51822! I set the timer and started as in the example just like that but thje system doesnt reset or do a interrupt (for ISR i enable the interrupt).&lt;/p&gt;
&lt;p&gt;I also use the RTC for a simple timer in my system and use as source the RC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1436?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2013 12:05:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c647a9b5-c288-46fe-964e-77fccaf3bc93</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If you want to use the watchdog interrupt, this is used like any other interrupt, you enable the event to generate an interrupt in the peripheral&amp;#39;s INTEN register, and then enable the interrupt in the NVIC.&lt;/p&gt;
&lt;p&gt;As you can see in section 19.1.3 of the reference manual, this will give you 2 32.768 kHz clock cycles to do your logging and stack tracing. On reset, you can use the RESETREAS register to know the cause of the reset.&lt;/p&gt;
&lt;p&gt;The name of all interrupts are most easy to find in the startup file, and as you can see there, the watchdog interrupt handler will by default be WDT_IRQHandler. There are no utilities available to do stack tracing, but you can take a look at the ble_debug_assert_handler() function, which does similar things.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1435?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2013 13:56:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38aa26e9-9c76-449c-9458-c8fd23308639</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;The attached file does show some of the basics but not much. I took a look at nrf51.h where the data structures are defined and the comments are pretty terse there too. I want to make sure I use this timer correctly in the context of a device that sleeps, wakes on one of a number of interrupt signals, does some processing, and goes back to sleep. Should the processing hang, I&amp;#39;d like the watchdog to interrupt the MCU, for the watchdog handler to log a message and a stack trace to flash, and then do a reset. I would expect that everyone would want to do this for production code and I&amp;#39;m surprised I couldn&amp;#39;t find an example or at least more documentation.&lt;/p&gt;
&lt;p&gt;For example, what is the name of the watchdog interrupt handler and what utilities exist to log a stack trace?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: watchdog timer</title><link>https://devzone.nordicsemi.com/thread/1434?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2013 09:31:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66ce44d7-3bb8-4937-ac29-49c2897713bf</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Please take a look at the main-file that should show the basics.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3644.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>