<?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 put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49356/how-to-put-the-nrf52832-into-deep-sleep-mode</link><description>Hello, 
 I am currently using nRF52832 with SDK v11.0.0 and S132 v2.0.0. I am also using the soft device as my application requires. I have been trying to put the CPU into SYSTEM OFF mode using the following: 
 
 // Configure the &amp;quot;main&amp;quot; button: 
 nrf_gpio_cfg_sense_input</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Jul 2019 07:19:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49356/how-to-put-the-nrf52832-into-deep-sleep-mode" /><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/197278?ContentTypeID=1</link><pubDate>Tue, 09 Jul 2019 07:19:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88dd3054-f27e-49d0-8f9f-9f551e2d3422</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Power cycling the board after programming it should be sufficient to get out of debug mode. Just turn the chip off and remove any power sources (battery, USB connector, etc.), then attach the power source and turn the DK on again. You shouldn&amp;#39;t need any explicit code for this. Additionally, when the JLink debugger is connected, debug mode should be able to be turned off with the JLink commander using the &amp;quot;writeDP 1 0&amp;quot; command, although I haven&amp;#39;t tried this myself. Hopefully, the EasyDMA workaround will work out for you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;p&gt;PS: I&amp;#39;ll be out of office for the remainder of this week, but I&amp;#39;ll get back to you upon my return!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/197206?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2019 16:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b72f7373-b731-4a8c-8d4f-4d07cd0339f7</guid><dc:creator>Sami</dc:creator><description>&lt;p&gt;Thank you for the update. Last question, what is the correct way to permanently turn off the Debug Mode interface on the nRF52832 chip? Do I need to write&amp;nbsp;&lt;/p&gt;
