<?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>nRF52840 DFU Reset Reason Detection Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124591/nrf52840-dfu-reset-reason-detection-issue</link><description>Problem: 
 
 Reset reason logic works correctly when programming via SWD 
 After DFU programming, reset reasons are detected incorrectly 
 Even after unplugging/reconnecting the battery post-DFU, the logic fails 
 DFU resets are being misclassified as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Sep 2025 20:16:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124591/nrf52840-dfu-reset-reason-detection-issue" /><item><title>RE: nRF52840 DFU Reset Reason Detection Issue</title><link>https://devzone.nordicsemi.com/thread/549842?ContentTypeID=1</link><pubDate>Thu, 25 Sep 2025 20:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2acedcb6-f967-467d-96be-a74c512194e0</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello luqman,&lt;/p&gt;
&lt;p&gt;I expect that in most cases, DFU would reset the device with reason Soft Reset. However, depends on the exact strategy, it can differ, for example, if it requires a manual reset from the end user.&lt;/p&gt;
&lt;p&gt;What reset value are you having? From the code you post, I see that anything other than reset reason&amp;nbsp;DIF or no reason detected will fall under the else clause. That is quite a&amp;nbsp;many different reasons...&lt;/p&gt;
&lt;p&gt;Please refer to the RESETREAS register documentation:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#ariaid-title35"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#ariaid-title35&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I also recommend consider using the nrfx driver or HAL layer to get reset reason for better code readability.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>