help! help! help! can't go to deep sleep mode

10 posts / 0 new
Last post
RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
help! help! help! can't go to deep sleep mode

我的项目是从DSPS项目的修改.MY配置如下所示
const static sleep_state_t app_default_sleep_mode = ARCH_DEEP_SLEEP_ON;
#undef cfg_boot_from_otp.

#undef cfg_mem_map_ext_sleep.
#define CFG_MEM_MAP_DEEP_SLEEP

#undef CFG_DEVELOPMENT_DEBUG

static const struct _configuration user_adv_conf = {
.............
/// Minimum interval for advertising

.intv_min = ms_to_bleslots(10000),// 100ms(160 * 0.625ms)

///广告的最大时间间隔

.intv_max = MS_TO_BLESLOTS(10000), // 100ms (160*0.625ms)
......
}

My Sleep API is define as below

app_easy_gap_disconnect(spss_env.con_info.conidx);

power_off_humi_sensor();

app_easy_gap_advertise_stop();

ARCH_SET_DEEP_SLEEP();

ARCH_BLE_EXT_WAKEUP_ON();,

为了方便测试,我将这些代码放在user_on_connection的函数中,如下所示
void user_on_connection(uint8_t connection_idx,struct gapc_connection_req_ind const * param)
{
app_easy_gap_disconnect(spss_env.con_info.conidx);

power_off_humi_sensor();

app_easy_gap_advertise_stop();

ARCH_SET_DEEP_SLEEP();

arch_ble_ext_wakeup_on();
}

when connected the code is executed,through the printf I have seen user_on_disconnect is executed after execute
app_easy_gap_disconnect(spss_env.con_info.conidx);.
but the device is not go to deep sleep.and the current is 1.46ma

There is also exist a strange question,my Jtag can be used in debug though I open the Macro const static sleep_state_t app_default_sleep_mode = ARCH_DEEP_SLEEP_ON;

我有3天的成本来实现我的产品的深度睡眠模式,众多论坛上的主题已经看到并包括UM-B-006和Traning_04,但仍然非常混乱。在论坛中,我发现某人只配置宏可以实现睡眠。不需要使用arch_set_deep_sleep()等一些api来支持它?如果需要,Traning_04的Deatils正在误导。

I will be very greatful if you can give me a detailed guidance.Thank you very much for your replay!

设备:
RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
我把代码放在主要,是

