Hi All,
I'm currently working on the sample application based on ble_all_in_one example. The changes on top of the ble_all_in_one example are as follow
1. Changes in characteristics & services
2. Write custom application data to SPI flash.
3. Button event changes (We have registered a wakeup ISR for the same to detect short press and long press)
4, Added function to be called .app_going_to_sleep, that pulls down a GPIO interface which completely powers off the board on a custom hardware
Problem Statement
1. It seems that the board is not going into the extended sleep mode and the .app_going_to_sleep function is not getting called. We are measuring the voltage consumed by the board and it is the same as one consumed in operational mode. The test point is plotted in such a manner that if the power gets cut off from the board, the TP should be as low as 0.06V.
2. The board should go into power-cutoff mode after inactivity is detected.
What I tried
1. I tried following the Sleep mode tutorial provided by Dialog but still, I'm out of luck.
2. I tried to remove all the arch_force_active_mode() and arch_force_restore_sleep() calls from my code.
3. I tried to deregister the wakeup callback for the GPIO button using wkupct_disable_irq() function on peripheral disconnect.
4. Explicitly called arch_set_extended_sleep() function to put the board in low power mode.
If you need anymore details, feel free to contact me. Please guide me through your valuable insights for solving this problem.
Thanking you in advance
Regards
Dhruv Shah
Dear Dialog_Support,
We are developing application where we are going to wake up device using two interrupt method.
1. Using push button interrupt
2. Sensor interrupt [If any activity on sensor interrupt pin]
I have referred the ble_sleep_mode example but for my application it not working properly.
I have used following snippet to config interrupt,
static void app_button_press_cb(void)
{
arch_disable_sleep();
//arch_force_active_mode();
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();
}
}
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_KEY_PORT, GPIO_KEY_PIN) | WKUPCT_PIN_SELECT(GPIO_I2C_BUZZER_PORT, ACCELEROMETER_INT), // select pin (GPIO_PORT_1, GPIO_PIN_1)
WKUPCT_PIN_POLARITY(GPIO_KEY_PORT, GPIO_KEY_PIN, WKUPCT_PIN_POLARITY_LOW) | WKUPCT_PIN_POLARITY(GPIO_I2C_BUZZER_PORT, ACCELEROMETER_INT, WKUPCT_PIN_POLARITY_LOW), // polarity low
1, // 1 event
40); // debouncing time = 0
}
void user_app_adv_undirect_complete(uint8_t status)
{
// Disable wakeup for BLE and timer events. Only external (GPIO) wakeup events can wakeup processor.
if (status == GAP_ERR_CANCELED)
{
user_app_adv_start();
// Configure wakeup button
app_button_enable();
}
}
Using this i am unable to generate interrupt and wake my device from sleep.
Some random behavior is happening, like only first time i am able to detect push button interrupt and if repeat for 2nd time fail to detect.
Same with sensor interrupt.
Please help me solve issue.
Thanks and Regards
Rohit