AnsweredAssumed Answered

GENFSK KW41Z LLS3 LLWU exits without wakeup reasons

Question asked by Gerardo Catena on Nov 3, 2018
Latest reply on Nov 16, 2018 by Estephania Martinez

Hi,

we are trying to implement a polling receiver using GENFSK. Basically our application is a customization of the FreeRTOS connectivity demo.

The aim is to make the rx device cycling forever between rx peak states and idle low power states:

 

rx -> idle -> rx -> idle ->rx... and so on.

 

My application runs in a task and it's main job is to collect events belonging from the GENFSK layer through its notification callback. The application flow is the following:

1- At the beginning the device is disallowed to sleep and perform a RX peak.

2- When the GENFSK notification callback receives a rx timeout event, a local event is bubbled to the application main task.

3- The application main task changes its state and call the PWR_GENFSK_EnterDSM(timeout )) + PWR_AllowDeviceToSleep(); (power mode 7), to make the radio entering in DSM and eventually will make the device enter into deep sleep.

4- When the wake-up event is notified by the GENFSK layer, the PWR_DisallowDeviceToSleep is called, and a local event is bubbled to the main task which will change it status in RX and so on

 

During the lifetime of this task we experienced systematic blocks. Investigating we found that some times the device exits from LLS3 power down without any reason. This is not depending on the timeout value passed to the PWR_GENFSK_EnterDSM API. If this happens probably the hadler of the power mode 7 fails to put the radio entering into DSM or it fails to put the device in LLS3. The block will be delayed, but it happens in any case, if we synchronize the Radio DSM timeout with the LPTMR timeout. We suspect that when the device fails to go in LLS3 is because the DSM timeout has some invalid values, for a reason currently unknown to us. From this consideration we apply a little "turnaround" which basically invalidate the mPWR_AbsoluteWakeupTimeInDsmTicks variable when the device exits from LLS3 with an invalid reason flag. Before to exit from the  PWR_HandleDeepSleepMode_7 handler, if the device has passed the enterLowPower check, we simply apply this:

...

 PWRLib_LLWU_UpdateWakeupReason();

 PWR_HandleGenfskDsmExit();
 PWRLib_LPTMR_ClockStop();

 

if(PWRLib_MCU_WakeupReason.AllBits == 0 ) {
             mPWR_AbsoluteWakeupTimeInDsmTicks=mPWR_DSM_InvalidTime_c;

}

 

....

It works and we tested 4h of working rx. However it will be better to understand why the device fails to enter in DSM. What could be the reason?

 

Bests,

Gerardo.

Outcomes