延长睡眠模式禁用/启用

Learn More常见问题解答教程

13 posts / 0 new
最后一篇
AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
延长睡眠模式禁用/启用

嗨,

我正在尝试使用DA14581 MOD板在我的定制板上延长睡眠。设置如下:

The system is initially configured with extended_sleep without OTP Copy. The wakeup is configured on a button interrupt, which does wake the system up on first press. Upon wakeup, the sleep is disabled (using arch_disable_sleep) so I can sample a sensor every 100ms using the timer0. The extended_sleep is then meant to be re-enabled after 7 seconds.

在定义的时间段(〜3-4秒)之后,系统似乎只是决定它应该返回到Extende_sleep,它永远不会重新启用它,并且根据Arch_Get_Sleep_Mode睡眠模式关闭(0)。当然,Timer0不再运行,因此传感器不再被采样。

If I configure the system to not use extended_sleep then everything works as expected. As well, this system with extended_sleep works fine when running off RAM (using KEIL debug), but not when using the flash.

你有什么想法造成这个吗?

Thanks

Device:
AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
I had set the default

我已经设置了default_operation_adv = null,而不是user_app_adv_start,因为所有其他示例都已。一旦它返回到User_App_Adv_Start,那么在广告正在运行时它就在Flash中正常工作。如果我等到广告完成以按下按钮,那么再次冻结。基于当前消耗时,它冻结时,它看起来它实际上不是在Extended_sleep模式下,实际上仍处于活动模式,只是粘在某个地方。

Do you have any ideas on why this is? From my perspective all this changed is it advertising at the beginning versus not, but it seems to affect more than just that.

PM_DIALOG.
离线
最后一次露面:16 min 18 sec ago
员工
加入:2018-02-08 11:03
嗨adamshier,

嗨adamshier,

感谢您在线的问题,为了您对我们的微小模块解决方案的兴趣,让我更改初始帖子的设备选择,因为选择了DA14581而不是DA14531微型模块。

Please correct if my understanding in wrong : the module is configured in EXT Sleep mode with OTP copy upon system initialization - user_app_init() callback – and the wake-up controller is also enabled in order to wake-up the system via a GPIO trigger. When the chips wake-up, can you please indicate if it also starts advertising ? Do you call the user_app_adv_start() callback?

>>>After a defined period of time(~3-4 seconds), the system seems to just decide it should go back into extended_sleep, eventhough it was never re-enabled

所以,如果从系统RAM启动,可以在设备决定睡觉后GPIO触发后唤醒它?

请检查计时器是否会导致“自动”睡眠?您使用哪种SDK项目作为开发自己的应用程序的引用?

>>>Based on the current consumption when it freezes, it looks like its not actually in extended_sleep mode, and actually still in active mode, just stuck somewhere.

会possible to run it in debug mode and check if it the code breaks into an assertion, NMI etc.?

如果default_operation_adv = user_app_adv_start,那么DA4531将在系统初始化后自动启动广告。

谢谢,PM_DIALOG.

AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
模块配置在

模块配置在ext_sleep_mode没有OTP Copy,User_App_Init用作.app_on_init,唤醒控制器配置为使用GPIO作为从按钮唤醒。当芯片唤醒它不会启动广告时,因为我已经纯化了那个方面。user_app_adv_start()只有当某人保存按钮10秒时只调用回调。

I can wake it up the first time from the sleep with the GPIO trigger. Once it wakes up it will freeze after the 3-4 seconds, unless advertising is enabled, in which case everything will work fine.

在调试模式下运行的问题是,在调试模式下,一切都正常工作,但在从闪存中运行时不正常工作。

我理解default_operation_adv = user_app_adv_start的方面自动启动广告。我只是不确定为什么似乎在定义时期后冻结的代码的行为似乎改变了代码的行为,而不是预期工作。

In terms of a base project that it is similar to, it would be a combination of the user_peripheral one and the proxy one for the sleep modes.

AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
如果我的话,代码也很好

如果我使用app_easy_timer()而不是将Timer0设置为计数器,则代码也正常工作。我知道Timer0在扩展睡眠模式下禁用,但我在唤醒按钮时使用Arch_disable_sleep(),所以我不明白为什么这将是一个问题。

