mode_idle in extended sleep mode

15 posts / 0 new
Last post
kamagasako
Offline
Last seen:4 years 10 months ago
加入:2015-03-31 08:47
mode_idle in extended sleep mode

Hello,

I'm testing extended sleep mode with Beacon reference source (3.40.6).
In arch_main.c, rwip_sleep() is called and returns mode_sleeping and mode_idle. With mode_sleep it seems entering extended sleep mode correctly, but mode_idle, radio and peripherals seems keeping active.
I would like to set radio and peripherals sleeping without mode_idle. Would you tell me how to do this?

Thanks,

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi kamagasako,

Hi kamagasako,

You can check in the arch_main.c function the commands SetBits16(PMU_CTRL_REG, RADIO_SLEEP, 1); for the radio and SetBits16(PMU_CTRL_REG, PERIPH_SLEEP, 1); for the peripherals. Shutting down the radio in mode_idle probably is not such a good idea though, its not tested and may cause problems.

Thanks MT_dialog

kamagasako
Offline
Last seen:4 years 10 months ago
加入:2015-03-31 08:47
Hi MT_dialog,

Hi MT_dialog,

I'm sorry to reply so lately.
When mode_idle is returned, in main_func(), just WFI() is called without radio/peripherals sleeping, it seems to increase the power consumption.
Would you tell me how to decrease power consumption even if mode_idle? And what is the case when mode_idle is returned?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi kamagasako,

Hi kamagasako,

Mode idle returns when the da has nothing to do but its instructed also not to sleep, therefore it passes by the instructions that close the peripherals and the radio and waits for an interrupt to occur. Closing the radio while in mode_idle its probably not such a good idea, but you can give it a try by using theSetBits16(PMU_CTRL_REG, RADIO_SLEEP, 1); also i think that its possible to powerdown the peripherals you try it by using the SetBits16(PMU_CTRL_REG, PERIPH_SLEEP, 1);

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 3 months ago
加入:2016-01-04 14:03
Hi,

Hi,
I am using SDK 5.0.3 software on DA14583DEVKT-B board.
我已经采取了“ble_app_peripheral”(BLE的例子projects given).

I wish to optimize the power consumption. I need guidance how we can make DA14583 runs at lowest power consumption without effecting the functionality (i.e. Transmission of BLE data, even ever the data available).

Regards,
Mahesh Chandana.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

The idea for the lowest power consumption is to sleep as long as you can (longer advertising and long connection intervals) and wake up only when nessecary. Besides that you can check the beacon reference design (in advertising mode), where the advertising event period is a bit shorter and allows the 580 to stay awake for each event for a shorter period.

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 3 months ago
加入:2016-01-04 14:03
Hi,

Hi,
Thank you for quick response.
where I can configure the sleep mode or no sleep mode (i.e normal mode of working). Any document is there for thorough understanding the Power consumption.

Regards,
Mahesh Chandana.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

In the user_config.h file at the app_default_sleep_mode you can place the values ARCH_SLEEP_OFF for no sleep and ARCH_EXT_SLEEP_ON for sleep. The 580 is awake and cosnumes power during an advertising event and a connection event, and of course when the application keeps it awake, for more info regarding power consumption you can have a look at the AN-B-015 document.

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 3 months ago
加入:2016-01-04 14:03
Hi,

Hi,
I have gone through the "AN-B-015". This document describes about how to measure the power consumption.

In my context my application function has to call in the main function (in infinite loop). Where I can call my app function. If I am configuring "app_default_sleep_mode" to "ARCH_EXT_SLEEP_ON", When the application requires the CPU time then How it will get wake up from sleep to execute my app function.

In "AN-B-015", there no much information, how the switching from sleep mode to normal mode and vise versa.

Please guide me to understand how it is handled.

Regards,
Mahesh Chandana.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

The app_default_sleep_mode will set a default sleep mode for the 580, if you want to configure the sleep mode of your device during runtime you can use the arch_disable_sleep(), arch_set_extended_sleep() and arch_set_deep_sleep() function which can put your device in no sleep mode, extended sleep mode and deep sleep mode accordingly. Also what you can do in order to force your device to stay awake without changing the sleep mode is to use the app_on_ble_powered callback. This callback returns GOTO_SLEEP in order for the 580 to procced in sleeping state or returns KEEP_POWERED and forces the while loop to re-execute the rwip_shedule() and start over. You can have a look at the UM-B-006 document Sleep mode configuration, the functions are a bit different since the document is based on SDK3 but the functionality is the same, or you can have a look at the UM-B-051 document at section 7 where the sleeping mechanism is described in SDK5 terms.

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 3 months ago
加入:2016-01-04 14:03
Hi,

Hi,
I taken the "ble_app_peripheral" example code. Just change the "app_default_sleep_mode" to "ARCH_EXT_SLEEP_ON" (in "user_config.h" file).
Then I couldn't see the BLE device name on the mobile.

有什么我需要做另外的。
Mean while i am going through the "UM-B-006" document.

Regards,
Mahesh Chandana.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

No there isn't anything else to do, by stopping the debbuging procedure you should be able to see your device advertising.

Thanks MT_dialog

Mahesh
Offline
Last seen:3 years 3 months ago
加入:2016-01-04 14:03
Hi,

Hi,
I have tried. I have seen the device name (i.e. "DIALOG-PRPH") initially for few seconds. later I couldn't see the device name.

Only change in the code is to modify the "app_default_sleep_mode" to "ARCH_EXT_SLEEP_ON" (in "user_config.h" file).

Reagards,
Mahesh Chandana.

Mahesh
Offline
Last seen:3 years 3 months ago
加入:2016-01-04 14:03
Hi,

Hi,

Which API's I need to use in order to wake up the controller from Extended sleep to normal mode both in Synchronous and asynchronous methods.

Regards,
Mahesh Chandana.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
加入:2015-06-08 11:34
Hi Mahesh,

Hi Mahesh,

The 580 wakes up syncronously via the BLE timer (the time that is instructed to sleep is controlled via the SDK and it is set to the next BLE event -connection or advertising interval- every time the 580 falls to sleep). Asynchronously you can wake it up either via a wake up interrupt from the Wakeup timer or via the Quadrature decoder or by using a kernel timer. You can check how to use and set the external wake up in the UM-B-051.pdf in section 10.7. For waking up via a kernel timer is quite simple, just set the timer app_easy_timer() and then the 580 will wake up. In both cases the SDK will check if there are any pending BLE event if there aren't any it will fall back to sleep, so if you want to keep your device awake you will have to use the arch_disable_sleep() function do whatever your application needs to do and then enable the sleeping feature (arch_set_extended_sleep()) once more in order to fall back to sleep.

Thanks MT_dialog