usage of configUSE_TICKLESS_IDLE

maniramn wrote on Monday, August 19, 2019:

hi,
i am working on low power mode, here i using the freertos functionality vPortSupressTicksandSleep() ot make the harware sleep and wakeup after a interrupt given, for using this function i need to define
#define configUSE_TICKLESS_IDLE 1
i am having few queries over this macro enabling:
can i know,if this macro is enabled and the device reboots, the presleep and post sleep will be called continously?

before this function it is given as:
#if (configUSE_TICKLESS_IDLE ==1 )
i want to execute this function only when the device tries to go to sleep, but when i define
#define configUSE_TICKLESS_IDLE 1
in the file where the sleep mode is configured, it does not enable this function.

can u please share any logic for enabling this function?

rtel wrote on Monday, August 19, 2019:

define configUSE_TICKLESS_IDLE 1

in the file where the sleep mode is configured, it does not enable this
function.

Which function? Assuming you are using a Cortex-M3, M4F or M7 port,
then setting configUSE_TICKLESS_IDLE is 1 will the ‘supportess ticks and
yield’ macro is called, which by default, calls
vPortSuppressTicksAndSleep() defined in the FreeRTOS port.c file.

maniramn wrote on Tuesday, August 20, 2019:

Hi,
Thank you Richard for the reply.
I am referring to the function called vPortSupressTicksandSleep() and I am
using cortex M7.

Now the issue:
If I make the macro defined to 1, I would observed that the presleep and
post sleep called continuously, is the behaviour expected or not?

On Tue 20 Aug, 2019, 12:25 AM Richard Barry, rtel@users.sourceforge.net
wrote:

define configUSE_TICKLESS_IDLE 1

in the file where the sleep mode is configured, it does not enable this
function.

Which function? Assuming you are using a Cortex-M3, M4F or M7 port,
then setting configUSE_TICKLESS_IDLE is 1 will the ‘supportess ticks and
yield’ macro is called, which by default, calls
vPortSuppressTicksAndSleep() defined in the FreeRTOS port.c file.

usage of configUSE_TICKLESS_IDLE
https://sourceforge.net/p/freertos/discussion/382005/thread/d3e4e92feb/?limit=25#0403/aee7

Sent from sourceforge.net because you indicated interest in
SourceForge.net: Log In to SourceForge.net

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net

rtel wrote on Friday, August 23, 2019:

In the source code you will see that vPortSuppressTicksAndSleep() is
called if the expected idle time goes above a threshold you configure
using the configEXPECTED_IDLE_TIME_BEFORE_SLEEP constant
FreeRTOSConfig.h - then inside vPortSuppressTicksAndSleep() you have the
following code which is where the pre and post sleep functions (which
are defined by the application) are executed.

configPRE_SLEEP_PROCESSING( xModifiableIdleTime );
if( xModifiableIdleTime > 0 )
{
__asm volatile( “dsb” ::: “memory” );
__asm volatile( “wfi” );
__asm volatile( “isb” );
}
configPOST_SLEEP_PROCESSING( xExpectedIdleTime );

Which bit is not executing as you expect? When you step through the
code in the debugger why is it not behaving as expected?