- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using CYBLE-014008-00 and I have an issue with the BLE deep sleep.
Basically, I'm waking up every 40 ms to start a PWM that lasts 1 ms, get a timer sample and add it to my buffer, then I go to deepsleep until the next WDT interrupt. When I have enough samples, I send a notification with the data. The system works perfectly, but every ~45 seconds, the following line doesn't let me go to deepsleep for 125-240 ms, only to sleep.
sleepMode = CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);
I've attached a screen capture of my logic analyzer. Here are the signals :
dpslp_sleep: When CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP) returned SLEEP instead of deepsleep
dpslp_dpslp: When entering deepsleep after CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP)
sleep: when entering sleep after CyBle_EnterLPM(CYBLE_BLESS_SLEEP)
dpslp_sleep_event: when entering sleep instead of deepsleep because of a pending event in the application that requires HFCLK
PWM start: self explanatory
PWM stop: self explanatory
ADC timer: self explanatory
CyBle_Process: Before and after entering CyBle_ProcessEvents();
As you see, every ~45 seconds, the first signal (dpslp_sleep) will go to high and toggle there for a duration of 125-240 ms a couple of times, meaning that I don't go to deepsleep. I could go to sleep, but it results in peaks of current. I'd much rather go to deepsleep. Here is a zoom of the same figure:
Isn't this a really long time to not be able to go to deep sleep? Is this normal?
Thank you,
Fred
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it working by never going to sleep when CyBle_EnterLPM(CYBLE_BLESS_SLEEP) returns CYBLE_BLESS_SLEEP instead of CYBLE_BLESS_DEEPSLEEP. I figured that if the BLESS does not return CYBLE_BLESS_DEEPSLEEP, it's because it's busy with a BLE transaction.
So what happens now is I stay awake for a little bit more by polling CyBle_EnterLPM(CYBLE_BLESS_SLEEP) a bit, but I'm able to go to sleep and then deepsleep.
Thank you for your time,
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Fred,
Apart from the WDT interrupt the BLESS interrupt ( .cydwr-> Interrupts ) will also wake up the BLESS as well as System from the DeepSleep at every connection/advertising interval.
Please confirm the issue keeping in mind both WDT and BLESS Interrupt or any other interrupt source , if they are preventing to go the BLESS in DeepSleep.
Please attach the project here if you have any observations/further queries.
Regards,
Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yes, I took that into account. I can see the device waking up every connection interval (240 ms), but the 125-240 ms of staying awake every 45 seconds doesn't look like it's related, except for the longer timer (240 ms) being equivalent to the connection interval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it working by never going to sleep when CyBle_EnterLPM(CYBLE_BLESS_SLEEP) returns CYBLE_BLESS_SLEEP instead of CYBLE_BLESS_DEEPSLEEP. I figured that if the BLESS does not return CYBLE_BLESS_DEEPSLEEP, it's because it's busy with a BLE transaction.
So what happens now is I stay awake for a little bit more by polling CyBle_EnterLPM(CYBLE_BLESS_SLEEP) a bit, but I'm able to go to sleep and then deepsleep.
Thank you for your time,
Fred