This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 is anything dependent on power management?

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 the only feature that needs the power management. We are trying to remove nrf_pwr_mgmt_run() from main, and determine if any unknown issues will arise. We are not currently observing any issues in small tests, but we also do not want to error, or halt during run time.

We plan on adding the BLE Buttonless DFU in the near future, but currently would like to confirm with or without power management, (more specifically calling nrf_pwr_mgmt_run in main) what will potentially cause issues. 

Thank you,

Parents
  • Hi ,

    From the link above, the DFU is the only feature that needs the power management

     Not sure what you are referring to. The link points to the clock chapter of nRF52832, with no mention of DFU.

    We are trying to remove nrf_pwr_mgmt_run() from main, and determine if any unknown issues will arise

     What example are you running? All examples call nrf_pwr_mgmt_run() in idle_state_handle():

    /**@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();
    }


    The DFU service (components\ble\ble_services\ble_dfu\ble_dfu.h), however, calls 

    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);


    I suggest having a look at the Power Management library (components\libraries\pwr_mgmt\nrf_pwr_mgmt.h) 

Reply
  • Hi ,

    From the link above, the DFU is the only feature that needs the power management

     Not sure what you are referring to. The link points to the clock chapter of nRF52832, with no mention of DFU.

    We are trying to remove nrf_pwr_mgmt_run() from main, and determine if any unknown issues will arise

     What example are you running? All examples call nrf_pwr_mgmt_run() in idle_state_handle():

    /**@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();
    }


    The DFU service (components\ble\ble_services\ble_dfu\ble_dfu.h), however, calls 

    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);


    I suggest having a look at the Power Management library (components\libraries\pwr_mgmt\nrf_pwr_mgmt.h) 

Children
No Data
Related