我把代码放在主要,是also not used
int main_func(void)
{
sleep_mode_t sleep_mode;

//global initialise
system_init();

/ *
************************************************************************************
* Platform initialization
************************************************************************************
*/
ARCH_SET_DEEP_SLEEP();
arch_ble_ext_wakeup_on();
而(1)
{
do {
// schedule all pending events
schedule_while_ble_on();
}

MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
嗨兰迪宇,

嗨兰迪宇,

我不确定在深度睡眠模式下的DSP将正常运行,因为只支持延长的睡眠模式,如应用说明(简介部分)所示,我的修改甚至没有宣传了我的修改。ARCH_SET_DEEP_SLEEP()函数和ARCH_SET_EXTEDDE_SLEEP()函数用于在操作时动态更改设备的睡眠模式,仅通过将ARCH_DEEP_SLEEP_ON放置在APP_DEFAULT_SLEEP_MODE中足以深入睡眠。还为了在深度睡眠中正确运行,您将不得不在OTP中刻录您的代码,以便为OTP镜像发生,在开发模式下,没有OTP刻录设备处于扩展的睡眠模式,但仍然是您所看到的电流睡眠太多了。您可以在DEV套件上运行项目,并在断开连接后检查设备是否进入睡眠模式。

Thanks MT_dialog

RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
我有一个DA14580DEVKT-B,

我有一个DA14580DEVKT-B,board is different from Traning_04 used,can you tell me how to measure the current. it is better to giving me a pdf about the board.

And I want to know which version of dev kit is the newest,how to buy?I am in china.
thank you

RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
as you said "just by placing

as you said "just by placing the ARCH_DEEP_SLEEP_ON in the app_default_sleep_mode is enough to go into deep sleep"
我有一个问题,在哪里以及将设备设置为睡眠状态(代码)?我使用jatg在wfi()之前添加一个断点,但程序无法在此处执行。如果不是所有睡眠事件在此职位的过程中都无法执行。

RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
有一些特殊的

有一些特殊的request for general GPIO configure in sleep mode?
if the chip has fall in sleep mode ,and the current is lage(1.4ma),Generally what reason will cause this problem?

MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
嗨兰迪宇,

嗨兰迪宇,

The kit on the training is the pro kit and kit that you are using is the basic kit, their main difference is the power measurement circuit that the pro kit includes. Other than that the boards have almost the same headers in order to measure the power consumption. The pro kit (the one that has the power measurement circuit is the one that is compatible with the power profiler on smart snippets).

The device performs a series of checks in the main loop, checks the queues of the kernel if there are pending messages it calculates the amount of sleep duration.

没有GPIO没有从SDK中涉及睡眠过程,我的意思是您可以设置GPIO以唤醒您的设备,但默认情况下不会实现这一点,DSP不会实现它。对于您看到的1.4毫安,即使在不睡觉时,您看到的DSP足够足够,您是否确定580正在消耗该电源而不是附件的传感器?

Thanks MT_dialog

RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
谢谢你的重播,我有

谢谢你的重播,我有check the problem ,a apower indciate led has consumed a lot of power,when remove it,it still 600-800 μA .After many times debug,I find the the program cannot go out of while(ble_is_powered ()).

I want to know the three terms in the function of
static inline bool ble_is_powered ()
{
返回((getBits16(clk_radio_reg,ble_enable)== 1)&&
(GetBits32(BLE_DEEPSLCNTL_REG, DEEP_SLEEP_STAT) == 0) && \
!(rwip_prevent_sleep_get()&rw_wake_up_ongoing)));
}

Q1:which one is need to consider by user,need I write SetBits16(CLK_RADIO_REG,BLE_ENABLE,0)? or all of them is handled by core event,I don't need to care ?

Q2:Also I am not find BLE_DEEPSLCNTL_REG in DA14580_DS_V3.3.what's the mean?

my sleep is configure as below and it's called in user_on_connection
app_easy_gap_disconnect(spss_env.con_info.conidx);
app_easy_gap_advertise_stop();
power_off_humi_sensor();
arch_ble_ext_wakeup_on();
ARCH_SET_DEEP_SLEEP();
lock_sleep_mode = true;

我也在system_init()后进行测试;
ARCH_TURN_PERITERALS_OFF(MODE_DEEP_SLEEP);
WFI();
after the two sentenceS.I meausred the current is 6.5μA,So I think my board is ok,and the large current is not include sensor consumed

RandyYu
Offline
Last seen:2年10个月前
加入:2015-01-28 08:49
Very happy to tell you ,I

Very happy to tell you ,I just slove the problem .I modify it to extended sleep mode like DSPS project.I successed,
But also have some question
1.how to configure the sleep time,I want it sleep more long times?
2.指出有一个参数来控制广告时间?因为我发现广告时间很短。
3.what's the intv_min and intv_max meaning in advertise_configuration struct?
I am not really understand Minimum/Maximum interval for advertising meaning!
Could it be a fixed value for advertising interval?
4.I used dip switch in the board,when it's on,da14580 pin will read high.But I found when the switch is on ,the current will be become bigger ,more on more bigger.
你能告诉我如何在睡觉前和醒来后处理它

Thank you for your help.

MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
嗨兰迪宇,

嗨兰迪宇,

As indicated in my previous post the DSPS isn't designed for operating under deep sleep mode, anyway glad you ve reached your goal.

1) Regarding the sleep time, the longer you choose to advertise and the longer your intervals are the more you will sleep, so bigger advertising intervals, bigger connection intervals means more sleep time.

2)是的,您可以在user_config.h文件中在.intv_min和.intv_max成员处更改user_adv_conf结构中的广告参数。

3)请检查答案2.关于MIN和MAX值,您可以以相同的值设置它们,以便有修复广告间隔。BLE规范使用了这个Min和Max在广告中的原因,以便向控制器提供一些填充,以便纠正给予其他活动的最佳广告间隔。

4) I dont quite get you question, i suppose that somekind of leakage is causing this extra current, you can reconfigure the input pin of the switch in order to avoid this kind of effect by using the GPIO_ConfigurePin() during runtimer, when exiting or entering sleep mode.

Thanks MT_dialog