<?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>nRF52 RESETREAS register</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13631/nrf52-resetreas-register</link><description>I&amp;#39;m using an nRF52832 (QFAAB0) on a custom PCB, nRF5 SDK, S132 v2.0. 
 I&amp;#39;m occasionally encountering spontaneous resets and want to tract down the source. I found the RESETREAS register and the SDK function to access it (sd_power_reset_reason_get). However</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 May 2016 17:23:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13631/nrf52-resetreas-register" /><item><title>RE: nRF52 RESETREAS register</title><link>https://devzone.nordicsemi.com/thread/52028?ContentTypeID=1</link><pubDate>Thu, 05 May 2016 17:23:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8add17b5-78db-4020-a4d5-8a612fab5a09</guid><dc:creator>Jason Wright</dc:creator><description>&lt;p&gt;Thanks for the replies, RK &amp;amp; Aryan.
Based on this suggestion, I looked at the return value of sd_power_reset_reason_get, which was equal to 2 (NRF_ERROR_SOFTDEVICE_NOT_ENABLED). With that in mind, I realized that the issue is that I was calling the function before initializing the SoftDevice. I moved it below my call to ble_stack_init() and it now seems to be working fine.
I would recommend adding this to the docs, which list the only possible return value for this function as
NRF_SUCCESS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 RESETREAS register</title><link>https://devzone.nordicsemi.com/thread/52027?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 06:43:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c728f3f5-f625-4acd-b500-250fd0f82fd9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Just to add to RK&amp;#39;s reply. You can only access POWER registers if the softdevice is not enabled. If it is enabled then on the latest versions of softdevice (from S132v2.0.0) if softdevice enabled, then accessing POWER and CLOCK registers directly will cause a hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 RESETREAS register</title><link>https://devzone.nordicsemi.com/thread/52026?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 00:20:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6605d9f3-679b-49c9-a492-dc68ecd3af93</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Does the function return an error? Yes I know it&amp;#39;s documented not to but if the softdevice isn&amp;#39;t enabled, it still will. In that case it would not have updated &amp;amp;reset_reason which would be full of whatever junk was left on the stack at function entry.&lt;/p&gt;
&lt;p&gt;Or just read the register yourself and write it yourself too.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t reset_reason = NRF_POWER-&amp;gt;RESETREAS;
NRF_POWER-&amp;gt;RESETREAS = 0xffffffff;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>