Well,I have read the the document UM-B-004 Peripheral Drivers and UM-B-006 Sleep mode configuration. I always have some questions. Could I send a message in the GPIO2_Handler() (my test prove it work) ? And if I can , when could the message be send ? The UM-B-006 外部中断是一个中说ronous events, it can not make the BLE Core active. Wait for a synchronous event come?
You can send a message from the ISR to the kernel, with the ke_msg_send_basic() function to your TASK_APP (check the SmartTag Reference design sending a message through the interrupt handler). The document explains that if there is an external interrupt most probably the BLE core would be sleeping, thats why is called an asynchronous interrupt. If there is an asynchronous interrupt you can wake up the BLE core.
Please check the SmartTag code in the app_button_press_cb() function, the software gets an external button interrupt wakes up the BLE and sends a message.
question: 1 what do it mean if the function app_ble_ext_wakeup_get() returns false? 2 is this is wake up the BLE ? SetBits32(GP_CONTROL_REG, BLE_WAKEUP_REQ, 1); 3 why I need to call this function ? app_ble_ext_wakeup_off();
The app_ble_ext_wakeup_get() checks if the BLE core is in permanent sleep or not..... You can find what BLE_WAKEUP_REQ does in the datasheet. Also you can find why you need to call app_ble_ext_wakeup_off() in the document UM-B-006.
In the function app_ble_ext_wakeup_off(),only a flag ----sleep_ext_force is was assigned . And the brief of the function is Puts the BLE core to permanent sleep. Can it work ? why?
What the function app_ble_ext_wakeup_off() does is to disable the feature that the da is going to wake up only from external interrupt. The document UM-B-006 instructs that if you are woken from an external interrupt only (you had set the app_ble_ext_wakeup_on()) and you want to wake up the BLE then the you must restore the default mode of operation by calling app_ble_ext_wakeup_off() or the BLE won't be able to wake up in order to serve BLE events.
Of course it will work well. There are lots of posts discussing external interrupt, maybe you should read these first.
Hi liyang,
Please, except from the posts in the forum please have a look at the document UM-B-004 Peripheral Drivers and UM-B-006 Sleep mode configuration.
Thanks MT_dialog
Hi,Dialog:
Well,I have read the the document UM-B-004 Peripheral Drivers and UM-B-006 Sleep mode configuration. I always have some questions.
Could I send a message in the GPIO2_Handler() (my test prove it work) ? And if I can , when could the message be send ? The UM-B-006
外部中断是一个中说ronous events, it can not make the BLE Core active. Wait for a synchronous event come?
Thanks liyang
Hi liyang,
You can send a message from the ISR to the kernel, with the ke_msg_send_basic() function to your TASK_APP (check the SmartTag Reference design sending a message through the interrupt handler). The document explains that if there is an external interrupt most probably the BLE core would be sleeping, thats why is called an asynchronous interrupt. If there is an asynchronous interrupt you can wake up the BLE core.
Thanks MT_dialog
Hi,Dialog:
If there is an asynchronous interrupt how to wake up the BLE core ?
Thanks liyang
Hi liyang,
Please check the SmartTag code in the app_button_press_cb() function, the software gets an external button interrupt wakes up the BLE and sends a message.
Thanks MT_dialog
Hi,Dialog,
Like this?
if (app_ble_ext_wakeup_get())
{
//Wakeup BLE here
#if (EXT_SLEEP_ENABLED)
app_set_extended_sleep();
#elif (DEEP_SLEEP_ENABLED)
app_set_deep_sleep();
#else
app_disable_sleep();
#endif
SetBits32(GP_CONTROL_REG, BLE_WAKEUP_REQ, 1);
app_ble_ext_wakeup_off();
ke_msg_send_basic(APP_WAKEUP_MSG, TASK_APP, NULL);
}
app_button_enable();
question: 1 what do it mean if the function app_ble_ext_wakeup_get() returns false?
2 is this is wake up the BLE ? SetBits32(GP_CONTROL_REG, BLE_WAKEUP_REQ, 1);
3 why I need to call this function ? app_ble_ext_wakeup_off();
Thanks liyang.
Hi liyang,
The app_ble_ext_wakeup_get() checks if the BLE core is in permanent sleep or not..... You can find what BLE_WAKEUP_REQ does in the datasheet. Also you can find why you need to call app_ble_ext_wakeup_off() in the document UM-B-006.
Thanks MT_dialog
Hi,Dialog:
In the function app_ble_ext_wakeup_off(),only a flag ----sleep_ext_force is was assigned . And the brief of the function is Puts the BLE core to permanent sleep.
Can it work ? why?
Thanks liyang
Hi liyang,
What the function app_ble_ext_wakeup_off() does is to disable the feature that the da is going to wake up only from external interrupt. The document UM-B-006 instructs that if you are woken from an external interrupt only (you had set the app_ble_ext_wakeup_on()) and you want to wake up the BLE then the you must restore the default mode of operation by calling app_ble_ext_wakeup_off() or the BLE won't be able to wake up in order to serve BLE events.
Thanks MT_dialog