<?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 + Hard Reset</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73644/watchdog-hard-reset</link><description>Hi, We are currently attempting to turn off unused parts of our RAM, and the app&amp;#39;s linker space is configured to NOT use the turned on RAM. The problem is that the bootloader in our production boards currently has a linker space that covers the ENTIRE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Apr 2021 14:29:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73644/watchdog-hard-reset" /><item><title>RE: Watchdog + Hard Reset</title><link>https://devzone.nordicsemi.com/thread/303823?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 14:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60478a5f-28fc-4939-b4eb-3573be3146f0</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;OK, interesting. Thanks Vidar!&lt;br /&gt;If we have to go down this path to turn on the RAM post-fault, I think we will have an easier time simply DFUing the BL...&lt;br /&gt;Thanks again!&lt;br /&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog + Hard Reset</title><link>https://devzone.nordicsemi.com/thread/303806?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 13:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb0e71b7-da5c-41f3-8815-2abfbbcd37ec</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Roi,&lt;/p&gt;
&lt;p&gt;Good to hear that you found my reply helpful&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The POWER[].RAM registers are retained. So as you can see from the table below, you will need a reset from&amp;nbsp; either a WD timeout, resetpin, brownout, or &amp;quot;power on&amp;quot; for the RAM power settings set by the application to become reset. This is why a Soft reset (NVIC_SystemReset) will not recover the device in this particular case.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1617888307222v1.png" alt=" " /&gt;&lt;/p&gt;
[quote user="Roiger"]but we want to know the behavior for unplanned resets.[/quote]
&lt;p&gt;You can change the RAM power settings before calling NVIC_SystemReset() from your fault/error handlers as well. The only challenge is that you must write directly to the memory protected POWER registers as the Softdevice APIs may not be available from the error handler. Please see this post: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/53248/disable-softdevice-sandboxing-in-fault-handler"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/53248/disable-softdevice-sandboxing-in-fault-handler&lt;/a&gt;. The only difference is that you want to disable protection of the POWER module, not the NVMC.&lt;/p&gt;
&lt;p&gt;Disabling MWU sandboxing of POWER:&lt;/p&gt;
&lt;p&gt;NRF_MWU-&amp;gt;PREGION[0].SUBS &amp;amp;= ~(MWU_PREGION_SUBS_SR0_Include &amp;lt;&amp;lt; MWU_PREGION_SUBS_SR0_Pos);&lt;br /&gt; __DSB();&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog + Hard Reset</title><link>https://devzone.nordicsemi.com/thread/303537?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 13:15:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f651246-a8b9-458a-9209-71c1e05782a2</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Very informative Vidar!! Many Thanks!&lt;br /&gt;So if I understood your answer to 2 correctly - assuming that our RAM being turned off was not turned off because of some assertion/fault, instigating a soft reset to the bootloader, and the bootloader asserts because the RAM is turned off, so since nobody feeds the WD, the device will hard reset after&amp;nbsp;&lt;span&gt;NRFX_WDT_CONFIG_RELOAD_VALUE&amp;nbsp; milliseconds?&lt;br /&gt;&lt;br /&gt;Regarding your question - we can turn the RAM back on before our planned soft resets (DFU for example), but we want to know the behavior for unplanned resets.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Roi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watchdog + Hard Reset</title><link>https://devzone.nordicsemi.com/thread/303529?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 13:02:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4784648b-7fd7-487e-b641-113448b0a0d3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Couldn&amp;#39;t you just re-configure the RAM retention settings before entering bootloader DFU mode?&lt;/p&gt;
&lt;p&gt;1) This depends on how the assert and fault handler are implemented in your application. Typically, the default behaviour for release builds is to recover from faults/errors by calling NVIC_SystemReset() (soft reset). &lt;/p&gt;
&lt;p&gt;2) The WDT is not reset after a soft reset (&lt;span&gt;&lt;a title="Reset behavior" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2_5_7#concept_res_behav"&gt;Reset behavior&lt;/a&gt;&lt;/span&gt;), so it will continue to run in the BL. The SDK bootloader will automatically feed the WD if it detects that it has been enabled by the application.&lt;/p&gt;
&lt;p&gt;3) It&amp;#39;s actually not possible if the WDT was started by the application first.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>