<?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>Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs</link><description>Hello, 
 I am using nRF52833 based BE33 ( Celium Devices ) and using nRF52SDK17.0.2. I am trying to implement WDT and expecting to occur its event when the module becomes hang or any unexpected error occurred. I am purposely written the code where BLE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Apr 2022 09:41:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs" /><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/362792?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2022 09:41:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5d5027c-4bda-4a72-8244-3025455541bb</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="97666" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/359498#359498"]I have tried to call NVIC_SetPriority(WDT_IRQn, 0);&amp;nbsp;[/quote]
&lt;p&gt;Did you make sure to run this line after &amp;quot;softdevice enable&amp;quot;? Otherwise, the Softdevice will detect that you have assigned a reserved int priority and raise an assert.&lt;/p&gt;
&lt;p&gt;I can also try to debug this here if you are able to share a minimal version of your project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/362478?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 05:26:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fccca478-ff39-43b5-afd8-79cdab97ff54</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
&lt;p&gt;How to switch this in emergency mode? Or do you mean it is not possible?&lt;/p&gt;
[quote userid="97666" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/358610#358610"]if there is any error or stuck in execution and if WDT does not get the feed, there should be an event that occurs (can be used to set controller into emergency mode and transmits necessary data only to indicate something went wrong with sensor) and then reboot itself.[/quote]
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/362200?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 06:27:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c45d75a9-81eb-4e27-922c-cc163103c847</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The problem seems to be that your device doesn&amp;#39;t go into an endless loop once it&amp;#39;s done counting. If you see the default watchdog sample, after the LEDs are &amp;quot;done&amp;quot; turning on, the device goes to Idle mode, waiting for either the watchdog to be fed (by a button press) or for the watchdog to trig a reset.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you can add a printf() function to the WDT event handler as the max amount of time we can spend in a WDT interrupt is two clock cycles before the reset occurs, so once it is triggered, it won&amp;#39;t be able to print anything before the reset is done.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/361964?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 06:57:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db267dcb-4df1-49f4-ace5-e7cde41a6918</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/361957#361957"]after trying on my end, we can see that the &lt;strong&gt;wdt_event_handler()&lt;/strong&gt; you have is never called[/quote]
&lt;p&gt;Okay&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/361957#361957"]but if you set a breakpoint on I.E. line 62 of nrfx_wdt.c you can see that the watchdog is triggered when the watchdog times out[/quote]
&lt;p&gt;Okay, how can I make the below condition true to be able to call m_wdt_event_handler() function?&lt;/p&gt;
&lt;p&gt;if (nrf_wdt_event_check(NRF_WDT_EVENT_TIMEOUT))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_wdt_event_handler();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf_wdt_event_clear(NRF_WDT_EVENT_TIMEOUT);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;When I check the definition of NRF_WDT_EVENT_TIMEOUT I found below in nrf_wdt.h file.&lt;/p&gt;
&lt;p&gt;typedef enum&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_WDT_EVENT_TIMEOUT = offsetof(NRF_WDT_Type, EVENTS_TIMEOUT), /**&amp;lt; Event from WDT time-out. */&lt;br /&gt;} nrf_wdt_event_t;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/361957#361957"]But you can&amp;#39;t add printing here as it won&amp;#39;t be prioritized during a watchdog timeout.[/quote]
&lt;p&gt;Where I can do this below process?&lt;/p&gt;
[quote userid="97666" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/358610#358610"]here should be an event that occurs (can be used to set controller into emergency mode and transmits necessary data only to indicate something went wrong with sensor) and then reboot itself.[/quote]
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/361957?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 06:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5a600a4-4360-4f67-92d5-3eae79b39d9c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again Neeraj&lt;/p&gt;
&lt;p&gt;Okay, after trying on my end, we can see that the &lt;strong&gt;wdt_event_handler()&lt;/strong&gt; you have is never called, but if you set a breakpoint on I.E. line 62 of nrfx_wdt.c you can see that the watchdog is triggered when the watchdog times out. But you can&amp;#39;t add printing here as it won&amp;#39;t be prioritized during a watchdog timeout.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/361731?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2022 07:18:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63b9ed23-5c1a-4af0-a811-88a1ef684b38</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/361727#361727"]H&lt;span&gt;ave you added any logging to confirm that a wdt_event_handler event is happening or not?&lt;/span&gt;[/quote]
&lt;p&gt;I have tried to print the below line in the wdt_event_handler event function. You can find it in the attached example as well as my reply on &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/358432#358432"&gt;16 March 2022&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;printf(&amp;quot;wdt_event_handler&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/wdt.zip"&gt;devzone.nordicsemi.com/.../wdt.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/361727?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2022 07:10:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6410bb3a-0d44-459d-a628-415e84ac901c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s fine. Please do, and I&amp;#39;ll try to find out why the logging isn&amp;#39;t occurring. You never seemed to answer this question from a few replies ago: H&lt;span&gt;ave you added any logging to confirm that a wdt_event_handler event is happening or not? If you don&amp;#39;t print anything there, you won&amp;#39;t see it in your logging output either.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/361407?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2022 07:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec0d1c30-d765-48af-9c54-2d6811ee7faf</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/361169#361169"]Have you set the&amp;nbsp;&lt;strong&gt;NRFX_WDT_CONFIG_LOG_ENABLED&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;NRF_LOG_ENABLED&amp;nbsp;&lt;/strong&gt;configs to 1 in sdk_config.h?[/quote]
&lt;p&gt;Yes, &lt;strong&gt;NRFX_WDT_CONFIG_LOG_ENABLED &lt;/strong&gt;and&lt;strong&gt;&amp;nbsp;NRF_LOG_ENABLED&lt;/strong&gt; are set to 1. &lt;/p&gt;
&lt;p&gt;If you want, I can attach the source code folder here. Will that be ok?&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/361169?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 09:08:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af86bf5d-7cc0-44ed-bd48-8ec80533424f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you set the&amp;nbsp;&lt;strong&gt;NRFX_WDT_CONFIG_LOG_ENABLED&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;NRF_LOG_ENABLED&amp;nbsp;&lt;/strong&gt;configs to 1 in sdk_config.h?&lt;/p&gt;
&lt;p&gt;These are required to enable logging by default and to enable logging in the WDT module.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/360196?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 08:44:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b5d37c4-1eed-405f-bccf-2c54ff1f4181</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
&lt;p&gt;How to set logging to confirm this? I have already set below in sdk_config.h file.&lt;/p&gt;
&lt;p&gt;#define&amp;nbsp; DEBUG_NRF 1&lt;br /&gt;#define&amp;nbsp; DEBUG 1&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/360173?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 07:40:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d27e415-7a0e-4246-8eb6-fccc347f5ca9</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Well, it does seem like the application resets, have you added any logging to confirm that a wdt_event_handler event is happening or not? If you don&amp;#39;t print anything there, you won&amp;#39;t see it in your logging output either.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/359632?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 14:07:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48d775dd-f96d-4788-b454-d0a06a892fdb</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simanr,&lt;/p&gt;
&lt;p&gt;Currently, it is showing the below output:&lt;/p&gt;
&lt;p&gt;test&lt;/p&gt;
&lt;p&gt;hello 0&lt;br /&gt;&lt;br /&gt;hello 1&lt;br /&gt;&lt;br /&gt;hello 2&lt;br /&gt;&lt;br /&gt;hello 3&lt;br /&gt;&lt;br /&gt;hello 4&lt;br /&gt;&lt;br /&gt;hello 5&lt;br /&gt;&lt;br /&gt;hello 6&lt;br /&gt;&lt;br /&gt;hello 7&lt;br /&gt;&lt;br /&gt;hello 8&lt;br /&gt;&lt;br /&gt;hello 9&lt;br /&gt;&lt;br /&gt;hello 10&lt;br /&gt;&lt;br /&gt;hello 11&lt;br /&gt;&lt;br /&gt;hello 12&lt;br /&gt;&lt;br /&gt;hello 13&lt;br /&gt;&lt;br /&gt;hello 14&lt;br /&gt;&lt;br /&gt;hello 15&lt;br /&gt;&lt;br /&gt;hello 16&lt;br /&gt;&lt;br /&gt;hello 17&lt;br /&gt;&lt;br /&gt;hello 18&lt;br /&gt;&lt;br /&gt;hello 19&lt;br /&gt;&lt;br /&gt;hello 20&lt;br /&gt;&lt;br /&gt;hello 21&lt;br /&gt;&lt;br /&gt;hello 22&lt;br /&gt;&lt;br /&gt;hello 23&lt;br /&gt;&lt;br /&gt;hello 24&lt;br /&gt;&lt;br /&gt;hello 25&lt;br /&gt;&lt;br /&gt;hello 26&lt;br /&gt;&lt;br /&gt;hello 27&lt;br /&gt;&lt;br /&gt;hello 28&lt;br /&gt;&lt;br /&gt;hello 29&lt;br /&gt;test&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the end. I am expecting &amp;quot;wdt_event_handler&amp;quot; should get printed before &amp;quot;test&amp;quot; is printed&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/359519?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 08:19:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4729ca5b-cd3e-4982-9638-5d31e9dc9442</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Okay, then the watchdog isn&amp;#39;t triggered at all for some reason. Have you done any debugging to see what&amp;#39;s happening after these 30 seconds when you expect the Watchdog to trig?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/359498?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 07:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9b35837-7b8b-4342-b204-b60500c9b95e</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simanr,&lt;/p&gt;
&lt;p&gt;I have tried to call NVIC_SetPriority(WDT_IRQn, 0);&amp;nbsp; but it is still not executing the event handler function. Also, I have tried to set NRFX_WDT_CONFIG_IRQ_PRIORITY and WDT_CONFIG_IRQ_PRIORITY to 0. But same result.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/359153?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 13:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cb96dff-8ac6-4591-b4c2-605a99e82830</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I see, thank you for explaining. It could be that the WDT is getting blocked by another interrupt. The WDT driver uses the same interrupt priority as the other SDK drivers by default, so you can try setting the priority to 0 after enabling the SoftDevice to see if that helps.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NVIC_SetPriority(WDT_IRQn, 0); // The Softdevice will check if the app is using any of the reserved interrupt priorities during initialization so set the WDT IRQ priority after enabling the stack as a workaround&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/358610?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 11:17:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf74b4b2-45a8-4f04-90d0-57d3a7ef7348</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simanr,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/358573#358573"]Can you try to explain what you are trying to implement and what you expect is going to happen in your application? It still seems like you&amp;#39;re feeding the watchdog in your main loop&amp;nbsp;for 30 seconds and then do nothing afterwards.[/quote]
&lt;p&gt;We have already implemented the firmware with different kinds of sensors integrated. Consider a worst-case if there is an issue with I2C based sensor in between and then execution gets stuck, then further its BLE advertisement will also stop transmitting data until and unless someone physically checks it. We expect WDT should work in such a scenario. if there is any error or stuck in execution and if WDT does not get the feed, there should be an event that occurs (can be used to set controller into emergency mode and transmits necessary data only to indicate something went wrong with sensor) and then reboot itself.&lt;/p&gt;
&lt;p&gt;In above the last example I was trying to implement a similar scenario where we are feeding WDT for consecutive 30 seconds and after that considered something went wrong and WDT will not get the next feeds. Here I was expecting WDT wdt_event_handler() function should have executed and then it should reboot ( or we can write NVIC_SystemReset(); in the wdt_event_handler() at the end).&lt;/p&gt;
&lt;p&gt;But currently, In the above example, WDT is working and directly getting rebooted without executing wdt_event_handler().&lt;/p&gt;
&lt;p&gt;I hope you got my purpose of implementing WDT in my firmware.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/358573?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 09:29:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cd1c5b2-4611-4055-b263-d54a4cdda462</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The Watchdog is configured in the following snippet,&amp;nbsp;with the interrupt priority configured there as well, so it shouldn&amp;#39;t be necessary to do more there.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;NRF_WDT_EVENT_TIMEOUT is an event that occurs when the watchdog timer times out. I&amp;#39;m not sure what you mean by setting this? as it is already set in the nrfx_wdt.c driver and the nrf_bootloader_wdt.c library.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you try to explain what you are trying to implement and what you expect is going to happen in your application? It still seems like you&amp;#39;re feeding the watchdog in your main loop&amp;nbsp;for 30 seconds and then do nothing afterwards.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/358432?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 12:50:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef3224b1-4060-4205-8afc-4d8254807b6c</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simanr,&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/358383#358383"]Where have you implemented the Watchdog in your application[/quote]
&lt;p&gt;I am attaching modified code of WDT example code from SDK location /nRF5_SDK_17.0.2_d674dde/examples/peripheral/wdt&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;

#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_drv_wdt.h&amp;quot;
#include &amp;quot;nrf_drv_clock.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;

nrf_drv_wdt_channel_id m_channel_id;

/**
 * @brief WDT events handler.
 */
void wdt_event_handler(void)
{
   
printf(&amp;quot;wdt_event_handler&amp;quot;);

    //NOTE: The max amount of time we can spend in WDT interrupt is two cycles of 32768[Hz] clock - after that, reset occurs
}

static void log_init(void)
{
   ret_code_t err_code = NRF_LOG_INIT(NULL);
   APP_ERROR_CHECK(err_code);
   NRF_LOG_DEFAULT_BACKENDS_INIT();
}
/**
 * @brief Function for main application entry.
 */
 void feed(){
  nrf_drv_wdt_channel_feed(m_channel_id);
 }

 static void power_management_init(void)
{
   ret_code_t err_code;
   err_code = nrf_pwr_mgmt_init();
   APP_ERROR_CHECK(err_code);
}
static void idle_state_handle(void)
{
   UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
   nrf_pwr_mgmt_run();
}
int main(void)
{
    uint32_t err_code = NRF_SUCCESS;
log_init();

printf(&amp;quot;test&amp;quot;);

    //Configure WDT.
    nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;
    err_code = nrf_drv_wdt_init(&amp;amp;config, wdt_event_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_wdt_channel_alloc(&amp;amp;m_channel_id);
    APP_ERROR_CHECK(err_code);
    nrf_drv_wdt_enable();
int i=0;
  while(1){

        if(i&amp;lt;30){

        printf(&amp;quot;\nhello %d\n&amp;quot;,i);
          nrf_delay_ms(1000);
      feed();
      }
i++;
  }
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;sdk_config.h file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
// &amp;lt;e&amp;gt; WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer
//==========================================================
#ifndef WDT_ENABLED
#define WDT_ENABLED 1
#endif
// &amp;lt;o&amp;gt; WDT_CONFIG_BEHAVIOUR  - WDT behavior in CPU SLEEP or HALT mode
 
// &amp;lt;1=&amp;gt; Run in SLEEP, Pause in HALT 
// &amp;lt;8=&amp;gt; Pause in SLEEP, Run in HALT 
// &amp;lt;9=&amp;gt; Run in SLEEP and HALT 
// &amp;lt;0=&amp;gt; Pause in SLEEP and HALT 

#ifndef WDT_CONFIG_BEHAVIOUR
#define WDT_CONFIG_BEHAVIOUR 1
#endif

// &amp;lt;o&amp;gt; WDT_CONFIG_RELOAD_VALUE - Reload value  &amp;lt;15-4294967295&amp;gt; 


#ifndef WDT_CONFIG_RELOAD_VALUE
#define WDT_CONFIG_RELOAD_VALUE 2000
#endif

// &amp;lt;o&amp;gt; WDT_CONFIG_IRQ_PRIORITY  - Interrupt priority
 

// &amp;lt;i&amp;gt; Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// &amp;lt;0=&amp;gt; 0 (highest) 
// &amp;lt;1=&amp;gt; 1 
// &amp;lt;2=&amp;gt; 2 
// &amp;lt;3=&amp;gt; 3 
// &amp;lt;4=&amp;gt; 4 
// &amp;lt;5=&amp;gt; 5 
// &amp;lt;6=&amp;gt; 6 
// &amp;lt;7=&amp;gt; 7 

#ifndef WDT_CONFIG_IRQ_PRIORITY
#define WDT_CONFIG_IRQ_PRIORITY 6
#endif

// &amp;lt;/e&amp;gt;
&lt;/pre&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs/358383#358383"]have you checked out the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__wdt.html"&gt;Watchdog API&lt;/a&gt; on the Infocenter explaining how the various Watchdog functions work and should be implemented?[/quote]
&lt;p&gt;Yes, I have some doubts regarding WDT_IRQ_CONFIG. Do I need to register IRQ for wdt_event_handler? and NRF_WDT_EVENT_TIMEOUT. How and where I can set NRF_WDT_EVENT_TIMEOUT?&lt;/p&gt;
&lt;p&gt;Please let me know if I did anything wrong.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/358383?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 11:18:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d75554e-1505-46f6-9248-a72b3c117bbf</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Where have you implemented the Watchdog in your application, and have you checked out the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__wdt.html"&gt;Watchdog API&lt;/a&gt; on the Infocenter explaining how the various Watchdog functions work and should be implemented?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/358219?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 13:08:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b0daa47-c0b5-47f9-8f1f-0559ec768d88</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Thanks simonr,&lt;/p&gt;
&lt;p&gt;Thanks for this information.&lt;/p&gt;
&lt;p&gt;I was able to make controller restart (it was expected) when there is no any feed for WDT_CONFIG_RELOAD_VALUE 2000 milliseconds but still, WDT event handler wdt_event_handler() function was not getting called.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/358153?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 09:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93af985b-23e9-46cf-a23f-da739865bb7f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Oh, right. I didn&amp;#39;t catch that. I&amp;#39;m sorry about the misunderstanding.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason you&amp;#39;re not seeing the watchdog resetting is because you&amp;#39;re feeding it in the main loop. The watchdog won&amp;#39;t automatically discovers errors and resets. In release builds, the standard error handler of the SDK will reset handle these kinds of errors by itself and reset. It&amp;#39;s recommended you keep that. Then you can use the watchdog to recover from other instances, but then you have to make sure you don&amp;#39;t feed the watchdog&amp;nbsp;&lt;strong&gt;after&lt;/strong&gt; something has gone wrong.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/357984?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 14:23:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f796a54b-2103-4170-beb7-dab78d32a61c</guid><dc:creator>Neeraj Dhekale</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
[quote userid="97666" url="~/f/nordic-q-a/85769/softdevice---wdt-event-not-occurring-when-it-hangs"]. I am trying to implement WDT and expecting to occur its event when the module becomes hang or any unexpected error occurred. I am purposely written the code[/quote]
&lt;p&gt;Having said that, I have purposely written the code to get above error. I was expecting that WDT should catch this and event of WDT should occur.&lt;/p&gt;
&lt;p&gt;Please me know if WDT cannot handle such error.&lt;/p&gt;
&lt;p&gt;Thanks and regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Neeraj Dhekale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice - WDT event not occurring when it hangs</title><link>https://devzone.nordicsemi.com/thread/357972?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 14:05:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ef95415-97d1-4ac7-b7c6-e9f40fd92046</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;An NRF_ERROR_INVALID_STATE from the sd_ble_gap_adv_stop() function means that the advertising handle is not advertising already, so it seems like you&amp;#39;re trying to do an update where you start by calling sd_ble_gap_adv_stop() either before starting advertisement the first time or after you have already stopped the advertisement.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>