Device not waking up from extended sleep

Learn MoreFAQsTutorials

4 posts / 0 new
Last post
wisilica
Offline
Last seen:6 months 6 days ago
加入:2015-03-17 08:16
Device not waking up from extended sleep

Hi,

I am working on the project wherein the default sleep mode of the device is extended sleep mode. I am trying to wake the device up using both synchronous and asynchronous mechanisms.
The problem we are facing is the device does wake from the timer callbacks, but is not waking up from external interrupt.
Following is the code snippet used for wake up configuration using external interrupt :
void set_pad_functions(){
GPIO_ConfigurePin(GPIO_ACC_INT2_PORT, GPIO_ACC_INT2_PIN, INPUT_PULLDOWN, PID_GPIO, false);
}

void user_app_disconnect(struct gapc_disconnect_ind const *param)
{
start_adv();
}

void start_adv()
{
arch_ble_ext_wakeup_on();
app_button_enable();
}

static void app_button_enable(void)
{
app_easy_wakeup_set(app_wakeup_cb);
wkupct_register_callback(app_button_press_cb);
wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_ACC_INT2_PORT, GPIO_ACC_INT2_PIN), // select pin (GPIO_BUTTON_PORT, GPIO_BUTTON_PIN)
WKUPCT_PIN_POLARITY(GPIO_ACC_INT2_PORT, GPIO_ACC_INT2_PIN, WKUPCT_PIN_POLARITY_HIGH), // polarity low
1, / / 1事件
40); // debouncing time = 0
}

static void app_wakeup_cb(void)
{

}

static void app_button_press_cb(void)
{
if (GetBits16(SYS_STAT_REG, PER_IS_DOWN))
{
periph_init();
}

if (arch_ble_ext_wakeup_get())
{
arch_set_sleep_mode(app_default_sleep_mode);
arch_ble_force_wakeup();
arch_ble_ext_wakeup_off();
app_easy_wakeup();
}
}

The issue I am facing is that on reception of trigger, the program control reaches the function app_button_press_cb(), but not the function app_wakeup_cb(). Please suggest the possible reasons for the same.

Thanks

Device:
MT_dialog
Offline
Last seen:1 month 1 week ago
工作人员
加入:2015-06-08 11:34
Hi wisilica,

Hi wisilica,

Weill if the when the interrupt occurs the device reaches the app_button_press_cb() that means that the device gets the interrupt, if it never reaches the app_wakeup_cb that means that the execution never reaches the app_easy_wakeup() and that means that the arch_ble_ext_wakeup_get() is false. Since the arch_ble_ext_wakeup_get() is false i would assume that at you invoke the arch_ble_ext_wakeup_off() and then you dont invoke the arch_ble_ext_wakeup_on() in order to set the sleep_ext_force flag back to true.

Thanks MT_dialog

wisilica
Offline
Last seen:6 months 6 days ago
加入:2015-03-17 08:16
Hi,

Hi,
In fact, the arch_ble_ext_wakeup_get() is true, (checked by issuing breakpoints). The control reaches upto ke_msg_send_basic(wakeup_id, TASK_APP, 0) portion in app_easy_wakeup(). But the control however does not reach the app_wakeup_cb () . I am also using timer based wake up. Is there any issue in doing both the wake up mechanisms simultaneously ? The timer based wake up works perfectly.

Thanks

MT_dialog
Offline
Last seen:1 month 1 week ago
工作人员
加入:2015-06-08 11:34
Hi wisilica,

Hi wisilica,

If the app_wakeup_cb() doesn't trigger but the message is set and send (app_easy_wakeup_set() and app_easy_wakeup() are being invoked) check the user_modules_config.h file and make sure that the EXCLUDE_DLG_MSG is defined and set to 0, perhaps you have excluded the module by mistake. No, i dont think that the timer should be a problem.

Thanks MT_dialog