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

Enter in SYSTEM ON doest not work

Hello everyone,

I'm using the nrf52840 Dev Kit (PCA10056 1.1.0 2019.19 683465548)

SDK version: 15.3

OS: Fedora

I work on a custom board and try to put it in SYSTEM ON mode like so:

int main(void)
{
    log_init();
    NRF_LOG_INFO("App start\n");
    NRF_LOG_FLUSH();

    power_management_init();
    for (;;) {
        nrf_pwr_mgmt_run();
    }
}

When I measure my consommation with OTII I get 4 mA instead of 1.5 uA according to this link (Debugging: Section 4).

Any ideas?

Regards,

Louis

  • Hi Louis

    As stated in the link you provided, this means the CPU is still running for some reason. Seeing as you're using a logger, I assume your application doesn't handle pending log operations before it goes to sleep, which causes the CPU to keep running.

    Could you try adding the idle_state_handle(); in your for loop instead of the nrf_pwr_mgmt_run(); as idle_state_handle(); handles pending log operations, then sleeps until the next event occurs.

    /**@brief Function for handling the idle state (main loop).
     *
     * @details Handle any pending log operation(s), then sleep until the next event occurs.
     */
    static void idle_state_handle(void)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            nrf_pwr_mgmt_run();
        }
    }

    Due to the summer holidays in Norway, our support team is understaffed this week, and delayed replies must be expected. Sorry for the inconvenience!

    Best regards,

    Simon

  • Hi Simonr

    I tried with idle_state_handle function and now I have 2.6 mA instead of 1.5 uA.

    I compiled and run the pwr_mgmt example with no modification except commenting some lines like so:

    int main(void)
    {
        // APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
        // NRF_LOG_DEFAULT_BACKENDS_INIT();
    
        // NRF_LOG_INFO("Power Management example");
    
        lfclk_config();
    
        uint32_t err_code = app_timer_init();
        APP_ERROR_CHECK(err_code);
    
    // #if NRF_PWR_MGMT_CONFIG_USE_SCHEDULER
    //     APP_SCHED_INIT(APP_SCHED_MAX_EVENT_SIZE, APP_SCHED_QUEUE_SIZE);
    // #endif // NRF_PWR_MGMT_CONFIG_USE_SCHEDULER
        // bsp_configuration();
    
        ret_code_t ret_code = nrf_pwr_mgmt_init();
        APP_ERROR_CHECK(ret_code);
    
        while (true)
        {
    // #if NRF_PWR_MGMT_CONFIG_USE_SCHEDULER
    //         app_sched_execute();
    // #endif // NRF_PWR_MGMT_CONFIG_USE_SCHEDULER
    
            if (NRF_LOG_PROCESS() == false)
            {
                nrf_pwr_mgmt_run();
            }
        }
    }

    and my consommation is 4 mA..

    I don't know how to get 1.5 uA.

    Any ideas?

  • If I unplug my JLink from my custom board I get 2.6 mA on pwr_mgmt example too.

  • Hi Louis

    How are you measuring your current consumption? I just tested the pwr_mgmt example myself and were able to measure ~570uA when the application was running, and ~0.3uA when I pressed button 1 to go to sleep mode using the PPK and an nRF52840DK. Additionally, when commenting out the same lines as you, I get a constant 2.3uA current using the same measurement setup. 

    Best regards,

    Simon

  • Hi Simonr

    I returned into my application project code and:

    1. Set DCDC mode in my main

    2. Enable NRF_PWR_MGMT_CONFIG_USE_SCHEDULER in my SDK config

    3. Fix an external peripheral problem ( which was drawning the 2 mA .... )

    Now I measure ~580µA when I'm in SYSTEM ON just like you in your pwr_mgmt project.

    I would like to go below 10µA, but i don't understand how the lines i have commented out in the pwr_mgmt project brought you from 570µA to 2.3µA. 
    From my understanding, i have only commented Logs and AppScheduler which are not supposed to consume extra power.

    Why do you get 2.3µA instead of 570µA when commenting lines I commented in pwr_mgmt example ?

    Thanks

Related