Can I manually set the sleep mode to deep sleep when app_default_sleep_mode = ARCH_EXT_SLEEP_ON ?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
13 posts / 0 new
Last post
cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
Can I manually set the sleep mode to deep sleep when app_default_sleep_mode = ARCH_EXT_SLEEP_ON ?

I just want my system works at app_default_sleep_mode = ARCH_EXT_SLEEP_ON, but after some condition match, I should close ble and put the system in deep sleep mode. The process is like:

1. Another mcu named MCU_A put a cmd on spi like "you should put into deep sleep mode"

2. DA14580检查蓝牙是否是广告或连接的:如果已连接,请断开连接,并且不会在断开连接的回调中重新启动广告;如果是广告,只需调用app_easy_gap_advertise_stop即可停止广告

3. DA14580 ACK与“确定,我已经准备好”,然后调用ARCH_BLE_EXT_WAKEUP_ON()和ARCH_SET_DEEP_SLEEP()。(我认为这应该将DA14580放在Deep_sleep模式中)

4. MCU_A把自己放在Deep_sleep上。

注意:代码在OTP上运行。

But sometimes, DA14580 seems been waked up after sleeped a few seconds, there is no advertising, but the whole system current grows to 0.59mA.

DA14580将自己置于深睡眠之后可能发生的事情?看门狗发射了吗?或者一些计时器仍在运行展现DA14580?

Device:
ps_dialog.
Offline
Last seen:5个月1日前
加入:2018-01-15 10:36
Hi Cgha,

Hi Cgha,

I'm checking internally and let you know asap.

BR, Paolo

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
Where Can I get the reason

Where Can I get the reason for wakeup? I now set an breakpoint after the WFI(), and yes the DA14580 waked up after I let it go into deep sleep.

So now I want to get the wakeup reason to locate my source code bug.

ps_dialog.
Offline
Last seen:5个月1日前
加入:2018-01-15 10:36
Hi Cgha,

Hi Cgha,

Please kindly let me know if you are following the proper procedure to send the system in deep sleep.
Information can be found in SDK5.0.4 proximity reporter - code to follow button_enable API.
我假设从周期唤醒的0.59mA中看到CFG_MAX_SLEEP_DOURATION_EXTERNAL_WAKEUP_MS,请将此值增加到10秒,例如查看影响。

Watchdog if enabled that can be observed in a later stage.

请查看此教程:

https://www.dialog-seminile.com/sites/default/files/training_04_sle ...

BR, Paolo

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
cfg_max_sleep_duration.

cfg_max_sleep_duration._EXTERNAL_WAKEUP_MS is 10S by default and I've not changed this value. The system should be ready to go to deep sleep after ble adv and connection have been stopped.

Note: No app timer is running when fall into deep sleep.

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
If I just comment out the

If I just comment out the arch_set_deep_sleep(use the default extend sleep), it is OK(there is no gliches on the IRQ pin after sleep and so will not be awaked), if I set it to deep sleep, the irq pin will have some gliches after sleeped for seconds and I guess the application be awaked by these glitches, and so on system crash( since my system is wait for MCU_A to reset DA14580 after it totally fall into sleep). I do not know whether the glitches is caused by wakeup or just been reseted. I've used the oscilloscope to see if the reset is asserted by MCU_A, there is no reset signal after it fall into deep sleep.

LC_Dialog
Offline
Last seen:3 weeks 6 days ago
Staff
加入:2016-09-19 23:20
Hi cgha,

Hi cgha,

您可以使用范围检查活动的UART TX线,并查看是否有任何内容。如果设备醒来,那么可能存在一些引导加载程序发送啁啾活动

此外,您是否可以确认您是否遵循了我们在教程中的说明来设置深度睡眠内存配置。
This ensures the right memory is selected and you've to make sure you are not allocating any heap memory before setting to deep sleep mode. Otherwise, the system will not go into deep sleep. If that is the case, the code will fail at ke_mem_is_empty(KE_MEM_NON_RETENTION),
除此之外,我还建议您在设置深度睡眠模式之前监控任何活动BLE操作。看着你的一个评论,用WFI唤醒的设备意味着设备根本没有进入深度睡眠模式,或者唤醒它。我相信来自这些信息,设备不会深入睡眠。

此致,
LC_Dialog

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
My system use extend sleep at

My system use extend sleep at normal time, at last step, if MCU_A ask DA14580 to enter into deep sleep, then it fall into deep sleep. After it enter into deep sleep , it should not be waked up, it is waiting MCU_A to reset it.

LC_Dialog
Offline
Last seen:3 weeks 6 days ago
Staff
加入:2016-09-19 23:20
Hi cgha,

Hi cgha,

I understood what you want to do in the system design. Can you please try the above steps I have mentioned in my previous comment. That information will help us narrow down the root cause of the issue you are facing and it might be solved by one of the steps..

此致,
LC_Dialog

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
我可以确认我的所有应用程序

我可以确认我的所有应用程序timer has been canceled before enter sleep.

2. I can confirm I have disabled the gpio wakeup using wkupct_disable_irq() before enter sleep;

3. I can confirm I have called arch_ble_ext_wakeup_on before enter sleep.

4.现在我测试使用延长睡眠而不是深睡眠,在进入睡眠前设置一个标志,然后在唤醒后检查此标志,如果设置此标志,则调用看门狗重置,测试结果是DA145480获得重置。

Do you have an email ? I can send you my project to help me to check.

CYibin
Offline
Last seen:7 months 7 hours ago
Staff
加入:2017-12-14 02:48
Hi cgha,

Hi cgha,

我们有中国论坛,用户可以使用中文与我们讨论。

Do you think it is necessary that let's going on discussing on China forum?

如果是的,请打开一个新线程来描述your question:

https://support.dialog-semiconductor.com/forums/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software-dialog-%E2%80%9Csmartbond%E2%80%9D%E7%B3%BB%E5%88%97%E4%BD%8E%E5%8A%9F%E8%80%97%E8%93%9D%E7%89%99%E2%80%94%E8%BD%AF%E4%BB%B6

Br

宜宾

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
好的,我会打开一个新的线程

好的,我会打开一个新的线程on Chinese forum. Thanks, YiBin and LC_Dialog.

CYibin
Offline
Last seen:7 months 7 hours ago
Staff
加入:2017-12-14 02:48
u r welcom~

u r welcom~