<?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 &amp;amp; Bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5905/wdt-bootloader</link><description>My application uses the WDT. In my application, I use a soft reset to enter the bootloader. Because the soft reset does not reset the WDT the program will reset while in the bootloader because of a watchdog timeout. 
 What is the best way to handle this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Mar 2016 08:25:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5905/wdt-bootloader" /><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20593?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2016 08:25:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba0ea94f-e265-4a48-bcff-80f3d87d8972</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Shiva,&lt;/p&gt;
&lt;p&gt;One solution is to erase the BANK_VALID_APP flag in p_bootloader_settings-&amp;gt;bank_0 in flash (have  a look at bootloader_app_is_valid() function). By doing that and then do a WDT reset (or any reset), you will force the Bootloader to enter OTA mode. But the draw back is that there is no way to fallback to  the original application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20592?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 18:18:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57ab0b3f-a47f-4ac5-823b-56250d37b72f</guid><dc:creator>Shiva</dc:creator><description>&lt;p&gt;Thanks for the clarification, Hung. I figured as much after posting the comment. DFU sample code that Nordic provides by default uses GPREGRET to trigger the switch to OTA. If you could additionally clarify that we need to make use of application flash area to trigger the OTA switch if we want enter OTA mode via WDT reset, that would be great.&lt;/p&gt;
&lt;p&gt;What makes this complicated is that sf we already have a bootloader out there that uses GPREGRET to switch to OTA and doesn&amp;#39;t already feed the WDT, then we can&amp;#39;t release an application that starts using WDT now. Do you know if there is a way to achieve this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20591?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 08:36:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8a47751-2d80-4873-a328-148265f5002a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Shiva: As shown in the table at section 12.1.19 nRF51 Reference Manual, Watchdog reset will reset the retained register GPREGRET. That&amp;#39;s why the bootloader didn&amp;#39;t enter bootloader mode after WDT reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20590?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 20:47:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8066b8d-5f1b-49fb-82a7-2e3cb40371be</guid><dc:creator>Shiva</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Is there any reason why WDT reset wouldn&amp;#39;t start the bootloader? In our setup, doing a soft reset causes the bootloader to start; but a WDT reset doesn&amp;#39;t. GPREGRET register which is used to trigger the DFU mode is updated in both these resets. Have you tried entering the bootloader mode via WDT reset? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20595?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2016 13:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2969c37-2231-4833-9210-292e6c896335</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Allen: Please create a new case when you have question/request. Piggybacking your question to other&amp;#39;s case is not a good idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20594?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2016 21:22:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4a9920c-d6ee-41b9-bc8c-c809713638da</guid><dc:creator>Allen Foster</dc:creator><description>&lt;p&gt;Nordic, please can you fix your completely inflexible WDT config.&lt;/p&gt;
&lt;p&gt;The inability to reconfigure the WDT once started is fine in principle but anyone who has ever done any work in the embedded world will tell you how inflexible such a solution is.&lt;/p&gt;
&lt;p&gt;Furthermore the argument that the ability to reconfigure the watchdog once started would negate the protection of a watchdog is also nonsense. I could quite easily write a bit of code which trashed either the ARM or NRF51 register space that the WDT could not offer recovery from.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20588?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2015 15:04:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5ad3ec4-89c0-454a-a231-432449039509</guid><dc:creator>John</dc:creator><description>&lt;p&gt;I added a service of the WDT in the wait_for_events function. I also added one just prior to the soft reset that triggered the entry into the bootloader. As Hung states in his answer allowing the WDT reset to trigger your entry into the bootloader may be a simpler solution. The reason I went with servicing the WDT in the bootloader is that I could not tell exactly what the behavior of the status of the WDT was through a actual WDT event. So I was more comfortable just servicing it and also retaining WDT &amp;quot;protection&amp;quot; during bootloading.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20589?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2015 13:40:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57c85951-627d-4eb6-8770-228e997ac321</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Lucas,&lt;/p&gt;
&lt;p&gt;I think the philosophy behind is that WDT should work in the way that when it started it can not be turned off. So the WDT can only be reset by itself or by a complete system reset (brown out, pin reset, systemOFF). When entering system OFF, the WDT register is retained but WDT is stopped.&lt;/p&gt;
&lt;p&gt;In this case, softreset is lower level that a Watchdog reset and it shouldn&amp;#39;t reset the WDT.&lt;/p&gt;
&lt;p&gt;You are correct about the 2 solutions. I would personally choose to trigger system reset using WDT to start bootloader. In case you don&amp;#39;t plan to do a reset when switching between application and Bootloader then you would need to handle the WDT in the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20587?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2015 23:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a443b8a8-31a3-4b26-9513-33df10333b72</guid><dc:creator>Lucas</dc:creator><description>&lt;p&gt;This seems like an architectural oversight in my opinion. Curious what part of the bootloader did you modify?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: WDT &amp; Bootloader</title><link>https://devzone.nordicsemi.com/thread/20586?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2015 14:56:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c296cef-bca5-49f3-a9a3-75aee9a1eba2</guid><dc:creator>John</dc:creator><description>&lt;p&gt;I ran into this exact problem in my design. I ended up adding a WD service to the bootloader so that it wouldn&amp;#39;t cause a bootloader failure when the WDT expired.&lt;/p&gt;
&lt;p&gt;According to section 12.1.8 of the nRF51_Series_Reference_manual v3.0, the WDT is a retained register so it will retain its settings through system off and certain resets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>