Learn MoreFAQsTutorials

6 posts / 0 new
Last post
moguilevski
Offline
Last seen:2 hours 48 min ago
Joined:2019-04-30 12:25
Extended sleep at start

Dear DS team,

I have two questions for you:

1). Is there any possibility to proceed with the extended sleep mode directly after the initialization of the processor instead of the advertising (advertising can start later, e.g. initiated by external interrupt)?

2). Also, I'm using the barebone example as the base. I changed.default_operation_advtodefault_advertise_operation, the default sleep mode to extended sleep without OTP, and the default handlers configuration to the "timeout-scenario". Thus, the advertising stops after the defined time interval anduser_app_adv_undirect_complete()callsarch_ble_ext_wakeup_on(). I'm expecting extended sleep mode at this point, however, the current stays around 0.4 mA. This is definitely to much for the extended sleep mode. What could prevent the processor from switching to the sleep mode? Are there any crucial points, that I didn't consider?

Thank you and best regards

Device:
PM_Dialog
Offline
Last seen:3 hours 35 min ago
Staff
Joined:2018-02-08 11:03
Hi moguilevski,

Hi moguilevski,

Thanks for your questions.

  1. Yes, it is possible. You can initiate the system in sleep mode instead of starting advertising. By default the ble_app_barebone example and all the other BLE example of the SDK, start advertising. Please check the .default_operation_adv callabk function. In you case, you should set this callback into NULL and set the device into extended sleep mode in the app_on_init() function. By this way, the device will be initiated in the extended sleep mode upon the boot. Keep in mind that you should wake up the device if you would like to start advertising. Please check the ble_app_sleepmode example of the SDK. You can wake it up either synchronously, via the BLE timer which can be programmed to wake up the system, or asynchronously, via an external interrupt(input). All the peripherals domain in sleep mode are powered down. In addition, the device will enter the sleep mode between advertising or connection intervals. Please let me know if you need further steps on how to implement it.
  2. Can you please share more inputs regarding the procedure you are following in order to measure the sleep currents? Are you booting from Flash or SysRAM? In addition, is the debugger attached? If yes, this prevents the system to go into sleep mode. I would recommend first checking theTutorial 4: Sleep modes current measurementfrom our support website and follow the procedure for measuring the sleep mode currents/

Thanks, PM_Dialog

moguilevski
Offline
Last seen:2 hours 48 min ago
Joined:2019-04-30 12:25
Hello PM_Dialog,

Hello PM_Dialog,

我使用的电流测量SmartSnippets power profiler with DK Pro and a multimeter with DK Basic. In the latter case, I use 3V battery and disconnect the board from the computer for the measurement. Flashing in both cases occures via Keil's debug session.

After implementation of the changes suggested for the Point 1, there is no advertising at start any more. However, the current is than the same as it is in Point 2 (~ 0.4mA).

What do you mean with the attached debugger? Also, can define/undefine CFG_DEVELOPMENT_DEBUG block the sleep mode?

Thank you!

PM_Dialog
Offline
Last seen:3 hours 35 min ago
Staff
Joined:2018-02-08 11:03
Hi moguilevski,

Hi moguilevski,

你能请分享你如何设置睡眠mode? Are you using this arch_set_sleep_mode (ARCH_EXT_SLEEP_ON ) in the app_on_init()? When using Keil IDE, the firmware is downloaded into System-RAM and the DA14585 boots from there. I assume that you are using the “Start/Stop debug session button” in order to download firmware. I you press it once and then press “run” the firmware s running with the debugger attached. This prevents the system to go into sleep mode. To do so, you should press the “Start/Stop debug session button” button twice. You should not undefine the CFG_DEVELOPMENT_DEBUG macro. Did you followed the tutorial I suggested you in my previous comment?

Thanks, PM_Dialog

moguilevski
Offline
Last seen:2 hours 48 min ago
Joined:2019-04-30 12:25
Dear PM_Dialog,

Dear PM_Dialog,

I didn't used arch_set_sleep_mode(ARCH_EXT_SLEEP_ON) in the app_on_init() because of the assumption that the default setting:

static const sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON;

in user_config.h is enought. But it was probably not taken into account (please, correct me if I'm wrong), because the corresponding callback function from the main loop callbacks was not default. After addingarch_set_sleep_modefunction to the app_on_init(), I measured 2.9µA current. I assume, it will be also the solution for the Point 2.

The.app_on_initnow is:

void user_app_init(void) { arch_set_sleep_mode(ARCH_EXT_SLEEP_ON ); arch_ble_ext_wakeup_on(); }

Thank you very much!

With best regards

PM_Dialog
Offline
Last seen:3 hours 35 min ago
Staff
Joined:2018-02-08 11:03
Hi moguilevski,

Hi moguilevski,

Glad that you are able to measure the correct current in extended sleep mode. This will put the device into permanent sleep mode. I you found any of the above comment as useful, please mark it “accepted” for any other forum user. If you have any other questions, please create a new forum thread.

Thanks, PM_Dialog