的帮助!的帮助!的帮助!不能去深度睡眠模式

10 posts / 0 new
Last post
RandyYu
Offline
Last seen:2 years 10 months ago
加入:2015-01-28 08:49
的帮助!的帮助!的帮助!不能去深度睡眠模式

my project is modify from DSPS project.My configure as the below
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 advertise_configuration user_adv_conf = {
.............
/// Minimum interval for advertising

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

/// Maximum interval for advertising

.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();,

In order to facilitate the test I put these code in the function of user_on_connection,as below
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;

I have cost 3 days the realize the deep sleep mode for my product,many topics in forums had seen and include UM-B-006 and traning_04 ,but still very disorder.In the forums I find someone only configure the Macro can realize sleep. Don't need used some API like arch_set_deep_sleep() to support it? If need,the deatils of traning_04 is misleading.

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

Device:
RandyYu
Offline
Last seen:2 years 10 months ago
加入:2015-01-28 08:49
I put the code in main,is

I put the code in main,is 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();
while(1)
{
do {
// schedule all pending events
schedule_while_ble_on();
}

MT_dialog
Offline
Last seen:3 months 6 hours ago
工作人员
加入:2015-06-08 11:34
Hi RandyYu,

Hi RandyYu,

I am not sure about having the DSPS in deep sleep mode will operate properly since only the extended sleep mode is supported, as indicated in the application note (Introduction section), with some trials i had with your modifications it didn't even advertise. The arch_set_deep_sleep() function and arch_set_extended_sleep() functions are use in order to dynamically change the sleep mode of your device while operating, just by placing the ARCH_DEEP_SLEEP_ON in the app_default_sleep_mode is enough to go into deep sleep. Also in order to properly operate in deep sleep you will have to burn you code in OTP in order for the OTP mirroring to occur, in development mode and no OTP burned the device is in extended sleep mode, but still the current you see for permanent sleep is too much. You can run your project on a dev kit and check if the device falls into sleep mode after disconnection.

Thanks MT_dialog

RandyYu
Offline
Last seen:2 years 10 months ago
加入: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 years 10 months ago
加入: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"
I have a question,where and when set the device to sleep(the code)?I use Jatg add a breakpoint before WFI(),But the program could not execution at here.Don't all sleep events process at this position?

RandyYu
Offline
Last seen:2 years 10 months ago
加入:2015-01-28 08:49
Is there have some special

Is there have some special 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:3 months 6 hours ago
工作人员
加入:2015-06-08 11:34
Hi RandyYu,

Hi RandyYu,

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.

No the GPIOs aren't involved in the sleep procedure from the SDK, i mean that you can set a GPIO to wake up your device but this is not implemented by default and the DSPS doesn't implement it. Regarding the 1.4 milliamperes you see is quite enough for the DSPS even when not sleeping, are you sure that the 580 is consuming that power and not the sensor that is attached ?

Thanks MT_dialog

RandyYu
Offline
Last seen:2 years 10 months ago
加入:2015-01-28 08:49
由于for your replay,I have

由于for your replay,I have 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 ()
{
return ( (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;

Also I have test after system_init();
arch_turn_peripherals_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 years 10 months ago
加入: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.Does there have a parameter to control the advertise time?Because I found the advertise time is very short.
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.
can you tell me how can I handle it before sleep and after wake up

Thank you for your help.

MT_dialog
Offline
Last seen:3 months 6 hours ago
工作人员
加入:2015-06-08 11:34
Hi RandyYu,

Hi RandyYu,

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) Yes, you can change the advertising parameters in the user_adv_conf structure at the .intv_min and .intv_max members at the user_config.h file.

3) Please check answer 2. Regarding the min and max values you can set them at the same value in order to have a fix advertising interval. The reason for this min and max in advertising is used by the BLE spec in order to give to the controller some padding in order to detrmine the best advertising interval given other activities.

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