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

Power consumption using FreeRTOS

Hi,

I'm using an application with FreeRTOS, nRF52833, SDK 16.

When I'm trying to get it into low power (sleep mode) the system still consumes ~4mA

In vPortSuppressTicksAndSleep (port_cmsis_systick.c file) I forced to use WFE instead sd_app_evt_wait

#if 0  
    #ifdef SOFTDEVICE_PRESENT  
    if (nrf_sdh_is_enabled())  
    {  
        uint32_t err_code = sd_app_evt_wait();  
        APP_ERROR_CHECK(err_code);  
    }  
    else  
#endif  
    #endif  
    {  
        /* No SD -  we would just block interrupts globally. 
        * BASEPRI cannot be used for that because it would prevent WFE from wake up. 
        */  
        do{  
            __WFE();  
        } while (0 == (NVIC->ISPR[0] | NVIC->ISPR[1]));  
    }  

After changing it the power consumption was reduced by ~3.5mA

What is the proper way to fix this problem?

Parents Reply
  • Hi Shai,

    Verified your descritption. You were right. Something is causing the softdevice wakeup too early. Please replace the sd_app_evt_wait with the below code in port_cmsis_systick.c. I have verified my suggestion to improve the power. We will investigate further if this behaviour is same with the coming SD versions to see if we need to fix something.

            if ( xModifiableIdleTime > 0 )
            {
    #ifdef SOFTDEVICE_PRESENT
                if (nrf_sdh_is_enabled())
                {
                    do{
                      uint32_t err_code = sd_app_evt_wait();
                      APP_ERROR_CHECK(err_code);
                    } while (0 == (NVIC->ISPR[0] | NVIC->ISPR[1]));
                }

Children
Related