Deepsleep Wakeup Source Record

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

cross mob
shge_4395051
Level 4
Level 4
25 sign-ins 25 replies posted First solution authored

Hello

I would like to know if the source of a "wakeup" from deepsleep is stored somewhere.   I'm using the CY8CKIT-042-BLE-A.   I'm placing my system into deepsleep.  I configured the system to wakeup using a GPIO and then sleep after X amount of time. The system then goes back to sleep after a WDT expires and triggers an interrupt.  This works fine except that I experience a single early wakeup event after going to sleep.  The system will go back to sleep and then stay asleep until the GPIO triggers a wake up. 

in Summary, if I knew what caused the early wakeup it would help me solve the issue.

  

0 Likes
1 Solution
shge_4395051
Level 4
Level 4
25 sign-ins 25 replies posted First solution authored

Thanks I got it working.

View solution in original post

0 Likes
4 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

shge,

Usually the source of the wakeup is a HW interrupt source.  In this case, you can output a different framing pulse through GPIO pin from each ISR supported.  This is a visual way of determining what woke you up.

Another way is to use the debugger with breakpoints in the ISRs.

Consider this:  Before you go to sleep do you force a clearing of all wakeup interrupts?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
shge_4395051
Level 4
Level 4
25 sign-ins 25 replies posted First solution authored

Thanks I got it working.

0 Likes

shge,

Superb!   Can you share what you found with the forum?  This will potentially help others with a similar problem.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
shge_4395051
Level 4
Level 4
25 sign-ins 25 replies posted First solution authored

The below code is my main loop.  I removed the "Else if()"  leaving the all other statements in place.  Then the wakeup disappeared.  I cannot explain it really.  

for(;;)
{
CyBle_ProcessEvents();

if (CyBle_GetState() == CYBLE_STATE_CONNECTED)
{
/*My application. Run if connected*/
load();
}

else if ( timer_expired)

{

      ManageLowPower();

      /* Start Advertisement and enter Discoverable mode*/
      CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

}



}

0 Likes