How to get the device stay in the extended sleep mode for longer time?

14 posts / 0 new
Last post
dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
How to get the device stay in the extended sleep mode for longer time?

Hi dialog,
我修改ble_barebone美联社p by changing app_default_sleep_mode=ARCH_EXT_SLEEP_ON to work in extended sleep mode .Configured an gpio for led indication.
I have kept an LED to indicate whether the device is in active mode or sleep mode editing the arch_main.c as follow:

sleep_mode = rwip_power_down();
GPIO_SetActive(GPIO_CNXN_LED_PORT, GPIO_CNXN_LED_PIN);
if ((sleep_mode == mode_ext_sleep) || (sleep_mode == mode_deep_sleep)) {
//power down the radio and whatever is allowed
GPIO_SetInactive(GPIO_CNXN_LED_PORT, GPIO_CNXN_LED_PIN);
arch_goto_sleep(sleep_mode);

//wait for an interrupt to resume operation
WFI();
//resume operation
arch_resume_from_sleep();
I observe the LED stays on always. how to increase the sleep period?

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

Hi dhirajp15,

The 580 wakes up only if there is an upcomming BLE activity, if there is no BLE event it sleeps and waits in the WFI() for a BLE interrupt, by increasing the advertising intervals or the connection intervals (in case of a connection) the 580 is going to sleep until its time to transmit/receive. Also if you placed extra code there and you see the LED always on, most probably you dont ever sleep because most probably the app_default_sleep_mode in the user_config.h file has the value of ARCH_SLEEP_OFF which means no sleep, try setting it to ARCH_EXT_SLEEP_ON and you should see the LED blinking.

Thanks MT_dialog

dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
谢谢MT_dialog。I can see

谢谢MT_dialog。我可以看到flicki领导ng by increasing the advertising delay. But the average current shown by the multimeter is as follows:
without sleep mode: 4.7mA
with extended sleep mode: 4.34mA
with extended sleep mode (increasing advertising delay)=4.26mA
with deep sleep mode=readings are same as extended sleep mode
Where am I going wrong?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

Have you set the variable that i ve mentioned in my previous post to ARCH_EXT_SLEEP_ON ? the example projects have the sleep feature off by default. Regarding the deep sleep mode the current that you will see is the same as in extended sleep, since for deep sleep its required to burn the OTP, in developement mode you will not see any changes in the current. Also please have a look at my answer on this threadhttp://support.dialog-semiconductor.com/expected-consumption-connected-s....

Thanks MT_dialog

dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
Hi MT_dialog,

Hi MT_dialog,
I am using DA14583 module in my application and want to setup deep sleep configuration.But in the datasheet of DA14583 on page no. 15 it is written that this device can not go to deep sleep. Why is it so?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

Please dont post a different question on an irrelevant thread, especially between posts since its difficult to track, please make create a new thread.

Regarding your question the 583 doesn’t support deep sleep because in order to use deep sleep you will have to use the OTP (in deep sleep the 580 will wake up in every connection interval and copy the OTP content to the SYSRAM, since the SYSRAM is switched off), the OTP in the 583 is already burned with the secondary bootloader (or you can burn the advanced bootloader for additional functionality). The secondary bootloader to the OTP will switch on the SPI and the 583 will boot from the SPI.The process is time and energy consuming so the benefit of deep sleep is eliminated by the wakeup, the copying procedure and the booting from the SPI in every connection interval.

Thanks MT_dialog

dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
Hi MT_Dialog , I have set the

Hi MT_Dialog , I have set the variable ARCH_EXT_SLEEP_ON , still the consumption do not decrease.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

When you set that variable to that value, the 580 should automatically go into sleep after advertising, now in your case i guess that you try to debug using keil and you dont stop the
debug mode so the device can't go any further in the code, it stucks until the debugger is disabled so thats why you see a slightly less current when you are in extended sleep. Other than
that, do you have a pro kit in order to check with smart snippets if the device actually sleeps ? Also you can go in the default_app_on_db_init_complete() function and comment out the
EXECUTE_DEFAULT_OPERATION_VOID() define, try to measure again and check the power consumption (actually this will disable the advertising procedure and the device will go to sleep without doing anything-will not advertise). Additionally the device doesn't fall directly in sleep mode, for the first couple of seconds it remains fully active and then goes into sleep mode.

Thanks MT_dialog

dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
Thanks MT_Dialog, The decice

Thanks MT_Dialog, The decice consumes less current , it was the external proccessor which consumed more current.

Ok Now I want to use external wakeup in extended sleep mode.
I have done the following modifications in ble_app_barebone:
//in da1458x_config_advance.h
#define CFG_EXTERNAL_WAKEUP
//in arch_main.c
//inside the arch_goto_sleep()
#if ((EXTERNAL_WAKEUP) && (!BLE_APP_PRESENT)) // external wake up, only in external processor designs
ext_wakeup_enable(UART2_RTS_PORT, UART2_RTS_PIN, 1);
//inside the arch_resume_from_sleep
#if ((EXTERNAL_WAKEUP) && (!BLE_APP_PRESENT)) // external wake up, only in external processor designs
ext_wakeup_enable(UART2_RTS_PORT,UART2_RTS_PIN, 1);
// Disable external wakeup interrupt
//ext_wakeup_disable();
what i observe is the device gets connected to the app but do not accept commands from UART( co processor).
when sleep mode =ARCH_SLEEP_OFF, UART communication works properly
what else should i modify inside the code?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi dhirajp.

Hi dhirajp.

Please have a look at the AN-B-026 this will give you an idea in how you should transfer data via UART when operating over an external processor and waking up the 580 properly in order to receive data.

Thanks MT_dialog

dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
All the changes mentioned in

All the changes mentioned in the AN-B-026 are already done be me

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

Since when you are awake you can properly receive data from the UART and when sleeping you cant, means that after you toggle the gpio you immidiatelly send data from the UART of your external processor, but the 580 isn't awake yet. If you check the AN-B-026 in "Waking up the 580 using any gpio" it mentions that in order to transfer data over UART the usage of flow control is mandatory and that you will have to wait until the 580 asserts or de-asserts the flow control signal in order to start sending data from the external MCU.

Thanks MT_dialog

dhirajp15
Offline
Last seen:2 years 1 month ago
加入:2016-06-08 15:26
HI MT_dialog,

HI MT_dialog,
the co proccessor is sending the data only when the CTS turns low. And the What I observe is that when I trigger the device Using EXT_WAKEUP or without using EXT_WAKEUP just setting ARCH_EXT_SLLEP_ON the current consumption increases meaning it wakes up from sleep but it doesnt accept data coming from Coproccessor.Do we need to initialize the peripherals again after waking up from sleep?
Thank you.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi dhirajp15,

Hi dhirajp15,

The peripherals are initialized when the 580 wakes up from the LP Handler and in the SLP the gtl or the hci interface is initialized in order to set the flow control on, so there is no need to initialize the peripherals again, the fact that you see some current consumption either if you define the external wake up, or you dont, perhaps it means that something is wrong with the configuration of your pins. If there is no external wakeup definition there is no setting of the wakeup timer, therefore there is no wake up, the current that you see can be anything, perhaps a leakage or something else than the 580 waking up. If you have a dev pro kit, you can use smart snippets in order to check if the 580 wakes up, by placing an arch_set_pxact_gpio() after the LP function after the peripherals initialization.

Also i assume that you are interested in a fully embedded design (meaning that there is no application code in the 580) is that right ? and communicate over gtl with the 580 ? I just noticed in the modification at the post above, you ve declared that the wake up pin should be UART2_RTS, in the wake up handler you need to place a pin configured as INPUT so that when you toggle the MCU's RTS the CTS of the 580 (that is set as the wakeup pin) the 580 will start the waking up procedure, when the waking up procedure is done the RTS of the 580 / CTS of the MCU will go low and that is were you can start send data. Also i dont see the reason for enabling the waking up interrupt when you resume from sleep.

Thanks MT_dialog