cancel
Showing results for 
Search instead for 
Did you mean: 

Sequencer never calling idle state

Petterba02
Associate

Hello,

I am currently working on a ble project on the stm32wb09ke nucleo board that uses the stm32 sequencer. My application is working as intended but I want to make it low power for optimal battery life. If i understand correctly the sequencer itself handles when to enter the Idle state if there is no current running task. From the HeartRate example I've copied the logic for the "UTIL_SEQ_Idle" function. The problem I'm having is that the "UTIL_SEQ_Idle" function is not included in "UTIL_SEQ_Run" as it is in the HeartRate example and is therefore never called. Why is this part not included/generated? Should I just copy whats in the example?

 

My UTIL_SEQ_Run:

if ((local_evtset & EvtWaited)== 0U)
{
UTIL_SEQ_PreIdle( );

UTIL_SEQ_ENTER_CRITICAL_SECTION_IDLE( );
local_taskset = TaskSet;
local_evtset = EvtSet;
local_taskmask = TaskMask;

UTIL_SEQ_EXIT_CRITICAL_SECTION_IDLE( );

UTIL_SEQ_PostIdle( );
}

HeartRate example:

if ((local_evtset & EvtWaited)== 0U)
{
UTIL_SEQ_PreIdle( );

UTIL_SEQ_ENTER_CRITICAL_SECTION_IDLE( );
local_taskset = TaskSet;
local_evtset = EvtSet;
local_taskmask = TaskMask;
if ((local_taskset & local_taskmask & SuperMask) == 0U)
{
if ((local_evtset & EvtWaited)== 0U)
{
UTIL_SEQ_Idle( );
}
}
UTIL_SEQ_EXIT_CRITICAL_SECTION_IDLE( );

UTIL_SEQ_PostIdle( );
}
1 REPLY 1
Imen.D
ST Employee

Hello @Petterba02 ,

You should ensure that UTIL_SEQ_Idle is implemented to enter the low power mode. If UTIL_SEQ_Idle is not implemented in your project, the sequencer will simply loop and never enter low power mode, which reduces battery efficiency. So, you can adapt the HeartRate example's structure and integration.

You can refer to the AN5289 How to build wireless applications with STM32WB MCUs, in "4.4 Sequencer" section.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen