<?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>WDT and Error Handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38926/wdt-and-error-handler</link><description>This ticket started as a mail thread so I add it here so no data are missing: 
 ============================================================================================================================ 
 Yes I based my code from this sample code so</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Nov 2018 13:28:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38926/wdt-and-error-handler" /><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/157307?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 13:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21406796-3eef-4b40-8414-2856b1cd294e</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;one more thing is that the callback is never triggered so I&amp;#39;m not sure if the reboot are related to a WDT timeout. Even so this software reset is only triggered when WDT are enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/157298?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 13:11:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:694991c5-cb0a-44c8-a129-6b95ac1c97bc</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;So I sent a question 2 months ago stating that feeding was not used. According to my investigation it behaved normally without kicking the dog. I assumed that this was handled in zephyr and basically because it is best handled in the OS. Adding feeding everywhere in custom code where you think you would have an issue does not make sense. The aim is not to change anything the the Zephyr and keeping it clean and more easy to maintain. I strongly recommend that you implement this for zephyr.&lt;/p&gt;
&lt;p&gt;I have to test this before we know if it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/157289?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 12:29:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3552d20-6fb6-437c-989b-049bd12c09c8</guid><dc:creator>angl</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="6656" url="~/f/nordic-q-a/38926/wdt-and-error-handler/156907"]My investigation reading the TRM and the sample code and also test the WDT it seems that feeding is not needed or part of the OS when the WDT function are enabled in Zephyr.[/quote]
&lt;p&gt;This is not true.&amp;nbsp;You definitely need to feed the watchdog after you enable it. Otherwise, it will reset your system. And you actually observe this:&lt;/p&gt;
[quote userid="6656" url="~/f/nordic-q-a/38926/wdt-and-error-handler/156907"]When my code runs it last for 2-4 hours and if during this time, if I hang a process for 5 seconds it will reboot. And this is expected behavior (I use 5 second timeout).[/quote]
&lt;p&gt;When you do not hang a process, your code runs but as you stated it:&lt;/p&gt;
[quote userid="6656" url="~/f/nordic-q-a/38926/wdt-and-error-handler/156907"]3. sleeps most of the time and just doing sporadic activity&amp;#39;s.[/quote]
&lt;p&gt;and since you use the&amp;nbsp;&lt;span&gt;WDT_OPT_PAUSE_IN_SLEEP option, the watchdog timer does&amp;nbsp;not count down during the CPU sleep periods. Therefore, the watchdog will not timeout after 5 seconds of the overall time, but after 5 seconds of the cumulated activity time of the CPU (this is the time when the watchdog is instructed to work in your configuration). And this is not only the time in which your application tasks are&amp;nbsp;executed but also&amp;nbsp;any interrupts that are handled in your system, scheduling etc.&lt;/span&gt;&lt;span&gt; Hence, what you&amp;nbsp;describe as a &amp;quot;sporadic reset&amp;quot; after 2-4 hours is actually the reset caused by the watchdog because it was not fed. You can confirm this by doing some indication in the watchdog handler, for instance by changing a pin state in this handler and monitoring of this pin with a logic analyzer (please note that the handler is&amp;nbsp;fired&amp;nbsp;only two cycles of the 32.768 kHz clock before the watchdog reset is done, so it is a very short time to do anything; if you for example turn a LED in the handler, you probably won&amp;#39;t be able to&amp;nbsp;notice&amp;nbsp;it is turning on because the reset will&amp;nbsp;shortly turn it off).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And the above is the answer to your question:&lt;/span&gt;&lt;/p&gt;
[quote userid="6656" url="~/f/nordic-q-a/38926/wdt-and-error-handler/156452"]So back to my OP question. Why do the system reboot within 2-4h?[/quote]
&lt;p&gt;What to do to prevent this reboots? Feed the watchdog. Where to do it? It highly depends on your application.&amp;nbsp;If you for instance have a task that mostly sleeps but will be woken up at least once per 5 seconds (or what you decide to configure the watchdog to) of the CPU activity time, it will be sufficient to place the feeding there. If the situation is more complicated and there is a possibility that only some event handler is executed&amp;nbsp;without involving the task for a longer time (still, the cumulated activity time of the CPU), you&amp;#39;ll need to add the feeding also in&amp;nbsp;this handler.&amp;nbsp;&lt;span&gt;The&amp;nbsp;key thing is to feed the watchdog only as a confirmation that the vital&amp;nbsp;parts of your application are executed as expected.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/157262?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 11:12:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b4b1923-01bd-49f0-9b93-842141c78744</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;You need to feed the Watchdog. Since you are only doing sporadic activities, you are sleeping most of the time, which means the Watchdog is halted. Since the watchdog only runs while the cpu is running it can take hours before it resets. The time it takes before it resets depends on how much time your application spends in &amp;quot;sleep&amp;quot;. If you had a cpu intensive application the watchdog would reset your device much sooner. I would recommend setting up a task to feed the watchdog every 4th second or something like that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156907?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 14:04:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7bdabb9-9585-4144-9595-7e05189e4e6e</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;1. yes&lt;/p&gt;
&lt;p&gt;2. no I do not and this information was proved in the OP.&lt;/p&gt;
&lt;p&gt;3. sleeps most of the time and just doing sporadic activity&amp;#39;s.&lt;/p&gt;
&lt;p&gt;My investigation reading the TRM and the sample code and also test the WDT it seems that feeding is not needed or part of the OS when the WDT function are enabled in Zephyr. When my code runs it last for 2-4 hours and if during this time, if I hang a process for 5 seconds it will reboot. And this is expected behavior (I use 5 second timeout). If there was any issue with feeding it would reset within 5 seconds?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156898?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 13:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46c6bfc5-68db-41a5-8ab4-5d9232ba53d6</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was asked to take a look at this thread as Håkon is out of office for some time. It&amp;#39;s a bit hard to follow, so can you please confirm:&lt;/p&gt;
&lt;p&gt;1. You have enabled the watchdog. And configured it to WDT_OPT_PAUSE_IN_SLEEP. So it should not run while the cpu sleeps.&lt;/p&gt;
&lt;p&gt;2. You are not feeding it?&lt;/p&gt;
&lt;p&gt;3. This leads to sporadic resets (i.e. resets after 1-3hours when the application does nothing) ?&lt;/p&gt;
&lt;p&gt;If you enable the watchdog but do not feed it, it will eventually reset the device. When the reset happens depends on your configuration. If you configured it to pause while the CPU is sleeping it will still run while the zephyr os runs in the background at a higher interrupt level. So your application will be asleep (no running tasks), but the watchdog will run while the OS operations run. So the varying reset time will depend on how much activity you have in the os, even if your applications does nothing. Because of this you need to setup a recurring task that feeds the watchdog before it times out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156883?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 13:03:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5173d72d-560e-4c75-86e5-c40f5edeb3fd</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;I can but please do the verification on your end. I have no time to test your platform.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156882?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 13:01:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c0eecfc-b88d-4f77-b965-8daea3ab0f17</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;Can you&amp;nbsp; try the following patch? This will try to reduce the latency of Watchdog interrupts&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/drivers/watchdog/wdt_nrfx.c b/drivers/watchdog/wdt_nrfx.c
index 4297789c6a..2200441ae7 100644
--- a/drivers/watchdog/wdt_nrfx.c
+++ b/drivers/watchdog/wdt_nrfx.c
@@ -197,7 +197,7 @@ static int init_wdt(struct device *dev)
                return -EBUSY;
        }

