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

ble_app_hrs_freertos How to enter Idle , Like this idle_state_handle().

I use nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_hrs_freertos.

I find freeRTOS idle task.

void vApplicationIdleHook( void )
{
#if NRF_LOG_ENABLED
     vTaskResume(m_logger_thread);
#endif
}

But no find  idle handle,like this nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_hrs dle_state_handle() .

So  How to enter Idle mode.

Parents
  • Hi John, 

    the ble_app_hrs_freertos example uses Tickless Idle Mode, i.e. configUSE_TICKLESS_IDLE is defined as 1 in FreeRTOSConfig.h . When the tickless idle functionality is enabled the kernel will call the portSUPPRESS_TICKS_AND_SLEEP() , which in turn calls WFE() (put the chip in sleep mode) when either 

    1. The Idle task is the only task able to run because all the application tasks are either in the Blocked state or in the Suspended state.
    2. At least n further complete tick periods will pass before the kernel is due to transition an application task out of the Blocked state, where n is set by the configEXPECTED_IDLE_TIME_BEFORE_SLEEP definition in FreeRTOSConfig.h.

    Hence, there is no need for a dedicated idle task handler as the kernel sorts this for you. 

    See https://www.freertos.org/low-power-tickless-rtos.html for more information regarding the Tickless Idle Mode. 

    -Bjørn

Reply
  • Hi John, 

    the ble_app_hrs_freertos example uses Tickless Idle Mode, i.e. configUSE_TICKLESS_IDLE is defined as 1 in FreeRTOSConfig.h . When the tickless idle functionality is enabled the kernel will call the portSUPPRESS_TICKS_AND_SLEEP() , which in turn calls WFE() (put the chip in sleep mode) when either 

    1. The Idle task is the only task able to run because all the application tasks are either in the Blocked state or in the Suspended state.
    2. At least n further complete tick periods will pass before the kernel is due to transition an application task out of the Blocked state, where n is set by the configEXPECTED_IDLE_TIME_BEFORE_SLEEP definition in FreeRTOSConfig.h.

    Hence, there is no need for a dedicated idle task handler as the kernel sorts this for you. 

    See https://www.freertos.org/low-power-tickless-rtos.html for more information regarding the Tickless Idle Mode. 

    -Bjørn

Children
Related