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

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
16 posts / 0 new
最后一篇
Mahmed106.
离线
最后一次露面: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);

把它放在冬眠中。它进入了Hiberanation和外部GPIO中断的唤醒,但在醒来后2次,它不会进入冬眠。

与休眠模式用于客户的船舶设备是逻辑的逻辑。当客户在设备上时,那么禁用此代码的此零件?

我的理解是对吗?

关键词:
Device:
PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入: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.

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面:2周5天前
加入:2019-05-03 17:28
我已经明白了

我已理解,休眠是用于生产送货目的,但我想在电池达到一定电压时为我的设备添加一个功能,然后当连接充电器时唤醒它,这可以通过GPIO来检测。

我只想要实现这个方法。

Thanks

PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入: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?

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面: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_CONFIGBattery_LOW_LEVEL

PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

由于您在设计电池时,如果电压下溢,系统将自动进入休眠模式。查看SDK,唯一的位置,在Sys_Power_Mgr.C文件中应用于Imply_Wifi()例程中的附加电池的电压电平。请搜索“电压下溢”评论。如果电池电压太低(在DG_CONFIGBattery_LOW_LEVEL下),USB_CHAR_IS_Battery_LOW()将返回true。为此,如果Low_VBAT为TRUE,则将更改为休眠的当前睡眠模式。查看freertosconfig.h文件configpre_stop_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_power_mgr.c文件中的应用程序_wifi()例程中,相应地修改configpre_stop_processing宏:

if(sleep_period == 0){

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

configpro_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.

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面: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.

Mahmed106.
离线
最后一次露面:2周5天前
加入:2019-05-03 17:28
我尝试过的方法,但是

我尝试过的方法,但是system is not entering sleep.

所以我所做的就是我已经使用了这段代码,在每6秒之后检查VBAT,如果VBAT很低,那么推荐电压。它进入睡眠。

这种方法的问题是我需要等待2-3秒钟将系统放在赫涅纳塔顿中它进入休眠并重新启动。

g_vbat_check_counter ++;
if(g_vbat_check_counter> = 10)
{
battery_source bat = ad_battery_open();
RAW_VBAT = AD_Battery_RAW_TO_MVOLT(BAT,AD_Battery_read(BAT));
if(raw_vbat <= 3000)
{
printf(“\ nhibernating \ n”);
fflush(stdout);

sys_watchdog_notify(wdog_id);
os_delay_ms(2000);//做所有事情并获得免费
pm_resume_sleep();
pm_set_sleep_mode(pm_mode_hibernation);
}
g_VBAT_check_counter=0;
}

PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

您能否每6秒删除电池阅读,并再次测试上述实施?默认情况下,电压下溢检查将在Apply_WFI()中。您使用的是哪个SDK?

谢谢,PM_DIALOG.

PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

您能否每6秒删除电池阅读,并再次测试上述实施?默认情况下,电压下溢检查将在Apply_WFI()中。

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面: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_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

很高兴提供的实施是工作,谢谢接受我的答案。

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面: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记者与示例FW相同。我正在使用该项目作为我的项目的基础项目。

PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

你能澄清你的意思是“在正常的PXP记者循环中”?

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面:2周5天前
加入:2019-05-03 17:28
在pxp_reporter_task函数中

在pxp_reporter_task函数中

为了 (;;)

This is the main loop which i am talking about

PM_DIALOG.
离线
最后一次露面:7 hours 8 min ago
职员
加入: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.

谢谢,PM_DIALOG.