<?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>nRF52840 is anything dependent on power management?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54259/nrf52840-is-anything-dependent-on-power-management</link><description>Hello, 
 nRF52840-DK 
 SDK: 15.3.0 
 SoftDevice: s140 
 https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fclock.html 
 Do any drivers, or libraries depend on power management? From the link above, the DFU is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Nov 2019 13:51:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54259/nrf52840-is-anything-dependent-on-power-management" /><item><title>RE: nRF52840 is anything dependent on power management?</title><link>https://devzone.nordicsemi.com/thread/219912?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 13:51:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:348f67f2-7d6b-4f75-bb8c-6030031954f4</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="BEplane"]My expectation is that all other features will work, and the processor will not go to sleep. Causing a small increase in power consumption.[/quote]
&lt;p&gt;&amp;nbsp;Yes, that is correct. Removing the&amp;nbsp;&lt;span&gt;nrf_pwr_mgmt_run(), not the idle_state_handle(), will only prevent device from sleeping (power saving).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 is anything dependent on power management?</title><link>https://devzone.nordicsemi.com/thread/219712?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 14:35:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aefcce7-c1bc-402e-9c5c-e535358db3cf</guid><dc:creator>BEplane</dc:creator><description>&lt;p&gt;Sorry I copied from the main browser URL, not the Copy URL button, so it went to the previous page I was viewing. I was referring to the power management &lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_pwr_mgmt.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_pwr_mgmt.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes that is is function that is being called. I am inquiring if leaving the power management setup, but removing that call (nrf_pwr_mgmt_run) will have any negative effect of properly running other features provided by Nordic.&lt;/p&gt;
&lt;p&gt;This is a broad question, but the power management is baked into most examples, so I would like to better understand any unseen complications for removing only the call (nrf_pwr_mgmt_run) from a project.&lt;/p&gt;
&lt;p&gt;My expectation is that all other features will work, and the processor will not go to sleep. Causing a small increase in power consumption.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 is anything dependent on power management?</title><link>https://devzone.nordicsemi.com/thread/219678?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 13:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5644a8d2-1290-4be5-8df7-39fd92cf23ad</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/beplane"&gt;BEplane&lt;/a&gt;,&lt;/p&gt;
[quote user=""]From the link above, the DFU is the only feature that needs the power management[/quote]
&lt;p&gt;&amp;nbsp;Not sure what you are referring to. The link points to the clock chapter of nRF52832, with no mention of DFU.&lt;/p&gt;
[quote user=""]We are trying to remove nrf_pwr_mgmt_run() from main, and determine if any unknown issues will arise[/quote]
&lt;p&gt;&amp;nbsp;What example are you running? All examples call&amp;nbsp;&lt;span&gt;nrf_pwr_mgmt_run() in idle_state_handle():&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling the idle state (main loop).
 *
 * @details Handles any pending log or key operations, or both, then sleeps until the next event occurs.
 */
static void idle_state_handle(void)
{
    ret_code_t err_code;
    
    err_code = nrf_ble_lesc_request_handler();
    APP_ERROR_CHECK(err_code);
    
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}

void nrf_pwr_mgmt_run(void)
{
    PWR_MGMT_FPU_SLEEP_PREPARE();
    PWR_MGMT_SLEEP_LOCK_ACQUIRE();
    PWR_MGMT_CPU_USAGE_MONITOR_SECTION_ENTER();
    PWR_MGMT_DEBUG_PIN_SET();

    // Wait for an event.
#ifdef SOFTDEVICE_PRESENT
    if (nrf_sdh_is_enabled())
    {
        ret_code_t ret_code = sd_app_evt_wait();
        ASSERT((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_SOFTDEVICE_NOT_ENABLED));
        UNUSED_VARIABLE(ret_code);
    }
    else
#endif // SOFTDEVICE_PRESENT
    {
        // Wait for an event.
        __WFE();
        // Clear the internal event register.
        __SEV();
        __WFE();
    }

    PWR_MGMT_DEBUG_PIN_CLEAR();
    PWR_MGMT_CPU_USAGE_MONITOR_SECTION_EXIT();
    PWR_MGMT_SLEEP_LOCK_RELEASE();
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The DFU service (components\ble\ble_services\ble_dfu\ble_dfu.h), however, calls&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU);

/**@brief Function for shutting down the system.
 *
 * @param[in] shutdown_type     Type of operation.
 *
 * @details All callbacks will be executed prior to shutdown.
 */
void nrf_pwr_mgmt_shutdown(nrf_pwr_mgmt_shutdown_t shutdown_type);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I suggest having a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__pwr__mgmt.html"&gt;Power Management library&lt;/a&gt;&amp;nbsp;(components\libraries\pwr_mgmt\nrf_pwr_mgmt.h)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>