Learn MoreFAQsTutorials

2 posts / 0 new
Last post
Thanhtu131
Offline
Last seen:3 weeks 2 days ago
Joined:2018-09-18 17:44
sleepmode example

Hi, I am using a DA14580 Basic kit. Please don't mention about DA14531. I'll learn about it later !!

I really want to undestand 3 things in the sleep mode example for DA14580:

1 /在第一次10秒,如果我不修改code, does the system go to sleep? Or the main loop just tries to sleep based on the sleep mode which is set before by the function arch_set_deep_sleep() (or arch_set_extended_sleep()) ?

2/ In the first 10sec, if the there is no code modification or connection, does the main loop sleep successfully? and which line in the code do it? If the main loop make the system sleep successfully? What line of code that wake the system so the system can advertise? Is it the BLE timer?

3/ After 10sec advertising, the callback function user_app_adv_undirect_complete() is call and then the function arch_ble_ext_wakeup_on() is called to ensure that only an external (GPIO) wakup event can wake up the system. Am i right?

i looking forward to recieving your replies soon? Sorry for to many questions i had made!!

Device:
PM_Dialog
Offline
Last seen:4 hours 23 min ago
Staff
Joined:2018-02-08 11:03
You should explicitly set the
  1. You should explicitly set the desired sleep mode using the sleep mode APIs.
  2. If you set the sleep mode in you application code, yes the system will sleep successfully. So, if you have enabled the sleep mode, the device will go into sleep between advertising or connection intervals. To do so, the chip will wake up after every advertising or connection interval due to a BLE event as you mentioned. The BLE_WAKEUP_LP_Handler is the ISR which is triggered in every wake up. Then, the CPU will resume from WFI. Please check main() in arch_main.c file. After the WFI, the arch_resume_from_sleep().The BLE_WAKEUP_LP_HANDLER is triggered every time the system wakes up. The device is running with the 32K clock when in sleep mode, so as soon as it wakes up, the clock is switched to 16MHz.
  3. The arch_ble_ext_wakeup_on() uts the BLE core to permanent sleep. Only an external event can wake it up. BLE sleeps forever waiting a forced wakeup. The app_button_enable() configures the wake-up controller in order to wake-up via a GPIO trigger.

Thanks, PM_Dialog