Hello!
I have been working on bluetooth for some time and I just worked with connectable advertising until now. This time I am trying to add a beacon functionality too. The idea is to allow the device to keep changing between both Beacon and advertising. The problem is that after Beacon mode the device does not go to sleep. It restarts the device. But after advertising mode it works perfectly. This is the function I have been using all this time.
static void sleep_mode_enter(void) { // Prepare wakeup buttons. uint32_t err_code = bsp_btn_ble_sleep_mode_prepare(); APP_ERROR_CHECK(err_code); //Disable SoftDevice. It is required to be able to write to GPREGRET2 register (SoftDevice API blocks it). //GPREGRET2 register holds the information about skipping CRC check on next boot. err_code = nrf_sdh_disable_request(); APP_ERROR_CHECK(err_code); nrf_pwr_mgmt_run(); }
Do you have any idea what is causing the reset?
Thank you very much.