<?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>Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52821/sleep-mode-with-softdevice-dfu-rtc</link><description>Hi, I&amp;#39;m on last step of developing, but I have this critical trouble. For the project, I started from ble_app_buttonless_dfu sample of SDK15.3. I added some peripheral (one timer, two I2C, two UART) for my custom HW and a GATT database. My custom application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Oct 2019 06:16:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52821/sleep-mode-with-softdevice-dfu-rtc" /><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213306?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 06:16:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf3721e3-0174-404c-960b-d171fb2f02ec</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Ok good. Can you check if&amp;nbsp;&lt;span&gt;sd_app_evt_wait() always returns immediately, and comment out the initialization of UART?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213240?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 15:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:011392db-72f0-4162-b679-20fbf9f8a6d6</guid><dc:creator>abe</dc:creator><description>&lt;p&gt;Yes, the&amp;nbsp;&lt;span&gt;sd_app_evt_wait() returns&amp;nbsp;NRF_SUCCESS&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213236?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 14:48:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f20efd0-ca92-4094-8d39-5f2ba73a4158</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="Abele"]Please note that when goes in&amp;nbsp;&lt;span&gt;System OFF the board current drop to few uA&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;That&amp;#39;s good to know. It indicates that the measurement setup is correct and that there isn&amp;#39;t any external circuitry that draws the extra current.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you verified that sd_app_evt_wait() actually returns&amp;nbsp;NRF_SUCCESS?&amp;nbsp; Assume you&amp;nbsp;have the Softdevice enabled since you&amp;#39;re doing advertising, but note that most of the sd_ APIs, sd_app_evt_wait included, will only work when it is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213216?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 13:39:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3e05d10-ad91-4d81-9907-8b4c7d2cfaf9</guid><dc:creator>abe</dc:creator><description>&lt;p&gt;Was the advertising BLE_ADV_EVT_IDLE&amp;nbsp;inside&amp;nbsp;on_adv_evt() callback. (I have reduced the APP_ADV_DURATION to 5 seconds for check)&lt;/p&gt;
&lt;p&gt;Now I have commented the advertising_start() function call just before the main loop, but I have same result,&amp;nbsp;same current&lt;br /&gt;Please note that when goes in&amp;nbsp;&lt;span&gt;System OFF the board current drop to few uA&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213195?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 12:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5000414c-8df8-4410-b7c7-7418bef087d5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;What causes the program to enter System OFF when you&amp;#39;re not advertising?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213184?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 12:25:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c11e7711-a30a-4e78-a634-776dc68e0877</guid><dc:creator>abe</dc:creator><description>&lt;p&gt;I also tried with BLE advertising/scanning disabled, but in this case goes into System OFF sleep and the awake is possible only with external event, not using the RTC/app timer as I need&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213183?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 12:16:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad67dff1-fd1a-4556-8b7f-e4b66bffe19e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;To isolate the problem, can you try to only call&amp;nbsp;sd_app_evt_wait(); from your main loop and don&amp;#39;t perform the I2C reads or start any BLE advertising/scanning?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213157?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 09:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddb8ce94-4ec5-434c-80af-2f6191c667a3</guid><dc:creator>abe</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I add the FPU disable code, but nothing change.&amp;nbsp;&lt;br /&gt;My main loop code is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
    // Enter main loop.
    for (;;)
    {
        //idle_state_handle();
      
        #if (__FPU_USED == 1)
        _set_FPSCR(_get_FPSCR() &amp;amp; ~(0x0000009F)); 
          (void) __get_FPSCR();
          NVIC_ClearPendingIRQ(FPU_IRQn);
        #endif
        sd_app_evt_wait();
        periph_check();

    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the&amp;nbsp;periph_check() reads some I2C data&amp;nbsp;every 10 msec.&amp;nbsp;&lt;br /&gt;&lt;span&gt;The current profile has a minimum sink of 3mA (in the &amp;quot;idle&amp;quot; time between&amp;nbsp;I2C data reading)&lt;br /&gt;&lt;/span&gt;Any other suggests?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213105?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 07:18:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b4fd23a-0ba7-47fd-9c83-8fe6f35f7440</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The debugger should exit debug mode when it&amp;#39;s done programming or when you exit a debug session. The chip will not go out of debug interface mode if you just disconnect the cable.&amp;nbsp; Before you start measuring I would recommend you to do a power cycle of your board to make sure it boots into &amp;#39;normal&amp;#39; mode.&lt;/p&gt;
&lt;p&gt;Another possible explanation is that the CPU does not go to sleep because of a pending FPU event (&lt;a class="active" href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev2/ERR/nRF52840/Rev2/latest/anomaly_840_87.html?cp=3_0_1_0_1_6"&gt;[87] CPU: Unexpected wake from System ON Idle when using FPU&lt;/a&gt;). Of course, this is only relevant if you actually use FP instructions in your code. The workaround is included in power management module used in our examples, see&amp;nbsp;nrf_pwr_mgmt_run()-&amp;gt;PWR_MGMT_FPU_SLEEP_PREPARE()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213101?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 07:04:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da5f2af4-e152-4e02-a16a-1e5756c748d5</guid><dc:creator>abe</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Yes, the call is inside the main loop, then the function is called multiple times.&lt;br /&gt;It seems that idle current is same as run mode (in my case about 3mA).&lt;br /&gt;A further request: the debug mode is automatically disabled when I disconnect the SWD pod? &lt;br /&gt;Or there are some action to do inside the code to disable it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sleep mode with SoftDevice + DFU + RTC</title><link>https://devzone.nordicsemi.com/thread/213096?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 06:37:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6975fd90-e6ee-4e3b-9aae-8ed53bdca0ce</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you calling&amp;nbsp;call sd_app_evt_wait() from your main loop&amp;nbsp;like the&amp;nbsp;idle_state_handle() function in the ble_app_buttonless example? Note that it may have to be called multiple times to clear the internal event registers before the CPU can go to sleep.&amp;nbsp;&lt;/span&gt;Also, what is the idle current you measure now?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>