Deep Sleep wake up with WDT, incompatible with CYBLE_BLESS_DEEPSLEEP?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jumic_1610531
Level 1
Level 1
First like received

                CyBle_ProcessEvents();                      // service BLE stack events

                CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);      // put BLESS into lowest power mode

                intrStatus = CyEnterCriticalSection();      // disable interrupts

                blessState = CyBle_GetBleSsState();         // get current BLESS state

                if(blessState == CYBLE_BLESS_STATE_ECO_ON || blessState == CYBLE_BLESS_STATE_DEEPSLEEP)

                {

                                CySysPmDeepSleep();                     // 1.3uA current consumption

                }       

                else if (blessState != CYBLE_BLESS_STATE_EVENT_CLOSE) // BLESS is active

                {

                                CySysPmSleep();                         // ~1.6mA current consumption

                }

                CyExitCriticalSection(intrStatus);          // re-enable interrupts

Looking at the code snippet above and using a PROC 4 BLE, is it right to say I cannot use the WDT to wake the device if the BLE peripheral is in Deep sleep? It will have to be a BLE event that wakes the device (i.e. advertising) because Global interrupts have to be turned off when the BLESS goes into deep sleep?

If I want to wake from Deep Sleep using the WDT is it better to turn off the BLE component  with CyBle_Stop() (there are no connections), then System Deep Sleep, then wake with WDT, then CyBle_Start (). Is this my only option to wake up with a WDT?

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

In the code snippet, Critical section is bound by the CyEnterCriticalSection() function at the beginning and the CyExitCriticalSection() function at the end, these two functions are used to avoid the corruption of processor state before entering into the deepsleep mode. When the system is in deepsleep mode then interrupt sources like WDT interrupt, BLESS interrupt will wakeup the device.

If you only want the WDT interrupt to wakeup the device from deepsleep mode then you can stop the BLE before entering into deepsleep.

Thanks,

P Yugandhar.

View solution in original post

0 Likes
1 Reply
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

In the code snippet, Critical section is bound by the CyEnterCriticalSection() function at the beginning and the CyExitCriticalSection() function at the end, these two functions are used to avoid the corruption of processor state before entering into the deepsleep mode. When the system is in deepsleep mode then interrupt sources like WDT interrupt, BLESS interrupt will wakeup the device.

If you only want the WDT interrupt to wakeup the device from deepsleep mode then you can stop the BLE before entering into deepsleep.

Thanks,

P Yugandhar.

0 Likes