app_easy_timer can be used to wake up da from deep sleep mode?

10 posts / 0 new
Last post
achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-24 10:56
app_easy_timer can be used to wake up da from deep sleep mode?

in a post, it mentioned:
please note that ke_timer_set cannot wake the DA14580 from sleep modes : you can only do that with app_timer_set.
我检查通过app_easy_timer的编码,它looks like using ke_timer_set, so it can not be used to wake up? what is the difference between app_timer_set and ke_timer_set?
Peter

Device:
achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-24 10:56
please help

please help

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi achao1104,

Hi achao1104,

It seems that there is no essential difference between the two functions the only difference i can see is that the app_timer_set ensures that the delay time is less than the KE_TIMER_DELAY_MAX. Can you please indicate the post that is mentioning that you should not use ke_timer_set in order to wake up.

Thanks MT_dialog

achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-24 10:56
thanks, I have the same

thanks, I have the same thinking, let me find out the post.

achao1104
Offline
Last seen:5 years 3 months ago
Master
加入:2015-12-24 10:56
http://support.dialog
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi achao1104,

Hi achao1104,

I suppose that the post indicates that you should not use the ke_timer_set just for safety reasons not to exceed the maximum time constrain of the timers.

Thanks MT_dialog

Liang Yun Hao
Offline
Last seen:3 years 2 months ago
加入:2016-03-05 13:38
Hi, Dialog

Hi, Dialog
Is app_easy_timer still working when Da14580 in extend sleep? I set a app_easy_timer to wake up Da14580 from extend sleep periodically and then send a advertising package. It works fine when I set delay time is small (5s or 30s). But when I set delay value like 18000 or 24000 (below KE_TIMER_DELAY_MAX), it would wake up suddenly sometimes before timer expired and do nothing. I measure the current to check Da14580 is in extend sleep or not. What kinds of timer can be used in extend sleep, app_easy_timer or app_timer_set?
And how can I use app_timer_set to call a function like app_easy_timer after delay expired? Should I place the function in the handler ? Thanks.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi Liang Yun Hao,

Hi Liang Yun Hao,

Yes the timers are still working when the device is extended sleep, regarding what you are experiecing i suppose what you are seeing is the periodic waking up of the device, the device is configured to wake up every 10 seconds if there is no BLE activity (the kernel timers are considered also BLE activity). So the device waking up every 10 seconds do nothing, and fall back to sleep until your timer elapses is expected.

The app_easy_timer() is the proper function in order to use the ke_timers in SDK5, the app_timer_set is just an older api from previous SDKs and most of the SIG profiles provided by dialog are still using this api in order to set a timer, in order to use the app_timer_set you can have a look in how the BAS profile which implements this api for updating the value on the client, although i dont see any reason for using that api.

Thanks MT_dialog

Liang Yun Hao
Offline
Last seen:3 years 2 months ago
加入:2016-03-05 13:38
Hi, Dialog

Hi, Dialog
In my custom board, it did not wake up exactly 10 seconds. Sometimes it wake up immediately after it enter extend sleep. Sometimes it work fine for a long time and wake up suddenly.
The time it takes is not predictable. I have set CFG_MAX_SLEEP_DURATION_EXTERNAL_WAKEUP_MS to 300000 and still has the same problem.
在我的应用程序中,我使用两个内核mer. One is set to 3 seconds and it stop advertising (app_easy_gap_advertise_stop). When the advertising stop, "user_app_adv_undirect_complete" callback function will set the other timer for certain time(1mins or longer) and then system enter extend sleep. In theory, Da14580 will wake up when the second timer expired and go on the step described above. What else should I do when I set app_easy_timer or I do something wrong with the above steps? Do I need cancel it when it expired? Thanks.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi Liang Yun Hao,

Hi Liang Yun Hao,

What is the LP clock that you are using, is it the XTAL32 or the RCX ?

The steps you are following are proper, and no you dont have to cancel the timer when it has elapsed, by replicating your configuration i am not able to replicate what you are experiencing by using the XTAL. Try to do the same configuration in the barebone example, just remove the app_easy_timer() from the user_app_adv_undirect_complete() and replace it with a timer that will count up to the advertising function. Perhaps the device is waking up by an external interrupt or something else.

In case that you are using the RCX and you see that the device is waking up and falling back to sleep, this is a known issue, please have a look at the below thread and check the code snippets in the last posts.

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...

Thanks MT_dialog