<?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>How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84631/how-do-i-get-the-reset-cause-with-nrf-connect-sdk</link><description>Hi, 
 I am using an nRF9160/nRFConnect SDK 1.8.0/VSCode and my application uses MCUBoot and SPM. It is a &amp;quot;non secure&amp;quot; application. 
 I am trying to get a reset cause. 
 hwinfo_get_reset_cause() just leads to a weak function that always returns -ENOSYS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Feb 2022 12:03:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84631/how-do-i-get-the-reset-cause-with-nrf-connect-sdk" /><item><title>RE: How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/thread/354326?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 12:03:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71ec5bf9-fc51-41f7-96ff-2fd2207fe3bb</guid><dc:creator>MaLu</dc:creator><description>&lt;p&gt;Thank you very much for researching this, it is much appreciated!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/thread/354319?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 11:49:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56e98033-e679-41e5-a1a8-e58db67d9e83</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;The hwinfo driver you are referring to is most likely outdated, as it is reading the register from the secure domain. The driver does not have a non-secure implementation as far as I can tell.&lt;/p&gt;
&lt;p&gt;It calls nrf_power_resetreas_get() with the argument NRF_POWER instead of NRF_POWER_NS;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_power_resetreas_get(NRF_POWER);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you want something &amp;quot;hardware-agnostic&amp;quot;, my suggestion is you register a feature request in the &lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/new/choose"&gt;Zephyr project&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/thread/352902?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 13:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0966d773-b6ca-484b-b0be-8037130f2c70</guid><dc:creator>MaLu</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;This is already much better, than just reading out the register.&lt;br /&gt;I am sorry, that I&amp;#39;m not explaining myself very well.&amp;nbsp;&lt;br /&gt;When I say Zephyr-ish approach, I mean, that I want to be as Hardware-agnostic in my code as possible. With&amp;nbsp;nrf_power_resetreas_get(NRF_POWER_NS) and espeacially with just reading from the register, I am dependent on the Hardware. So far I have managed to only use very high level functions with my code and was hoping to also be able to do this for the reset cause. That&amp;#39;s why I was hoping to make&amp;nbsp;hwinfo_get_reset_cause() work, since it is not nrf specific and would only use the underlying nrf driver.&amp;nbsp;&lt;br /&gt;I have noticed, that there is hwinfo_nrf stuff (hwinfo_nrf.c), but I cannot figure out, how to get the hwinfo wrapper to use that driver in my constellation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/thread/352876?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 12:51:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4fc228a-5fd4-4ab3-9bc1-ddc7980dfdea</guid><dc:creator>Hakon</dc:creator><description>[quote user="hiasiboy"]I&amp;#39;ve read that as well, but was hoping for a more Zephyr-ish approach.[/quote]
&lt;p&gt;I&amp;#39;m not sure what you mean by this, but if you don&amp;#39;t want to read the register directly you can use the nrf power library function&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_power_resetreas_get(NRF_POWER_NS);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/thread/352871?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 12:34:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7288ddd-6e5f-4a0f-aa56-0c93f1c189fe</guid><dc:creator>MaLu</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;I&amp;#39;ve read that as well, but was hoping for a more Zephyr-ish approach.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I get the reset cause with nRF Connect SDK?</title><link>https://devzone.nordicsemi.com/thread/352869?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 12:32:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dcea409-4f85-471c-abbd-150661e68d62</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I believe you can read out the value of the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/power.html?cp=2_0_0_4_6_0_0_13#register.RESETREAS"&gt;RESETREAS register&lt;/a&gt; to get the reset reason.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>