-       IRQ_CONNECT(CONFIG_WDT_NRF_IRQ, CONFIG_WDT_NRF_IRQ_PRI,
+       IRQ_DIRECT_CONNECT(CONFIG_WDT_NRF_IRQ, 0,
                    nrfx_isr, nrfx_wdt_irq_handler, 0);
        irq_enable(CONFIG_WDT_NRF_IRQ);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156462?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 10:24:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a36aeedb-597f-4453-b224-e1a688b9b650</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;I did, 3 weeks ago.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156456?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 10:09:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fddd74f-80fc-4d90-8a86-3e628fa7aca5</guid><dc:creator>Carles</dc:creator><description>[quote userid="24487" url="~/f/nordic-q-a/38926/wdt-and-error-handler/156378"]So please try to setup watchdog with this option. If the problem will occurs after this change we try to prepare simple example together (extraction of affected code, based on zephyr and next one based on nrfx project to exclude influence of the zephyr RTOS) and&amp;nbsp;pass it to Nordic engineers to look deply in peripheral&amp;#39;s and CPU behaviour.[/quote]
&lt;p&gt;jlz, please follow the advice above&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156452?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 09:42:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a15e4eae-83ca-4628-ad80-273bd20c6b00</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;I do not use wdt_setup(system_wdt_dev, 0) I use wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP).&lt;/p&gt;
&lt;p&gt;see commit :&lt;/p&gt;
&lt;p&gt;Even if I was clear how the configuration works you still want me to experiment with something that do not make sense. So I did test your suggestion and it fails because of my explanation above. The bit configuration are bitmask so the drivers knows what to configure. Bit 0 controls the sleep wdt and it should be set to 0. And this are done with wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP). With your experiment it does not set anything (bit mask set 0 -&amp;gt; setting nothing). This means that wdt for sleep will be set too 1 (default configuration) so we will reboot every-time we going to sleep.&lt;/p&gt;
&lt;p&gt;So back to my OP question. Why do the system reboot within 2-4h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156447?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 09:28:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d09c2ae-c148-4fcc-8471-7e1f41ee6c52</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;I just read the thread again because I reference on older comments but they are gone. Have you deleted my old comments?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156444?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 09:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7be94021-33a4-4a67-aef8-e2f32557c6d3</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;I see the issue here, some else have comment on this related to the last comment from me that was a request to change my code to something I already now will fail (explained above). I do not use this and was a request to show the code snippet on a change that Nordic (hakan) wanted to change that was wrong in my mind. &lt;/p&gt;
&lt;p&gt;I use wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP) and have done this for all of my test.&lt;/p&gt;
&lt;p&gt;I only see one way forward and that is Nordic test the WDT in Zephyr and comeback when it is veryfied that it works and if so provide the solution for this.&lt;/p&gt;
&lt;p&gt;Here is some more info that was not part of the code snippet:&lt;/p&gt;
&lt;p&gt;#define SYSTEM_WDT_WINDOW_MAX 5000 // ms&lt;br /&gt;#define SYSTEM_WDT_WINDOW_MIN 0&amp;nbsp;&amp;nbsp;&amp;nbsp; // ms&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156378?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 18:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f8ef616-e7cb-46e6-8d8b-b56a01a36554</guid><dc:creator>kl-cruz</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Your code looks good.&lt;/p&gt;
&lt;p&gt;You set correct reset SOC flag - nRFs support only this mode.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;wdt_config.flags = WDT_FLAG_RESET_SOC;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You set window.max value, I assume that your min value (SYSTEM_WDT_WINDOW_MIN) is zero. nRF hardware support basic situation when feed window is constant (starts at time 0 and expire in future - max).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;wdt_config.window.min = SYSTEM_WDT_WINDOW_MIN;
wdt_config.window.max = SYSTEM_WDT_WINDOW_MAX;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Callback is nice feature, but you have to be sure that you are doing things very quickly. You have two 32kHz cycles (&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fwdt.html&amp;amp;cp=2_1_0_39_2&amp;amp;anchor=concept_b4n_xzw_sr"&gt;http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fwdt.html&amp;amp;cp=2_1_0_39_2&amp;amp;anchor=concept_b4n_xzw_sr&lt;/a&gt;). The code is executing with 64MHz frequency (I assume situation without jumps/branches with flash wait states equals zero, clocks are synchronized - lucky we) so 1953 full CPU cycles, but in real situation less.&lt;/p&gt;
&lt;p&gt;You are calling setup function with 0 flag. In this case watchdog is kept running while the CPU is sleeping and is kept running when debugger is attached.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (wdt_setup(system_wdt_dev, 0) &amp;lt; 0) {&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It is the place where I can see (eventually) potential problem. Maybe when watchdog is still running you miss the feed window in one/two/four hours. I can&amp;#39;t confirm that. I just assume. You can connect logic analyzer to your GPIOs and try to trace situations (measure feed time etc) to check this.&lt;/p&gt;
&lt;p&gt;You can configure to pause watchdog while cpu is sleeping using flag previously recommended by Hakon. It is WDT_OPT_PAUSE_IN_SLEEP which set 1 at position zero. Watchdog driver checks if there is one at this position and&amp;nbsp;set correct behaviour of the peripheral:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/watchdog/wdt_nrfx.c#L42"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/watchdog/wdt_nrfx.c#L42&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please try options when watchdog is paused when CPU is sleeping:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I tried to find any errata entries about watchdog. There are two MCUs affected by WDT problems with increasing current consumption, but threre is no information about unexpected resets.&lt;/p&gt;
&lt;p&gt;So please try to setup watchdog with this option. If the problem will occurs after this change we try to prepare simple example together (extraction of affected code, based on zephyr and next one based on nrfx project to exclude influence of the zephyr RTOS) and&amp;nbsp;pass it to Nordic engineers to look deply in peripheral&amp;#39;s and CPU behaviour.&lt;/p&gt;
&lt;p&gt;Please tell me about your observations afterall. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156322?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 13:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15e037be-21e1-4410-9e67-07253bb21743</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;requested code snippet:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; system_wdt_dev = device_get_binding(CONFIG_WDT_0_NAME);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Reset SoC when watchdog timer expires.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdt_config.flags = WDT_FLAG_RESET_SOC;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Expire watchdog after x milliseconds.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdt_config.window.min = SYSTEM_WDT_WINDOW_MIN;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdt_config.window.max = SYSTEM_WDT_WINDOW_MAX;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set up watchdog callback. Jump into it when watchdog expired.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdt_config.callback = system_wdt_callback;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdt_channel_id = wdt_install_timeout(system_wdt_dev, &amp;amp;wdt_config);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (wdt_channel_id &amp;lt; 0) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1; // **** ERROR ****&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (wdt_setup(system_wdt_dev, 0) &amp;lt; 0) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1; // **** ERROR ****&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0; // **** OK ****&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156321?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 13:21:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8642e95d-8597-4192-ae26-b3fa8e55cebe</guid><dc:creator>Carles</dc:creator><description>&lt;p&gt;Can you please post a code snippet with the code you have tried?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156286?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 11:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8ae7c59-a7fb-4213-b103-24468e2f5104</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;Even if I was clear how the configuration works you still want me to experiment with something that do not make sense. So I did test your suggestion and it fails because of my explanation above. The bit configuration are bitmask so the drivers knows what to configure. Bit 0 controls the sleep wdt and it should be set to 0. And this are done with wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP). With your experiment it does not set anything (bit mask set 0 -&amp;gt; setting nothing). This means that wdt for sleep will be set too 1 (default configuration) so we will reboot every-time we going to sleep.&lt;/p&gt;
&lt;p&gt;So back to my OP question. Why do the system reboot within 2-4h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156100?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 09:47:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72a9cecf-106c-481f-9dff-f1ffe8f203f4</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/master/include/misc/util.h"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/master/include/misc/util.h&lt;/a&gt;. Look up the definition of BIT(). And then look at this &lt;a href="https://www.wolframalpha.com/input/?i=1+%3C%3C+0"&gt;www.wolframalpha.com/.../&lt;/a&gt;. Then maybe it will be more apparent that BIT(0) and 0 is not the same. I will see if I have time to reproduce your issue later, but I&amp;#39;m a little busy right now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156095?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 09:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb9ffbb5-160e-42eb-a652-ed9ca15fa652</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;its a mask bit so it will write 0. Can you please test this yourself and see if it working. Note that it will take 2-4 hours to trigger this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156094?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 09:21:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5eb9e8df-02d8-4942-a04e-2508fd52f432</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Because it&amp;#39;s not 0. It&amp;#39;s BIT(0), i.e. 1. So calling wdt_setup(system_wdt_dev, 0) is not the same as calling wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156093?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 09:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8edc3f15-e031-41a3-84b9-2f9aaae2e18a</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;yes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156091?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 09:14:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eeee05e-5346-4694-9d6c-55fe3c8871c3</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Are you referring to this?&lt;/p&gt;
&lt;p&gt;#&lt;span&gt;define&lt;/span&gt; &lt;span&gt;WDT_OPT_PAUSE_IN_SLEEP&lt;/span&gt; &lt;span&gt;BIT&lt;/span&gt;(&lt;span&gt;0&lt;/span&gt;)&lt;/p&gt;
&lt;p&gt;in &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/master/include/watchdog.h"&gt;github.com/.../watchdog.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/156020?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 16:19:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76cdf501-7a8e-4169-9a46-4989929770ec</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;Yes I do, WDT_OPT_PAUSE_IN_SLEEP = 0. Can you please check this issue!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/155980?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 14:03:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a1bc46c-67b3-4f03-87f8-85ef280b8a45</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Have you tried to call wdt_setup() like this instead?&lt;/p&gt;
&lt;p&gt;wdt_setup(system_wdt_dev, 0)&lt;/p&gt;
&lt;p&gt;This should keep the watchdog from pausing in sleep mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT and Error Handler</title><link>https://devzone.nordicsemi.com/thread/155385?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 15:08:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78353f80-360e-490b-a63d-99a0bae94602</guid><dc:creator>jlz</dc:creator><description>&lt;p&gt;So I have tested this and it does not work. First is that I uses this setting in the code (basically had this from the beginning):&lt;/p&gt;
&lt;p&gt;wdt_setup(system_wdt_dev, WDT_OPT_PAUSE_IN_SLEEP) &lt;br /&gt;&lt;br /&gt;I when change the code to run this every time before enter sleep but it still do not work.&lt;br /&gt;&lt;br /&gt;Random reboot ones within 2-3h&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>