<?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 to get reset reason</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70115/how-to-get-reset-reason</link><description>Hi, 
 I would like to get some information about the reset&amp;#39;s reason of my nrf9160 like 
 - The reason is due of an assert type &amp;quot;xxx&amp;quot; 
 - Where is the stack pointer 
 - ... 
 Exist it some function in Zephyr already implemented to get this informations</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Jan 2021 08:33:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70115/how-to-get-reset-reason" /><item><title>RE: How to get reset reason</title><link>https://devzone.nordicsemi.com/thread/287641?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 08:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c161a275-ab3a-4dd0-8258-444ac36bc0c7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I am sorry, but I&amp;#39;m not aware of such a function. I could not find any references to such in the logging module API or docs:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/reference/logging/index.html"&gt;https://docs.zephyrproject.org/latest/reference/logging/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get reset reason</title><link>https://devzone.nordicsemi.com/thread/287559?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 15:23:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68c77f85-bd16-4ff5-b3f6-477ece122a34</guid><dc:creator>thomas oggier</dc:creator><description>&lt;p&gt;Hi, thanks for your help,&lt;/p&gt;
&lt;p&gt;Do you know if there is some possibility to get the last log value (print before the reset) when the program starts?&lt;/p&gt;
&lt;p&gt;Like read the log_queue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get reset reason</title><link>https://devzone.nordicsemi.com/thread/287523?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 13:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:267b4371-3ef7-43d8-82c0-d4754bc278db</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We do not have an example that shows storing errors/fault information to flash, unfortunately.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The fault handling in zephyr is described here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/54899/zephyr-recommended-unexpected-exception-handling-method"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/54899/zephyr-recommended-unexpected-exception-handling-method&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The zephyr fatal docs&amp;nbsp;can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/reference/kernel/other/fatal.html"&gt;https://docs.zephyrproject.org/latest/reference/kernel/other/fatal.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that since you&amp;#39;re using nrf9160, you have two regions. Secure and non-secure. The type of fault will determine which region you end up in, for instance a hardfault will end up in the secure domain.&lt;/p&gt;
&lt;p&gt;You can read more about this in ARMs M33 docs:&amp;nbsp;&lt;a href="https://developer.arm.com/documentation/100235/0004/the-cortex-m33-processor/exception-model/exception-types?lang=en"&gt;https://developer.arm.com/documentation/100235/0004/the-cortex-m33-processor/exception-model/exception-types?lang=en&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>