<?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>Reasons that RESETREAS is zero</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94206/reasons-that-resetreas-is-zero</link><description>Hello, 
 we faced sometimes the issue that the reset reason Register RESETREAS is Zero at Startup. What does it tell me? So what happend in the Firmware that there is a reset &amp;quot;without reason&amp;quot;. Normally we have a power reset and a reset from System off</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Nov 2022 14:50:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94206/reasons-that-resetreas-is-zero" /><item><title>RE: Reasons that RESETREAS is zero</title><link>https://devzone.nordicsemi.com/thread/397469?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 14:50:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e229c93a-3d4b-4c84-933c-e6ce774047e7</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Erwin,&lt;/p&gt;
&lt;p&gt;The reset pin has an internal pull-up, so it is not needed to pull it up externally.&lt;/p&gt;
&lt;p&gt;What you describe is sensible, and is a major reason for having the RESETREAS (the ability to&amp;nbsp;act differently based on what triggered the reset).&lt;/p&gt;
&lt;p&gt;If bit A is set in RESETREAS, then there has been a pin reset. You should not get this set after a power-cycle like you describe. You can test this simply with this modified hello world sample on a nRF5340 DK, built for the app core:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/zephyr.h&amp;gt;
#include &amp;lt;helpers/nrfx_reset_reason.h&amp;gt;

void main(void)
{
	uint32_t reason;

	reason = nrfx_reset_reason_get();

	while (true)
	{
		printk(&amp;quot;RESETREAS: 0x%08x\n&amp;quot;, reason);
		k_sleep(K_SECONDS(2));
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you press the reset button on the DK, you will see that bit A (the least significant bit) is set. If you power-cycle the DK, you will see that all bits are 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reasons that RESETREAS is zero</title><link>https://devzone.nordicsemi.com/thread/397443?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 13:23:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f9e1ee8-adba-4f92-9117-cc2ccda661bc</guid><dc:creator>ErwinCes</dc:creator><description>&lt;p&gt;Thanks for the fast and good answer.&lt;/p&gt;
&lt;p&gt;Just one question for confirmation: the reset pin is only connected to the debugger connection. There is no HW that pulls it externally to high. I assume that some internal logic in the processor assured that when I simply turn on the power supply the reset bit in the register is set.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a consequence I can implement in my firmware: if the A bit is set it was a real power cut or better a switch on of the (external) power supply. When the whole register is 0 we really had a power drop, that lead to a brown out reset. By completely switching off the power supply (for at least a second) and switching on again, I see bit A set.&lt;/p&gt;
&lt;p&gt;Erwin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reasons that RESETREAS is zero</title><link>https://devzone.nordicsemi.com/thread/397328?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 08:40:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37e27e04-a174-423f-b701-e1360504d482</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Erwin,&lt;/p&gt;
&lt;p&gt;The RESETREAS register is cleared by a power-on or a brown-out reset (see &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/reset/doc/reset.html?cp=3_0_0_3_9_8#reset_behavior"&gt;Application core reset behavior&lt;/a&gt;), so I would look at the supply voltage when this happens. For other reset reasons you will see the corresponding bit set in the RESETREAS (this will be the case after a reset from an exception handler).&lt;/p&gt;
&lt;p&gt;Yes, if trying to execute all FFs you will get an exception. Cortex CPUs does not interpret programmed memory as NOPs.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>