<?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>Large current spikes (1Hz) with softdevice enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96312/large-current-spikes-1hz-with-softdevice-enabled</link><description>Hello, 
 I am using an nRF52840 on a custom board running the BLE stack from SDK16.0.0. I have an application that periodically advertises for 10s and is idle in between these advertising events. During this idle period I measure very large current spikes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Feb 2023 15:13:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96312/large-current-spikes-1hz-with-softdevice-enabled" /><item><title>RE: Large current spikes (1Hz) with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/409654?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 15:13:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d20a52f-452f-4450-8020-1a98b5fcc266</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Can you plesase show me the code snippet of this part?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large current spikes (1Hz) with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/409397?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 15:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:253a8428-74ce-4ce3-8f15-7dbb7f211950</guid><dc:creator>NLemire</dc:creator><description>&lt;p&gt;Disabling&amp;nbsp;&lt;span&gt;NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY&amp;nbsp;completely gets rid of the period spikes, and is my preferred path forward. I do not have any other issues with power consumption that need to be addressed. However, the application gets stuck in&amp;nbsp;nrf_pwr_mgmt_run()&amp;nbsp;when the device is connected to a central&amp;nbsp;device. More specifically, it looks like the application does not process new BLE data that is sent over the NUS service, and sits idle until I press button on the board which triggers an interrupt. Why would an event from the nus_data_handler, not cause power management to continue?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large current spikes (1Hz) with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/408494?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 10:26:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb0d6298-65c5-4d21-acf6-d01aa7527bff</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The cause of getting high current could be from custom hardware design or application. From your second comment - &amp;#39;&amp;#39;&lt;span&gt;I was able to modify this timer and saw the current spikes shift respectively as well. PWR_MGMT_TIMER_REQUIRED is defined due to NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY being defined in sdk_config.h. Setting this value to 0, disables this timer and gets rid of the current spikes altogether, which is great.&amp;#39;&amp;#39;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It seems you have the reduced current value in the idle period. what is the reduced value?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Shutdown or Enter DFU modes can be blocked by one or more modules. To restore this process, we can call nrf_pwr_mgmt_shutdown with NRF_PWR_MGMT_SHUTDOWN_CONTINUE. Alternatively, we can enable NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY.&lt;/span&gt;&lt;span&gt;&amp;nbsp;In this configuration, the module will try to retry this process every second(&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__pwr__mgmt.html?cp=9_5_0_6_10_37"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__pwr__mgmt.html?cp=9_5_0_6_10_37&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do you have DC-DC converter on your custom design? Be enabling and populating the DC/DC converter, the current consumption of the product will be much lower. Depending on your design, you can see the percentage of reduction in power usage. Also, the 32kHz LFCLK crystal ensures the low power.&amp;nbsp;In very low duty cycle applications, like a long-interval beacon, the savings may be much greater.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large current spikes (1Hz) with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/408080?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 17:09:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52e8aa6f-3cef-4e1d-8c6f-5c16626a2ae9</guid><dc:creator>NLemire</dc:creator><description>&lt;p&gt;I dug into the idle state management and found what is causing the CPU to wake up every 1s.&amp;nbsp;Looking at nrf_pwr_mgnt.c, a timer is created with a period of 1s (shown below). I was able to modify this timer and saw the current spikes shift respectively as well. PWR_MGMT_TIMER_REQUIRED is defined due to NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY being defined in sdk_config.h. Setting this value to 0, disables this timer and gets rid of the current spikes altogether, which is great. However, I do not understand what implication this might have on the application because I don&amp;#39;t have more detail on what a &amp;quot;blocked shutdown procedure&amp;quot; is.&amp;nbsp;Can you please explain what this event is so I can understand how it affects the application?&lt;/p&gt;
&lt;p&gt;snippet from nrf_pwr_mgnt.c&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifdef PWR_MGMT_TIMER_REQUIRED
    #include &amp;quot;app_timer.h&amp;quot;
    #define PWR_MGMT_TIMER_CREATE()     pwr_mgmt_timer_create()

    APP_TIMER_DEF(m_pwr_mgmt_timer);    /**&amp;lt; Timer used by this module. */

    /**@brief Handle events from m_pwr_mgmt_timer.
     */
    static void nrf_pwr_mgmt_timeout_handler(void * p_context)
    {
        PWR_MGMT_CPU_USAGE_MONITOR_UPDATE();
        PWR_MGMT_AUTO_SHUTDOWN_RETRY();
        PWR_MGMT_STANDBY_TIMEOUT_CHECK();
    }

    __STATIC_INLINE ret_code_t pwr_mgmt_timer_create(void)
    {
        ret_code_t ret_code = app_timer_create(&amp;amp;m_pwr_mgmt_timer,
                                               APP_TIMER_MODE_REPEATED,
                                               nrf_pwr_mgmt_timeout_handler);
        if (ret_code != NRF_SUCCESS)
        {
            return ret_code;
        }

        return app_timer_start(m_pwr_mgmt_timer, APP_TIMER_TICKS(1000), NULL);
    }&lt;/pre&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY
    #undef  PWR_MGMT_TIMER_REQUIRED
    #define PWR_MGMT_TIMER_REQUIRED&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;snippet from sdk_config.h&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;q&amp;gt; NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY  - Blocked shutdown procedure will be retried every second.
 

#ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY
#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1
#endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>