<?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>Preserving reset reason with NRF bootloader (SDK15.2)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43375/preserving-reset-reason-with-nrf-bootloader-sdk15-2</link><description>Hello, 
 My application, running on nRF52840 with SDK15.2, needs to detect the reset source from System OFF state. However, when using the BLE Secure DFU Bootloader, it always finds the RESETREAS register cleared to 0. 
 I tracked the problem to nrf_bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Apr 2020 16:35:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43375/preserving-reset-reason-with-nrf-bootloader-sdk15-2" /><item><title>RE: Preserving reset reason with NRF bootloader (SDK15.2)</title><link>https://devzone.nordicsemi.com/thread/244527?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2020 16:35:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9162545-7c61-4556-a120-5161fc177adc</guid><dc:creator>Cory Klopotic</dc:creator><description>&lt;p&gt;Thanks for this post, it quickly help me locate the same issue.&amp;nbsp; Not sure if Nordic did some changes in the SDK (I&amp;#39;m using 15.3). That same line of code was on line 239 and was wrapped inside of an IF statement.&amp;nbsp; I was able to work around this issue without modifying the&amp;nbsp; SDK Files.&amp;nbsp; I just had to go into the sdk_config.h file and UNCHECK the &amp;quot;NRF_BL_APP_CRC_CHECK_SKIPPED_ON_SYSTEMOFF_RESET&amp;quot; option (located under nRF_Bootloader&amp;gt;&amp;gt;nrf_bootloader - Bootloader settings&amp;gt;&amp;gt;Application integrity checks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Preserving reset reason with NRF bootloader (SDK15.2)</title><link>https://devzone.nordicsemi.com/thread/198752?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 13:43:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0abf0cc2-adb8-4108-8ff7-d67a4d39303e</guid><dc:creator>Nathan Morsa</dc:creator><description>&lt;p&gt;Hello Israel,&lt;/p&gt;
&lt;p&gt;Unless I&amp;#39;m mistaken, you can indeed read and write to the&amp;nbsp;&lt;span&gt;RESETREAS register. But this was not a solution to this problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here is the patch I applied:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;--- a/components/libraries/bootloader/nrf_bootloader.c	Tue Oct 30 13:29:35 2018 +0100
+++ b/components/libraries/bootloader/nrf_bootloader.c	Tue Feb 05 18:06:54 2019 +0100
@@ -228,7 +228,7 @@
     if (NRF_BL_APP_CRC_CHECK_SKIPPED_ON_SYSTEMOFF_RESET &amp;amp;&amp;amp;
         (nrf_power_resetreas_get() &amp;amp; NRF_POWER_RESETREAS_OFF_MASK))
     {
-        nrf_power_resetreas_clear(NRF_POWER_RESETREAS_OFF_MASK);
+        //nrf_power_resetreas_clear(NRF_POWER_RESETREAS_OFF_MASK);
         ret = false;
     }
     else if (NRF_BL_APP_CRC_CHECK_SKIPPED_ON_GPREGRET2 &amp;amp;&amp;amp;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;By reading then clearing it in the application, I have not encountered any side-effect since then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Preserving reset reason with NRF bootloader (SDK15.2)</title><link>https://devzone.nordicsemi.com/thread/198692?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 11:58:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:352a02ea-6092-4227-9999-73024892b8f5</guid><dc:creator>Israel</dc:creator><description>&lt;p&gt;Hello Nathan,&lt;/p&gt;
&lt;p&gt;What do you mean by saving and restoring the content of RESETREAS? To my understanding you cannot write back to RESETREAS, writing a &amp;#39;1&amp;#39; its what actually clears the register.....&lt;br /&gt;&lt;br /&gt;I am having the same issue as you describe, did you just left the line nrf_power_resetreas_clear(NRF_POWER_RESETREAS_OFF_MASK); commented out?&lt;br /&gt;&lt;br /&gt;Does anyone know why the NRF Bootloader clears the reset reason in the first place?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Preserving reset reason with NRF bootloader (SDK15.2)</title><link>https://devzone.nordicsemi.com/thread/169746?ContentTypeID=1</link><pubDate>Wed, 06 Feb 2019 14:07:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d69900a1-bf5f-488b-907d-efe374524028</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Nathan,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it will be a problem if you modify the SDK library as long as you do the clear in the application (main.c).&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>