<?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>Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97784/issue-when-application-that-uses-task-wdt-gets-a-fota-with-an-application-that-uses-simple-wdt</link><description>Dear All, Currently I am developing an application that is using the TASK WDT, using nRF COnnect SDK v2.1.0. The application itself works fine. When I tried to do a FOTA, even though the task WDT related to the FOTA operation was treated in time, I was</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Mar 2023 15:17:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97784/issue-when-application-that-uses-task-wdt-gets-a-fota-with-an-application-that-uses-simple-wdt" /><item><title>RE: Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/thread/416074?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 15:17:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48d646d6-bfcf-4100-a8e5-02288c0bcf54</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In principle, yes. Except if you are able to confirm your new firmware before the 10 seconds timeout, and then let the WDT timeout. If that is possible, your new application would start and the WDT will not be enabled, so that it can be configured as you please. This approach may not be possible or desirable, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/thread/415808?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 17:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fab5068-a3fb-45f6-8df2-fca0e9c277bc</guid><dc:creator>Giannis Anastasopoulos</dc:creator><description>&lt;p&gt;Based on a test that I just did, it seems that the HW watchdog is configured from the application that is running the Task WDT to expire at 10s. In the app that I am trying to FOTA, if I feed the WDT in less than 10s then the application does not reset.&lt;br /&gt;&lt;br /&gt;So based on that result, it seems that due to the fact that the watchdog is set from the first application to expire in 10s and since the WDT cannot be stopped due to system reset, the WDT is running with the old configuration even though I am setting it up again using the &lt;pre class="ui-code" data-mode="text"&gt;wdt_install_timeout(wdt, &amp;amp;wdt_config); &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This means that the only way that my settings will ever have impact is if the device was reset by the reset pin or powercycled, in which case the device would revert back to the old firmware though, since the new firmware is not yet confirmed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/thread/415804?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 16:49:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c2cb77-188c-48f5-9dad-5bc67a592d50</guid><dc:creator>Giannis Anastasopoulos</dc:creator><description>&lt;p&gt;In an attempt to rule out the possibility of a channel different than the first one being used in the initial application, in the FOTA application I am doing this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;    int wdt_channel_id = 0;
    while (wdt_channel_id &amp;gt;= 0) {
        max_wdt_channel_id = wdt_channel_id;
        wdt_channel_id = wdt_install_timeout(wdt, &amp;amp;wdt_config);
        LOG_INF(&amp;quot;WDT Channel %d set&amp;quot;, wdt_channel_id);
    }
    LOG_INF(&amp;quot;MAX channel ID: %d&amp;quot;, max_wdt_channel_id);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And I feed all the channels like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;    for(int i = 0; i &amp;lt;= max_wdt_channel_id; i++){
        LOG_INF(&amp;quot;Feeding watchdog, channel: %d&amp;quot;, i);
        wdt_feed(wdt, i);
    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But my device still resets due to DOG reset&lt;pre class="ui-code" data-mode="text"&gt;18:38:03.090 -&amp;gt; *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
18:38:03.136 -&amp;gt; [00:00:00.240,051] &#x1B;[0m&amp;lt;inf&amp;gt; IMS: IMS dispatch thread active&#x1B;[0m
18:38:03.136 -&amp;gt; [00:00:00.251,159] &#x1B;[0m&amp;lt;inf&amp;gt; fs_nvs: 3 Sectors of 4096 bytes&#x1B;[0m
18:38:03.136 -&amp;gt; [00:00:00.251,190] &#x1B;[0m&amp;lt;inf&amp;gt; fs_nvs: alloc wra: 2, 5c0&#x1B;[0m
18:38:03.136 -&amp;gt; [00:00:00.251,190] &#x1B;[0m&amp;lt;inf&amp;gt; fs_nvs: data wra: 2, 514&#x1B;[0m
18:38:03.184 -&amp;gt; Reset caus[00:00:00.343,994] &#x1B;[0m&amp;lt;inf&amp;gt; DEVICE_SETTINGS: NVM now accepting new settings&#x1B;[0m
18:38:03.469 -&amp;gt; e(s):
18:38:03.469 -&amp;gt; 	SREQ
18:38:03.469 -&amp;gt; [00:00:00.354,461] &#x1B;[0m&amp;lt;inf&amp;gt; regular_reset: Handler active&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.354,858] &#x1B;[0m&amp;lt;inf&amp;gt; IMS_STATS: Stats listener active&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,041] &#x1B;[0m&amp;lt;inf&amp;gt; IMS_STATS: IMS Stats listener active&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,255] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 0 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,285] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 1 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,316] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 2 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,316] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 3 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,346] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 4 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,346] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 5 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,377] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 6 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,377] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel 7 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,407] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: WDT Channel -12 set&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,407] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: MAX channel ID: 7&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,438] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 0&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,438] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 1&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,468] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 2&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.355,468] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 3&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.457,611] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 4&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.457,641] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 5&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.457,672] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 6&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.457,702] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 7&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.457,916] &#x1B;[0m&amp;lt;inf&amp;gt; IMS_WS2812: Listener active&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,190] &#x1B;[0m&amp;lt;inf&amp;gt; IMS_BATT: Listener active&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,282] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 0&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,282] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 1&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,312] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 2&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,374] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 3&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,404] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 4&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,435] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 5&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,435] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 6&#x1B;[0m
18:38:03.469 -&amp;gt; [00:00:00.458,435] &#x1B;[0m&amp;lt;inf&amp;gt; WDT: Feeding watchdog, channel: 7&#x1B;[0m
... (not important device init)
18:38:14.319 -&amp;gt; ⸮*** Booting Zephyr OS build v3.1.99-ncs1  ***
18:38:14.549 -&amp;gt; I: Starting bootloader
18:38:14.596 -&amp;gt; I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x3
18:38:14.596 -&amp;gt; I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
18:38:14.596 -&amp;gt; I: Boot source: none
18:38:14.596 -&amp;gt; I: Swap type: revert
18:38:15.298 -&amp;gt; I: Starting swap using move algorithm.
18:38:15.298 -&amp;gt; I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
18:38:55.727 -&amp;gt; I: Bootloader chainload address offset: 0x10000
18:38:55.727 -&amp;gt; I: Jumping to the first image slot
[00:00:00.457,183] &#x1B;[0m&amp;lt;inf&amp;gt; spi_nor: W25Q16JV: SFDP v 1.5 AP ff with 1 PH&#x1B;[0m
18:38:56.522 -&amp;gt; [00:00:00.457,214] &#x1B;[0m&amp;lt;inf&amp;gt; spi_nor: PH0: ff00 rev 1.5: 16 DW @ 80&#x1B;[0m
18:38:56.522 -&amp;gt; *** Booting Zephyr OS build v3.1.99-ncs1  ***
18:38:56.522 -&amp;gt; [00:00:00.471,466] &#x1B;[0m&amp;lt;inf&amp;gt; spi_nor: W25Q16JV: 2 MiBy flash&#x1B;[0m
18:38:56.522 -&amp;gt; [00:00:00.475,799] &#x1B;[0m&amp;lt;inf&amp;gt; mcuboot_util: Swap type: none&#x1B;[0m

18:38:56.522 -&amp;gt; 

18:38:56.522 -&amp;gt; Reset cause(s):
18:38:56.522 -&amp;gt; 	DOG
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see I am feeding all the HW channels right at boot up, but the device is still resetting after a few seconds. And the reset reason is DOG and there is no hardfault there&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/thread/415775?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 15:19:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9470fcc6-6941-4992-bb0d-73e33376065e</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Giannis Anastasopoulos"]What I am trying to do is update the device with an application that is using the standard HW WDT alone.[/quote]
&lt;p&gt;Ah, I see. I misunderstood the situation. The fundamentals remain the same, though.&lt;/p&gt;
[quote user="Giannis Anastasopoulos"]What I am doing in the new application is to simply feed the WDT as the first thing in the main.[/quote]
&lt;p&gt;That should normally be good enough. What is the reload-value of the WDT (the old configuration is the relevant here, as that is what is being used)? That will let us know how much time you have.&lt;/p&gt;
&lt;p&gt;Also, is there by any change more than one channel enabled?&lt;/p&gt;
&lt;p&gt;If we know these two things, then we know what you need to do in the new application in order to continue to feed the watchdog.&lt;/p&gt;
&lt;p&gt;It would also be relevant to know if there are any other parts of the&amp;nbsp;system (typically bootlaoder(s))&amp;nbsp;that enables the WDT? If not, you would at least be able to re-configure it to suit your new needs after a WDT reset.&lt;/p&gt;
[quote user="Giannis Anastasopoulos"]Is there a way to reset or disable the watchdog on the original application with the TASK WDT, right before doing the reset to boot to the new application?[/quote]
&lt;p&gt;No. There is no support for disabling the Task WDT. And more importantly, you cannot disable the HW WDT (which you write is&amp;nbsp;enabled here as the fallback) in any other way than a reset of some sort which is not a soft reset or CPU lockup. The only way to disable it would be to trigger a reset of a form that disables it (like a WDT reset by not feeding it).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/thread/415759?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 14:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d1c9b2f-1423-406f-9a95-b87321c4ce55</guid><dc:creator>Giannis Anastasopoulos</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks a lot for your response. My issue is this:&lt;br /&gt;&lt;br /&gt;My original application is using the TASK WDT with the HW WDT enabled as a fallback.&lt;br /&gt;&lt;br /&gt;What I am trying to do is update the device with an application that is using the standard HW WDT alone.&lt;br /&gt;&lt;br /&gt;What I am doing in the new application is to simply feed the WDT as the first thing in the main.&lt;br /&gt;&lt;br /&gt;But this still does not seem to have an impact as the device resets and the reset reason is still DOG.&lt;/p&gt;
&lt;p&gt;Is there a way to reset or disable the watchdog on the original application with the TASK WDT, right before doing the reset to boot to the new application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue when application that uses TASK WDT gets a FOTA with an application that uses simple WDT</title><link>https://devzone.nordicsemi.com/thread/415722?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 13:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c54fe9e-4bfb-4cea-88ec-7dfeea6cccdd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/wdt.html"&gt;HW WDT&lt;/a&gt; is (deliberately) quite limited with regards to how it can be disabled. Once enabled, it will continue to run and the configuration cannot be changed, except after a reset of the WTD peripheral. And that is not reset during a normal soft reset (see &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/pmureset.html#reset_behaviour"&gt;Reset behavior&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;So if the currently running firmware (you have based on 1.6) is using the WDT, you will need to continue to feed it. As you are getting resets with DOG as reason in the RESETREAS, that means it has not been fed fast enough, timed out, and reset the device.&lt;/p&gt;
&lt;p&gt;The Task WDT has the&amp;nbsp;option of using a physical WDT as fall back, and so it also must feed it. So it could be that you can get away with just increasing the frequency of the WDT feeding in the Task WDT configuration. You adjust that with a combination of &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_TASK_WDT_MIN_TIMEOUT"&gt;CONFIG_TASK_WDT_MIN_TIMEOUT&lt;/a&gt;&amp;nbsp;and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_TASK_WDT_HW_FALLBACK_DELAY"&gt;CONFIG_TASK_WDT_HW_FALLBACK_DELAY&lt;/a&gt;. Alternatively, add some special handling to ensure it is feed often enough. But of course, make sure you don&amp;#39;t just feed it all the time regardless of the state of the device, as if you do, there will not be much point of the WDT.)&lt;/p&gt;
&lt;p&gt;As a side note, perhaps an alternative could be to keep using the physical WDT peripheral in the nRF and not the task WDT library at all? The WDT peripheral in the nRF has 8 channels, so you can monitor 8 tasks separately with that if you like (though again, you cannot change the configuration registers once it is started, so it may be difficult if you do not already use it like this in the existing firmware). Remember that the task WDT is a zephyr library, and if things go really haywire it may not be able to save you in the same way as a physical WDT timer can.&lt;/p&gt;
&lt;p&gt;Lastly, if you need to change the configuration of the HW WDT, it is possible to first upload via DFU some firmware that does not start it but lets it time out and reset (assuming you do not start it in for instance an immutable bootloader - if you do, it can never change). Then, after the WDT reset the WDT is not running, and if your firmware does not start it, well - it is not started, and you can configure it as you like or not use it at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>