&lt;p class="p1"&gt;NRF_UICR-&amp;gt;&lt;span class="s1"&gt;APPROTECT&lt;/span&gt;&amp;nbsp;= 0xFF // is this the correct way ?&lt;/p&gt;
&lt;p class="p1"&gt;&lt;/p&gt;
&lt;p class="p1"&gt;sd_flash_protect(&amp;lt;some register&amp;gt;) // do I need to use this at all?&amp;nbsp;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;/p&gt;
&lt;p class="p1"&gt;Please advise as well. Perhaps the errata work-around is all I need.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/197006?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2019 07:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7c33087-48e4-48a2-9c08-9b830f559a70</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Very well, let&amp;#39;s move on to the EasyDMA fix. There is an erratum where the EasyDMA isn&amp;#39;t disabled properly by just disabling the TWI/SPI peripherals. &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_Rev1%2FERR%2FnRF52832%2FRev1%2Flatest%2Fanomaly_832_89.html&amp;amp;cp=3_1_1_1_1_26"&gt;Please check&amp;nbsp;out this link&lt;/a&gt;&amp;nbsp;and implement the workaround for the TWI and SPI you&amp;#39;re using in order to power flush and make sure EasyDMA is turned off properly. Please note that you have to reinitialize the peripherals when waking up to get back up and running properly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196969?ContentTypeID=1</link><pubDate>Sun, 07 Jul 2019 16:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dedf0d1-42f3-4749-9d78-a718109ea8ef</guid><dc:creator>Sami</dc:creator><description>&lt;p&gt;Thank you for your reply. I made sure to flash my app into the target, then immediately remove the debugger, etc. I even detached the battery and reattached it, but still, same current consumption.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Configure the &amp;quot;main&amp;quot; button:
    nrf_gpio_cfg_sense_input( BUTTON_MAIN_PIN,
                              NRF_GPIO_PIN_PULLUP,
                              NRF_GPIO_PIN_SENSE_LOW );

    // SWCLK
    // SWDIO
    nrf_gpio_cfg_input( CONSOLE_TX_PIN, NRF_GPIO_PIN_PULLDOWN );
    nrf_gpio_cfg_input( CONSOLE_RX_PIN, NRF_GPIO_PIN_PULLDOWN );

    // Turn off the NVM:
    bool stat = extNvm_enterDeepPowerDown( true );

    if ( stat == false )
    {
        APP_PRINTF( &amp;quot;extNvm_enterDeepPowerDown() failed\n&amp;quot; );
        // Log the error.
        logDevNoDesc( LIB_ORIG_BLE, stat, REG_ERR );
    }

    // Turn off the AMOLED:
    displayQDisplayOff( NULL, NULL );

    // Before entering System OFF mode, the user must make sure that all
    // on-going EasyDMA transactions have been completed. This is usually
    // accomplished by making sure that the EasyDMA enabled peripheral is not
    // active when entering System OFF and this is achieved by disabling TWIM
    // and SPI busses.

    i2c_master_uninit();
    spi_uninit();

    //sd_softdevice_disable();
    DebugConsole_Disable();


    uint32_t errCode = sd_power_system_off();

    if ( errCode != NRF_SUCCESS )
    {
        APP_PRINTF( &amp;quot;sd_power_system_off() failed\n&amp;quot; );
        // Log the error.
        logDevNoDesc( LIB_ORIG_BLE, errCode, FATAL_ERR );
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There must be something else missing...going through the manual and devzone is all I have at this point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196931?ContentTypeID=1</link><pubDate>Sat, 06 Jul 2019 04:58:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83e7a5d8-cdf3-4ab8-94bf-e1ab36112b86</guid><dc:creator>RoyCreemers</dc:creator><description>&lt;p&gt;Of course putting the reset call in does not help you: it is in an endless boot loop now. Indeed, make sure your debugger is detached. You can do this with the IDE. If don&amp;#39;t now how, for now, close it completely and reset your target manually.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196898?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2019 17:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd79ffe5-1750-41a6-bb84-b7cdad33bdf2</guid><dc:creator>Sami</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your reply. I put sd_nvic_SystemReset() at the very start of my main() function (to take the system out of debug mode) and now my app doesn&amp;#39;t run at all (completely unresponsive). Looks like there&amp;#39;s another piece of information that I may be missing here...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For EasyDMA, I&amp;#39;m uninitializing + disabling all TWI and SPI resources before calling sd_power_system_off().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196740?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2019 08:27:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11cee444-f81a-4161-b3a5-1ab4a70b18e5</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;You can also use &lt;span&gt;sd_nvic_SystemReset()&lt;/span&gt;&amp;nbsp;at the start of your main() function. This should work in SDK 11.0.0 as well.&lt;/p&gt;
&lt;p&gt;The problem could be the EasyDMA, but I want to eliminate this possibility before going down that road. You want to get out of Debug mode, not into it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196685?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2019 01:49:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a36cce5-8e11-4459-b2a9-618684c71f31</guid><dc:creator>Sami</dc:creator><description>&lt;p&gt;NRF_POWER-&amp;gt;RESET = 1; // this does not exist in SDK 11.0.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please advise how to put the system into Debug mode before I call&amp;nbsp;&lt;span&gt;sd_power_system_off&lt;/span&gt;&lt;strong&gt;()&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196654?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 16:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01fcc37b-7274-4fdc-9fa4-a0ca11322710</guid><dc:creator>Sami</dc:creator><description>&lt;p&gt;Hi Simonr, thank you for your reply. My application is running I2C and SPI which both are using EasyDMA. I thought that if I turned off EasyDMA but uninitializing the I2C driver and SPI driver, everything would be ok.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is&amp;nbsp;&lt;span&gt;sd_power_system_off() the correct function call to make?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m using the nRF52832, not the nRF52811 (which is the model number that your debug mode link sends me to).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My application must be put into System OFF mode via user interaction, and not after a reset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So do I call&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;NRF_POWER-&amp;gt;RESET =1;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and then&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sd_power_system_off(); ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to put the nrf52832 into deep sleep mode</title><link>https://devzone.nordicsemi.com/thread/196463?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 09:33:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:add15d31-3dda-43cc-8b4b-14202c619de5</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What peripheral(s) is your application using with EasyDMA? The current consumption you are seeing looks more like your chip is in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52811%2Fdif.html&amp;amp;cp=3_2_0_3_7_2&amp;amp;anchor=debuginterfacemode"&gt;debug mode&lt;/a&gt;. You should always be able to go back to normal mode by way of a reset, try adding&amp;nbsp;NRF_POWER-&amp;gt;RESET =1; to your code, from here, you should be able to do pin reset after programming.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>