I work with NRF52832. Implemented an application based on the "ble_app_uart" example. Everything is working. I decided to add the saving of configurable parameters to the internal Flash memory. I write to Flash using the NVMC module, the use of which is possible only
with the SoftDevice stack disabled, otherwise Flash will crash. This is how I initially initialize the stack when power is applied to the device:
timers_init(); power_management_init(); ble_stack_init(); gap_params_init(); gatt_init(); services_init(); advertising_init(); conn_params_init(); advertising_start();
Then, in the body of the program, I disable the stack:
advertising_stop(); if (nrf_sdh_is_enabled()) { err_code = nrf_sdh_disable_request(); APP_ERROR_CHECK(err_code); while (nrf_sdh_is_enabled()) {} disabled_softdevice = true; }
Then I successfully work with Flash memory (erase, write):
Flash_exe();
But I don't understand how to re-run the stack and advertising. Can someone tell me?