嗨对话框,
1.i使用'app_easy_gap_undircated_advertise_with_timeout_start(uint16_t延迟,void(* timeout_callback)'要做广告,然后在10秒后关闭它(延迟为10s),我在'静态void中添加'arch_set_sleep_mode(arch_set_sleep_mode(arch_deep_sleep_on)'app_easy_gap_advertise_stop_handler(void)'使da14580进入深睡眠,但它不会进入深睡眠。在DA14580可以进入深睡眠之前,我还需要关闭其他进程或功能吗?
以下是我固件的代码:
void app_easy_gap_undirected_advertise_with_timeout_start(uint16_t delay, void (*timeout_callback)(void))
{
//停止当前运行的计时器
if(adv_timer_id!= easy_timer_invalid_timer)
app_easy_timer_cancel(avd_timer_id);
if(timeout_callback!= null)
adv_timeout_callback = timeout_callback;
avad_timer_id = app_easy_timer(delay,app_easy_gap_advertise_stop_handler);
app_easy_gap_undirected_advertise_start();
}
static void app_easy_gap_advertise_stop_handler(void)
{
app_easy_gap_advertise_with_timeout_stop();
app_easy_gap_advertise_stop();
adv_timer_id = app_easy_timer(sleep_timeout,app_timeout_callback);
ARCH_SET_SLEEP_MODE(ARCH_DEEP_SLEEP_ON);
}
2.如果我将'app_easy_gap_undircted_advertise_start()'更改为'app_easy_gap_non_connectable_advertise_start()',则DA14580可以成功输入深度睡眠模式。是否不同的广告类型定义可以遵循的睡眠或空闲模式?
3. I find this section of code keeps DA14580 in idle mode. How can I know which KERNEL EVENTS are still on going (preventing deep sleep mode)?
rwip.c (Line323)
/ ************************************************************************
**************检查内核活动**************
************************************************************************ /
//检查某些内核处理是否正在进行中
如果(!KE_SLEEP_CHECK())
break;
//可以启用处理器睡眠
proc_sleep = mode_idle;
dbg_swdiag(睡眠,algo,1);
4.如果我知道哪个事件仍在继续,我可以直接终止内核事件进入深度睡眠模式吗?
5. Can I force deep sleep mode even if I cannot identify or terminate the Kernel Events?
SDK5.0.3
Thanks
Hi RexDevelopment,
除了将App_default_sleep_mode更改为Arch_Deep_sleep_On和Off Course还是更改内存配置也没有其他进程或更改它所需的,以便设置FW以便深入睡眠。你怎么知道该设备无法深入睡眠,通过功耗检查它?你看到设备在广告上继续?另请注意,为了获得适当的功耗和测试深度睡眠模式,您必须使用#undefine CFG_Development_Debug并将图像中的图像烧毁,并与彩色应用程序标志一起烧毁OTP中的图像。亚博国际官网平台网址关于代码,app_easy_gap_undirected_advertise_with_timeout_start()将启动广告并设置计时器以完成广告过程,何时发生计时器,当时会发生App_easy_gap_advertise_stop_handler()以便停止广告并触发用户可能附加的回调。我没有得到你想在修改的app_easy_gap_advertise_stop_handler()中要做的事情,但是你再次在甚至停止前一个之前再次调用广告功能,并且您设置了计时器以便在指定时间唤醒。您可以尝试的是在app_easy_gap_undirected_advertise_with_timeOut_start()中的一个unull函数作为回调,通过一个将设置一个计时器的函数,该函数将计算下一个唤醒并将发起广告,如下所示:
void set_the_timer(void)
{
app_easy_timer(1000, default_advertise_operation);
}
app_easy_gap_undirected_advertise_with_timeout_start(user_default_hnd_conf.advertise_period,set_the_timer);
没有祝福,不会允许你go to sleep, the device will wake up and sleep depending on BLE events that it has available, for example sleep wakeup and advertise go back to sleep, there is no event that will keep the device awake for long unless there are multiple events that the device needs to serve and sleeping is out of the question. The cancelling of the sleep mode can be done only from the application side. The device will have to serve the events available and then go to sleep. I ve tried to replicate your code and in the app_easy_timer() that you set in the app_easy_gap_advertise_stop_handler() the device stalls by a timer assertion.
Also regarding your implementation you can also have a look at the ble_app_sleepmode and change wake up button with a kernel timer in order to implement this.
谢谢mt_dialog.
Hi MT_dialog,
Thanks for your reply. I use VAM (current meter) to measure the current consumption. When DA14580 enters deep sleep mode, we read ~10uA from VAM. If DA14580 does not enter sleep, we read ~550uA from VAM. we also use mobile phone to check whether DA14580 is advertising.
在我们的固件中,我们的循环需要从 - AredFortise - >深睡眠 - >信标 - >深睡眠。
For our application, we have to make DA14580 do a cycle 'app_easy_gap_undirected_advertise_start()', sleep mode and 'app_easy_gap_non_connectable_advertise_start()', so I can not base my firmware on reference design architecture.
1.)我可以使da14580进入深度睡眠模式吗?
2.)只要确认,DA14580只能进入“深度睡眠模式”如果图像被刻录为“OTP”?我目前在我们的光线上使用闪存,并且在睡眠/唤醒周期的部分时,电流达到10ua。我还观察到EVB上的10UA,具有相同的固件。我错过了什么?
谢谢,
亚历克斯
Hi RexDevelopment,
1)没有额外的方法可以将设备放入深度睡眠中,即我已经提到了。根据默认睡眠模式的设备将照顾睡眠并唤醒。10UA对于深度睡眠模式是相当多的一些,也许额外的电流来自您在自定义PCB上或在Dev套件上连接的另一个模块。由于我可以看到您的电路板上有闪光灯,可能额外的电流来自闪光灯。
2)是的,测试深度睡眠模式的唯一方法是刻录OTP并不要忘记拒绝CFG_Development_Debug,因为您没有设备不会强大的Sysram,它会像你一样延长睡眠。
谢谢mt_dialog.