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\u easy\u gap\u advertise\u stop to stop advertising

3.DA14580用“好的,我准备好了”确认MCU A,然后调用arch\u ble\u ext\u wakeup\u on()和arch\u set\u deep\u sleep()(我认为这应该使DA14580进入深度睡眠模式)

4.进入深度睡眠。

注意:代码在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\U对话框
Offline
Last seen:5 months 5 days ago
加入:2018-01-15 10:36
Hi Cgha,

Hi Cgha,

I'm checking internally and let you know asap.

比尔,保罗

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\U对话框
Offline
Last seen:5 months 5 days ago
加入: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.
我假设从周期性唤醒CFG\u MAX\u SLEEP\u DURATION\u EXTERNAL\u wakeup\u MS可以看到0.59mA,请将此值增加到10秒,例如,以查看影响。

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

请检查本教程:

//www.wsdof.com/sites/default/files/training_04_sle...

比尔,保罗

cgha
Offline
Last seen:5个月3周前
加入:2016-03-23 13:05
最大睡眠时间

最大睡眠时间_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:1 month 21 hours 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:1 month 21 hours 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
1.我可以确认我的所有应用程序

1.我可以确认我的所有应用程序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 get reset。

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

CYibin
Offline
Last seen:7 months 4 days 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 4 days ago
Staff
加入:2017-12-14 02:48
u r welcom~

u r welcom~