<?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>example code to generate different nrf52 reset cause</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100167/example-code-to-generate-different-nrf52-reset-cause</link><description>Hi team, 
 I am working on a feature to capture different reset reasons and take action. If someone has an example code to create these will be a great help.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 27 May 2023 06:44:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100167/example-code-to-generate-different-nrf52-reset-cause" /><item><title>RE: example code to generate different nrf52 reset cause</title><link>https://devzone.nordicsemi.com/thread/427902?ContentTypeID=1</link><pubDate>Sat, 27 May 2023 06:44:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bdc6fca-cd01-4668-97c2-cae59ac985f1</guid><dc:creator>yogeshiggalore</dc:creator><description>&lt;p&gt;thanks, jorgen&lt;/p&gt;
&lt;p&gt;this helps a lot. I will try to create an example code as you suggest.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: example code to generate different nrf52 reset cause</title><link>https://devzone.nordicsemi.com/thread/427739?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 10:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f2e6ee7-e36d-4ea5-8565-312ea940942c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We do not have example code that can be used for all reset reasons, but we have examples for the most typical use-cases.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;OFF:&lt;/span&gt;&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nrf51-powerdown-examples/blob/master/system_off_wakeup_on_gpio/main.c"&gt;System OFF example with wakeup from GPIO&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;span&gt;NFC:&amp;nbsp;&lt;a title="Wake on NFC Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/nfc_wake_on_nfc.html"&gt;Wake on NFC Example&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;RESETPIN: Press the reset button on the DK (make sure &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52833_dk/UG/dk/boot_reset_but.html"&gt;CONFIG_GPIO_AS_PINRESET&lt;/a&gt;&amp;nbsp;is defined in the project). Alternatively, you can connect a GPIO the Reset pin and assert the GPIO.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;SREQ: Call NVIC_SystemReset() from code.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;LOCKUP: The only way I know to cause CPU lockup is to trigger a HardFault from the HardFault handler.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;DOG: See&amp;nbsp;&lt;a title="WDT Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/nrf_dev_wdt_example.html?cp=9_1_4_6_51"&gt;WDT Example&lt;/a&gt;. Not pressing the button within 2 seconds to feed the watchdog will cause a watchdog reset.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;DIF: As far as I know, this can&amp;#39;t be done from code, but will happen if you attach the debugger when in system OFF mode.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;VBUS: Not aware of any example codes showing this, but it should be as simple as entering System OFF mode, then connect the nRF_USB port to power.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;LPCOMP: Start out with the&amp;nbsp;&lt;a title="LPCOMP Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lpcomp_example.html?cp=9_1_4_6_19"&gt;LPCOMP Example&lt;/a&gt;&amp;nbsp;and extend it with going to System OFF after initialization.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>