Hi all,
In our project we are using nrf52810, SDK 15.0.0 and ble_app_uart.c example.
We are using our custom board in which MCU is communicating with BLE through wired UART.
we tried to implement Sleep mode in BLE.
when we send "sleep\n" string from MCU to BLE, BLE need to go System ON sleep mode.
BLE need to wake up after receiving data from data from MCU.
we are using power manage function for sleep mode( please refer attached code).
It has to be in power manage mode until an interrupt has to occur but here it is coming out of power manage function once it enters.
Please give solution regarding the same.
Thanks,
venu
void power_manage( void ) { ret_code_t err_code = sd_app_evt_wait(); APP_ERROR_CHECK(err_code); } /**@brief Application main function. */ int main(void) { bool erase_bonds; // Initialize. uart_init(); log_init(); timers_init(); buttons_leds_init(&erase_bonds); power_management_init(); ble_stack_init(); gap_params_init(); gatt_init(); services_init(); advertising_init(); conn_params_init(); // Start execution. printf("\r\nUART started.\r\n"); NRF_LOG_INFO("Debug logging for UART over RTT started."); advertising_start(); // Enter main loop. for (;;) { // comparing received string from MCU and going into System ON sleep mode if(strncmp("sleep", (char *)&data_array[0], 5) == 0) { power_manage(); data_length = 0; } } }