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:
Hi Cgha,
I'm checking internally and let you know asap.
比尔,保罗
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.
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...
比尔,保罗
最大睡眠时间_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.
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.
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
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.
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
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.
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
宜宾
好的,我会打开一个新的线程on Chinese forum. Thanks, YiBin and LC_Dialog.
u r welcom~