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

nrf_pwr_mgmt_run() with SoftDevice not go to low power

Hello.

I use SDK16 in my project.

Previously when I want to go on sleep I use __WFI(), and get into sleep till interrupt. Because I use The SoftDevice I change the command to nrf_pwr_mgmt_run() as instruct by Nordic . But now it doesn't enter sleep at all. I try also disable the FPU by NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 0 in the sdk_config.h but didn't help.

Why it is so?

Bar.

Parents
  • Hi Jared.

    I use my own board where I have a peripheral that take extra power. With __WFI() I get 2ma. With nrf_pwr_mgmt_run()  I get about 8ma.

    The relevant code is as follow

    #if ((OS_VIEW_IFSELECT != OS_VIEW_IF_JLINK) && (OS_DEBUG == 0))
            if (IdleTicks > 2) // nothing to do wait for interrupt at run time
    		{
    			// Switch CPU into sleep mode
    			nrf_pwr_mgmt_run();
    		}
    
    #endif

  • Hi,

    Use a debugger and set a breakpoint inside nrf_pwr_mgmt_run() at line 359 and see if the program hits the breakpoint.

  • Hi Jored.

    It doesn't stop there because I enable the BLE and the softdevice define SOFTDEVICE_PRESENT. So it go to sd_app_evt_wait()

    Look at the code.

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

    As I see it when it use BLE with SOFTDEVICE and it is enable it should go there.

    Is there a problem about it?

    Bar.

Reply
  • Hi Jored.

    It doesn't stop there because I enable the BLE and the softdevice define SOFTDEVICE_PRESENT. So it go to sd_app_evt_wait()

    Look at the code.

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

    As I see it when it use BLE with SOFTDEVICE and it is enable it should go there.

    Is there a problem about it?

    Bar.

Children
Related