Upon wakeup from the button the timer is fully reinitialized/configured so it seems to be starting properly, but after some time the code just stops.

编辑:这次从按钮唤醒,直到冻结为2.7秒,非常一致。它绝对不睡觉,当发生冻结时,运行电流从200ua到300ua上升。

PM_DIALOG.
离线
最后一次露面:16 min 18 sec ago
员工
加入:2018-02-08 11:03
嗨adamshier,

嗨adamshier,

You are right – the timer0 is off when the device is sleeping, as all the peripheral blocks. You can use the app_easy_timer() to wake up periodically because it’s using the BLE timer. Can you please check if the device is sleeping between the advertising intervals? I

>>>在调试模式下运行的问题是一切都在调试模式下正常工作,但在从闪存中运行时没有。

When the debugger is attached, this prevents the system to go into any of sleep modes.

您能否澄清一下你的意思是在定义的时间内冻结的装置?

Since you are booting from flash, you could use the arch_printf() in order to print some debugging information in a serial terminal.

谢谢,PM_DIALOG.

AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
When using the flash to boot,

When using the flash to boot, the device definately goes to sleep when I'm not pressing the button or inbetween advertising, sleep current drops to ~10uA.

I am using printf in order to determine that it is frozen. When the button is pressed, sleep is disabled, and the timer0 is started and generates an interrupt every 100ms. All the interrupt handler does is print an incrementing index. The incrementing index works for 2.7 seconds, until it just stops, that's how I know it freezes consistently after 2.7 seconds.

AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
这或多或少解决了。

这或多或少解决了。我并不完全了解为什么它在2.7秒后冻结,或者为什么在启用广告时它正在运行,但它在我删除的时候正常工作

如果按钮中的(ARCH_BLE_EXT_WAKEUP_GET())按回调。我认为它在示例项目中,因为该按钮开始了广告,它只评估广告完成后的真实情况。所以对于我的项目来说,它没有意义。

PM_DIALOG.
离线
最后一次露面:16 min 18 sec ago
员工
加入:2018-02-08 11:03
嗨adamshier,

嗨adamshier,

The WDOG time out is around 2.6sec by default, so I assume that the WDOD timer expires.

Did you run is with the debugger attached? You should also have the development debug enabled - CFG_DEVELOPMENT_DEBUG.

谢谢,PM_DIALOG.

AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
The wdog is not defined in

The wdog is not defined in the config file, but those times seem too close to be a coincidence. The CFG_DEVELOPMENT_DEBUG is defined. The problem occurs when running from flash, and occurs whether or not the debugger is attached.

PM_DIALOG.
离线
最后一次露面:16 min 18 sec ago
员工
加入:2018-02-08 11:03
嗨adamshier,

嗨adamshier,

Could you please define the WDOG and run it in debug mode? If you run it from System-RAM in normal mode (without the debugger attached), can you replicate this behavior? When the debugger is attached, this blocks the system to sleep.

谢谢,PM_DIALOG.

AdamShier
离线
最后一次露面:3周5天前
加入:2020-07-30 18:04
所以我尝试了启用

所以我尝试启用看门狗,这也似乎也解决了它,而不是删除唤醒回调中的Arch_ble_ext_WakeUp_get的检查。我会总结一下人民的组合:

If you have

if (arch_ble_ext_wakeup_get())
{
arch_ble_force_wakeup();
ARCH_BLE_EXT_WAKEUP_OFF();
app_easy_wakeup();
}

并且您想在某个时期禁用睡眠,然后在稍后重新启用睡眠,然后必须启用看门狗。否则唤醒后,代码将在看门狗超时后冻结,仍然不确定为什么。还有情况下广告已启用,然后在设备广告时它将起作用,然后在完成后将再次冻结,因此无限广告您没有看到此问题。

PM_DIALOG.
离线
最后一次露面:16 min 18 sec ago
员工
加入:2018-02-08 11:03
嗨adamshier,

嗨adamshier,

Thanks for your indication and glad that you got it working.

谢谢,PM_DIALOG.