Wakeup interval in extended sleep

8 posts / 0 new
Last post
Ralf S.
Offline
Last seen:4 years 1 month ago
加入:2016-02-16 08:06
Wakeup interval in extended sleep

I am working on the PAN1740 with the Dialog-Evalkit-Pro on SDK 5.0.3

Currently I am trying to run my setup in extended sleep mode.

CFG_MAX_SLEEP_DURATION_PERIODIC_WAKEUP_MS 500

app_default_sleep_mode = ARCH_EXT_SLEEP_ON

But the Board wakeups immediatly after going to sleep. The time in sleep is only 80us.

Is there more to do to set the board in extended sleep mode?

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Ralf S,

Hi Ralf S,

启动后,设备配置它self depending on the settings that you ve set in user_gapm_conf struct in the user_config.h file after that is going to set up the databases of the services that you have configured in the user_profiles_config.h (if you set any services). After the device has finished depending you have a profile enabled in your device or not, the callbacks default_app_on_set_dev_config_complete() (for the device configuration) and default_app_on_db_init_complete() (for the database configuration) will be invoked. In most the examples there are profiles so after the configuration callback of the device (default_app_on_set_dev_config_complete) the database completion callback of the device (default_app_on_db_init_complete) will occur. The ble examples in the default_app_on_db_init_complete() will force the device to advertise. So you wont be able to download and immiatelly go to sleep, you will have to let your device configure itself and then from those two callbacks you can set the wake up condition (external wakeup or a timer that will wakeup your device) and after that the device will fall into permanent sleep.

Additionally when the device is in sleep mode and advertising or it is connected that means that it sleeps between the advertising or the connection intervals. If you would like to set the device into permanent sleep follow the above procedure. The CFG_MAX_SLEEP_DURATION_PERIODIC_WAKEUP_MS is a definition that configures how often the device will wake up when there is no BLE activity at all.

Finally when the device starts up it spends about 2 seconds with sleep disabled in order for the XTAL32 to settle properly.

Thanks MT_dialog

Ralf S.
Offline
Last seen:4 years 1 month ago
加入:2016-02-16 08:06
Thank you for the reply!

Thank you for the reply!

I now configured my device to be advertising with an interval of 10s. I get a current of 660uA, but as mentioned in the specs it should go down to 1,4uA if the device is in Extended Sleep. So I assume that it is not in extended sleep. If I set it to "ARCH_SLEEP_OFF" there is no difference in current consumption.

所以我必须显式设置一个时间r or external wakeup in my main function if want the device to enter the sleep mode?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Ralf S.

Hi Ralf S.

By setting the app_default_sleep_mode=ARCH_EXT_SLEEP_ON is enough to put the device in extended sleep, if you have set the device to be advertising with an intreval of 10 seconds then you should get (when the device is not advertising) about 1.4uA. You dont have to set anything extra, if you have passed to the kernel an advertising command with an advertising interval of 10 seconds the device should advertise, sleep and wake up on its own when its time to advertise, with 10 seconds interval. Try to download the code via UART using Smart Snippets and check via the power profiler if the device is sleeping or not (if you have a pro dev kit) or you can try to measure the power the consumption within that 10 second interval.

Thanks MT_dialog

Ralf S.
Offline
Last seen:4 years 1 month ago
加入:2016-02-16 08:06
I have a Pro Dev Kit and I am

I have a Pro Dev Kit and I am measuring the current on J11 with an external DMM.

When I scan for the device with the DSPS app, I can find the device only every 10s. Therefore I can assume the advertise interval is set correctly.

I just tested with the power profiler.The attached plotshows the advertisement period. After the advertisement the device settles, but is not going to sleep. The waveforms which start at 5ms have a period of 1ms. The advertisement starts every 10s, just as configured.

I have code running in the callback function app_on_sytem_powered, and return it with "GOTO_SLEEP".

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Ralf S,

Hi Ralf S,

Try the below suggestions with the DSPS source code as is, except the 10 seconds advertising interval in order to have the chance to measure the low power mode.

1) I suppose that you download the fw via JTAG and you hit the run button from keil. While the debugger is attached on the device you wont see the device going to low power mode. So just press the Start/Stop debug button and then press it again. That way the debugger will detach and the device will be able to go to low power mode.

2) There are cases where the debugger module stays on even if the debugger is detached, that causes the 580 not to be able to go to sleep mode, so in order to eliminate that case you can download code via the UART interface and the Smart Snippets tool. Take the produced binary and use the uart_booter from Smart Snippets in order to download the fw.

Thanks MT_dialog

Ralf S.
Offline
Last seen:4 years 1 month ago
加入:2016-02-16 08:06
Hi,

Hi,

now I have it working. At least the example. You were right, I downloaded via JTAG. When I use the the UART interface in Smart Snippets i get the sleep current in the range of 2uA and in the power profiler the wakeup from sleep and the peaks to about 5mA when advertising can be seen.

So the debugger is still attached and the device isn't going to sleep. The extra current I see is the still activated debugger or is the device actually not sleeping?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Ralf S.

Hi Ralf S.

As far as i am aware the device is sleeping, the peripherals are powered down and the ARM is in WFI but the debugger module stays on and consumes that extra current. You can try to follow the below FAQ in order to be able to download the fw via JTAG and when stop debugging to see your device entering sleep.

https://support.dialog-semiconductor.com/guide/faq-known-issues

Thanks MT_dialog