DA14681进入休眠状态,但在2次唤醒后它不会再进入休眠状态?

⚠️
你好。。谢谢你来参加论坛。令人兴奋的消息!我们现在正在移动到我们的新论坛平台,将提供更好的功能,并包含在主对话网站的过程。所有帖子和账号都已迁移。我们现在只接受新论坛上的流量-请在//www.xmece.com/support. 我们将在未来几天内修复bug/优化搜索和标记。
16 posts / 0 new
最后一篇文章
马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
DA14681进入休眠状态,但在2次唤醒后它不会再进入休眠状态?

Hi dialog

I am working on custom board based on DA1468x i am using command

pm_resume_sleep();
pm_set_sleep_mode(pm_mode_hibernation);

让它冬眠。它进入休眠和唤醒与外部GPIO中断,但唤醒2次后,它不进入休眠。

休眠模式是将设备运送给客户的,这与此逻辑有关吗。当客户在设备上时,那么这段代码是否被禁用?

我的理解正确吗?

关键词:
Device:
PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

Can you please indicate where you are using the pm_resume_sleep() and the pm_set_sleep_mode() APIs? In order to put the device in hibernation mode, you should use the pm_set_sleep_mode(pm_mode_hibernation). Be aware that hibernation mode is a special mode to be used for shipping the final product to market without draining the battery. This is what is used for shipping and storing the final product and I would not recommend you the hibernation for development or debugging scopes. So, if your product is not for shipping, g I would suggest you to use the sleep mode as extended sleep into the system_init() and the reason is that when the system wakes up from the hibernation, the system resets and runs from the start. This is not a software reset, it’s like a hardware reset, so the system will run the code from the start and the system_init() will be executed again (every time that the 680 wakes up from the hibernation. Also, the pm_resume_sleep will Restore the sleep mode of the system, which has been blocked via a call to pm_stay_alive()If you could provide more inputs regarding this issue, it would be very helpful.

谢谢,下午好

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
我明白了

我知道休眠是为了生产运输的目的,但我想在我的设备中添加一个功能,当电池达到一定电压时将其休眠,然后在连接充电器时将其唤醒,这可以通过GPIO进行检测。

我只想要实现这个的方法。

Thanks

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

Can you please indicate where in you code you are using the pm_set_sleep_mode(pm_mode_hibernation)? As you mentioned in your initial post, the device can enter the hibernation mode. But what is happening after the 2 wakes up? Can you please provide me some extra inputs?

谢谢,下午好

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
Right after i enter pxp

我使用pxp_reporter和后进入pxp_reporter task ,, i check the VBAT voltage using ADC and then i use these two commands.

pm_resume_sleep();
pm_set_sleep_mode(pm_mode_hibernation);

我要问的是进入休眠模式需要满足两个条件

1-系统必须进入睡眠模式

2-VBAT必须低于dg\配置电池\低\电平

?

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

由于您在设计中使用电池,如果电压下溢,系统将自动进入休眠模式。查看SDK,它是唯一一个监视连接的电池电压水平的地方,位于sys\u power\u mgr.c文件中的apply\u wifi()例程中。请搜索“电压下溢检查”注释。如果电池电压过低(在dg\ U configBATTERY\ U low\级别下),usb\ U charger\ U is\ U battery\ U low()将返回true。为此,如果low\u vbat为真,则当前睡眠模式将更改为休眠。查看FreeRTOSConfig.h文件,configPRE\u STOP\u PROCESSING()宏为空,因此您可以在此处挂接自己的功能。为了声明钩子函数,请检查以下实现:

在custom_config_qspi.h文件中,声明电池电压阈值以及电池类型:

#define dg_configBATTERY_LOW_LEVEL(4000)//将阈值设置为更高的电源

#define dg_configBATTERY_TYPE (BATTERY_TYPE_CUSTOM)

在FreeRTOSConfig.h文件中声明钩子函数。例如:

#define configPRE_STOP_PROCESSING( x ) my_custom_callback_low_battery( x )

在您选择的文件中,例如main.c中,声明钩子函数。

在sys\u power\u mgr.c文件中的apply\u wifi()例程中,相应地修改configPRE\u STOP\u PROCESSING宏:

如果(睡眠周期==0){

// A user definable macro that allows application code to be added.

configPRE_STOP_PROCESSING(pm_current_sleep_mode);//把你选择的论点传过来

}其他{

// A user definable macro that allows application code to be added.

configPRE_SLEEP_PROCESSING( sleep_period );

}

The condition (vbat_level < dg_configBATTERY_LOW_LEVEL) is true and thus, the device enters hibernation mode. Please note that there should not be any charger plugged-in (on VBUS) in order for the device to enter hibernation mode. If you are using the hibernation mode by yourself, if you have BLE activity or any other pending interrupts, the system will not be able to go into hibernation.

谢谢,下午好

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
Thanks alot dialog.

Thanks alot dialog.

I ll implement it , if any problem comes i ll reply to this post.

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
我试过上述方法,但

我试过上述方法,但system is not entering sleep.

所以我所做的是,我用了这段代码,每6秒检查一次VBAT,如果VBAT低于建议的电压。它进入睡眠状态。

这个方法的问题是我需要等待2-3秒才能将系统置于休眠状态,否则它将进入休眠状态并重新启动。

g_VBAT_check_counter++;
如果(g\u VBAT\u check\u counter>=10)
{
battery_source bat=ad_battery_open();
raw_vbat=ad_battery_raw_to_mvolt(bat,ad_battery_read(bat));
如果(原始值<=3000)
{
printf(“\nHibernating\n”);
fflush(stdout);

系统看门狗通知(wdog id);
OS_DELAY_MS(2000);//做任何事都可以得到自由
pm_resume_sleep();
pm_set_sleep_mode(pm_mode_hibernation);
}
g_VBAT_check_counter=0;
}

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

你能每6秒取下一次电池读数,然后再次测试以上的实现吗?默认情况下,在apply\u wfi()中,电压下溢检查将关闭。您使用的是哪个SDK?

谢谢,下午好

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

你能每6秒取下一次电池读数,然后再次测试以上的实现吗?默认情况下,在apply\u wfi()中,电压下溢检查将关闭。

谢谢,下午好

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
Yes i have tested this and

Yes i have tested this and now it is working perfectly.

Thanks dialog

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

很高兴所提供的实现正在工作,并感谢您接受我的回答。

谢谢,下午好

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
我还有一个问题

我还有一个问题with any approach, DA14681 goes into hibernation and stay in hibernation if it has been in normal for loop of PXP Reporter. Before that loop at startup while entering 1st time in PXP reporter, if i try to make it hibernate, It hibernates and then restarts again. Do know the reason of this,

PXP Reporter与示例FW中的相同。我正在使用该项目作为我的项目的基础项目。

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

你能澄清一下你所说的“PXP Reporter的正常循环”是什么意思吗?

谢谢,下午好

马赫迈德106
离线
最后一次见到:2周5天前
已加入:2019-05-03 17:28
在pxp\u任务函数中

在pxp\u任务函数中

对于(;;)

This is the main loop which i am talking about

PM\U对话框
离线
最后一次见到:5小时10分钟前
工作人员
已加入:2018-02-08 11:03
你好,mahmed106,

你好,mahmed106,

I assume the you are putting explicitly the DA14681 and the pm_set_sleep_mode(pm_mode_hibernation) is called out of mail loop. I f yes, can you please indicate where are you using this API? Probably the system cannot hibernate due to a pending interrupt.

谢谢,下午好