<?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 can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26356/how-can-i-read-resetreas-register-using-a-softdevice</link><description>Hello, 
 I would like to know how I can identify the reason for a reset in my device, I have read about the register NRF_POWER-&amp;gt;RESETREAS but I don&amp;#39;t know how to check it since I am using a softdevice. 
 I have read as well this post but I couldn&amp;#39;t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 31 Oct 2017 15:21:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26356/how-can-i-read-resetreas-register-using-a-softdevice" /><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103736?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 15:21:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af8e5256-f7c7-44e5-b287-4f21de839233</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;I&amp;#39;ve checked SDK examples again and this seems to apply only to MBR commands when jumping to bootloader and back. However things like unfinished debug UART transfer or active SWD debugger can prevent your device from sleep. What is actual time between going to SYSTEM OFF and waking-up? Are you sure that going to SYSTEM OFF doesn&amp;#39;t return error code (it should never return anything)? Can you disable all peripheral settings and verify that your system goes to SYSTEM OFF and doesn&amp;#39;t wake up?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103734?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 13:38:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85bc4eec-896c-41b1-87a4-877cf3c17670</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;&lt;code&gt;Make sure that all interrupts are cleared when you call sleep etc&lt;/code&gt; how can I do this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103735?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 13:19:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5870903b-649b-44bb-9b94-f42d6e7a60a6</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;I would comment out all GPIO/GPIOTE/ADC for the start and verify that your FW really goes to sleep and stays there. Make sure that all interrupts are cleared when you call sleep etc. (it should be visible in SDK examples). If that works then you can start to enable things one by one and you will see where is the problem. I suppose that each interface which you can enable you can also disable so once you find which one it should be straight forward how to fix it before going to sleep.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103733?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 11:53:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cab7a65-1be4-4ba1-b6c0-7b562841f2b5</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;@endnode, I still have the same issue, my board seems to be restarted and gives the cause &lt;code&gt;-OFF&lt;/code&gt;, however I don&amp;#39;t know hy. I have set the device input as disconnected but still havin the issue. I configure that pin as&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_input(ADXL362_INT1,NRF_GPIO_PIN_PULLDOWN);
nrf_gpio_input_disconnect(ADXL362_INT1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;any hint?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103730?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 09:13:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93f6059b-790a-4314-be36-f8c077998cfa</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;Ok thanks, I will set my pin &lt;code&gt;ADXL362_INT1&lt;/code&gt; to disconnect with that method to check whether the resets stop or not&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103732?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 08:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93ef6897-a3af-41e9-8b64-7913925f5e4b</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, I do believe so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103731?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2017 08:05:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6ce59b9-a098-480a-a787-dc1352480239</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;@endnode, would it be possible to make use of the method &lt;code&gt;nrf_gpio_input_disconnect(PIN);&lt;/code&gt; to rid off sensing that input pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103728?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 11:47:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff8043c2-b55c-4fc8-909b-50b5a707bce5</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, setting some GPIO as input will make that PIN waking up the MCU from SYSTEM OFF. Here is example from SDK:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// This pin is used for waking up from System OFF and is active low, enabling sense capabilities.
nrf_gpio_cfg_sense_input(PIN_GPIO_WAKEUP, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW);

// Workaround for PAN_028 rev1.1 anomaly 22 - System: Issues with disable System OFF mechanism
nrf_delay_ms(1);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103729?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 10:32:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d696cec-c4a4-4c3b-a0aa-1b4fe7219ea0</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;Thanks again! I have GPIO and GPIOTE enable. I have some GPIO&amp;#39;s set as ouput not input, GPIOTE is not configured to sense any pin (yet), I send my chip to sleep and I have connected an ACC to my board through and arduino board/shield on pins&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; #define ADXL362_SCK_PIN   14  //D3
  #define ADXL362_MOSI_PIN  15  //D4
  #define ADXL362_MISO_PIN  16  //D5
  #define ADXL362_CS_PIN    18  //D7
  #define ADXL362_INT1      20  //D9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I think I am reading well RESETREAS  register ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103725?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 09:33:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3457211-f219-4ead-861f-13cc8685fb46</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Question is: do you send the chip to POWER OFF state and do you configure some GPIO PIN to wake it up?;) If not then most likely you read/interpret RESETREAS incorrectly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103724?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 09:32:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8be07ecf-4f2d-4a4e-bf5e-38fd8e9424b9</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;If you are sure that is the reason then yes, it means that nRF5x was in POWER OFF state with configured GPIOTE wake-up and some of these configured PINs changed polarity which woke the chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103727?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 09:30:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:554d462d-b71d-48f2-99da-58427cda83ae</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;@endnode, I see that I get an &lt;code&gt;NRF_POWER_RESETREAS_OFF&lt;/code&gt;, checking the datasheet of the nrf52832 I see that this is due to &lt;code&gt;Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO&lt;/code&gt;, does this mean that I get an interruption on a  GPIO port?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103726?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 09:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e40eca6-4afa-4b82-9063-ee6bc54e4ee0</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;Thanks for the examples @endnote, now I have modified my main to look like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{


    uint32_t err_code;
    bool     erase_bonds;
    

     // Initialize the log if enabled
    err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);
    
    
    log_resetreason();
    nrf_power_resetreas_clear(0xFFFFFFFF);
...}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I hope to capture the error&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103723?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 08:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4edd9e35-0069-4493-84bd-a0efb719ba13</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Also look to &lt;code&gt;log_resetreason&lt;/code&gt; function in &lt;code&gt;examples\peripheral\usbd\main.c&lt;/code&gt;, that&amp;#39;s a good example how you should handle the returned value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103722?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 08:09:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04ddb7ba-d2bb-47b1-bae7-c9835e8825bb</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;You cannot call any &lt;code&gt;sd_xxx&lt;/code&gt; function when Soft Device isn&amp;#39;t enabled (I believe it applies to all functions but maybe there are few exceptions). Also parameter of the function looks bad, why would you supply register address as pointer to return value? See how &lt;code&gt;nrf_power_resetreas_get&lt;/code&gt; function looks in &lt;code&gt;components\drivers_nrf\hal\nrf_power.h&lt;/code&gt;, that&amp;#39;s how you access (read) registers in C;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103721?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 07:56:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a346cf33-e532-448b-b9cf-ab036a37b040</guid><dc:creator>ndarkness</dc:creator><description>&lt;p&gt;Hi @endnode, I was just placing here but the my device seems to reset each time when placing it...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{


    uint32_t err_code;
    bool     erase_bonds;
    
   sd_power_reset_reason_get(NRF_POWER-&amp;gt;RESETREAS);

    // Initialize the log if enabled
    err_code = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(err_code);
...}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read RESETREAS register using a softdevice?</title><link>https://devzone.nordicsemi.com/thread/103720?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 07:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e45a1d8-aeda-42d9-a8c6-d4d142e2a370</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Simply read that register right after your FW boots way before you enable SD. No conflict at that time, you can freely read the value (I actually believe you can read it like that even when SD is active but it doesn&amp;#39;t matter).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>