<?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 and DFU mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99639/watchdog-timer-and-dfu-mode</link><description>Hi, We have an application created with SDK17 and softdevice s140. We are using the watchdog timer with a timeout of 10 minutes: 
 
 This works fine, but as soon as we enter DFU mode, the system is reset after about 2 seconds, while the DFU mode is still</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 May 2023 12:45:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99639/watchdog-timer-and-dfu-mode" /><item><title>RE: Watchdog timer and DFU mode</title><link>https://devzone.nordicsemi.com/thread/426570?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 12:45:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12366b10-4016-40fc-b069-62dbeb52a12c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Is it possible to upload an application (including bootloader) that can replicate what you are seeing on a DK? This would help reducing the amount of time it takes to reproduce what you are seeing, and look into issues/solutions for this problem.&lt;/p&gt;
&lt;p&gt;Best regards,&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 timer and DFU mode</title><link>https://devzone.nordicsemi.com/thread/426423?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 06:27:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6866b8d3-bb1d-4127-96ce-2b708a2ed061</guid><dc:creator>BvdP4Celsius</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;No, in the application we use one timeout value only. However, during testing we tried different values to see the differences.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog timer and DFU mode</title><link>https://devzone.nordicsemi.com/thread/426006?ContentTypeID=1</link><pubDate>Tue, 16 May 2023 23:24:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80b863f5-d3a6-4a6d-9d7b-a4e4230cefaf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. Due to low staffing because of public holidays in Norway, we expect some more delays in our response.&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t get time to test this today. The WDT can&amp;#39;t be changed without a proper reset (probably a power cycle. I don&amp;#39;t remember the details). Were you trying to use different watchdog timeouts in the application and the bootloader, or was it the same?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&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 timer and DFU mode</title><link>https://devzone.nordicsemi.com/thread/425548?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 09:54:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de0b2e13-9222-4d71-9b70-1a4a8f23ae0e</guid><dc:creator>BvdP4Celsius</dc:creator><description>&lt;p&gt;Hi Edvin&lt;br /&gt;Thanks for your reply.&lt;br /&gt;The first step I took was to be sure to fill in the right value for the WD reload. In the spec&amp;#39;s I read:&amp;nbsp;&amp;nbsp;&lt;br /&gt;timeout [s] = ( CRV + 1 ) / 32768.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void init_watchdog(void)
{
#if defined(WATCHDOG) &amp;amp;&amp;amp; (WATCHDOG)
    // Initialize the watchdog
    nrfx_wdt_config_t config = NRFX_WDT_DEAFULT_CONFIG;   
    APP_ERROR_CHECK( nrfx_wdt_init(&amp;amp;config, wdt_event_handler) );
    APP_ERROR_CHECK( nrfx_wdt_channel_alloc(&amp;amp;_watchdog_channel_id) );
    nrfx_wdt_enable();
    watchdog_mask = WDOG_IS_RUNNING;
#endif
}&lt;/pre&gt;&lt;br /&gt;In NRFX_WDT_DEAFULT_CONFIG macro,&amp;nbsp; there is .reload_value&amp;nbsp; = NRFX_WDT_CONFIG_RELOAD_VALUE&lt;br /&gt;&lt;span style="font-family:inherit;"&gt;When setting&amp;nbsp;NRFX_WDT_CONFIG_RELOAD_VALUE =&amp;nbsp;6553, I see a timeout of about 6 second.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;From nrf_wdt_reload_value_get() (in the main application) I got reload value = 214728, resulting in 6,5 seconds timeout.&lt;br /&gt;So for some reason it looks like the&amp;nbsp;&lt;span&gt;NRFX_WDT_CONFIG_RELOAD_VALUE&amp;nbsp;is in msec, not timerticks in my application?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Keeping this as it is (6.5 sec), the DFU seems to work and also the watchdog will reset the application when in an infinite loop.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I think one of the problems was/is that the wdog timer can not be re-initialized after a soft reset, like re-starting the application&amp;nbsp;in Segger Studio. So testing the different values can only be done after a pin-reset of power down.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog timer and DFU mode</title><link>https://devzone.nordicsemi.com/thread/425144?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 14:08:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a78e40ae-442b-4393-8aa6-4d885e0e2097</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you please check in your bootloader (you probably need to use the debug bootloader project to be able to see the logs, or actually debug without optimizations enabled), and see what value the &lt;br /&gt;wdt_ticks = nrf_wdt_reload_value_get()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;gives.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that these ticks are given in 32kHz units. So 10 minutes should be 32768 * 60 * 10 =&amp;nbsp;19 660 800 = 0x012c0000&lt;/p&gt;
&lt;p&gt;If it is in fact 2 seconds, it will say 32768*2 = 65536 = 0x10000&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am not sure about your application, where you set 10*60000 = 600000. Are you actually seeing 10 minutes? I would expect it to be closer to 18 seconds.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>