Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

sd_softdevice_disable cause app timer crash

Recently, I’ve been working on the process of switching between BLE and a private protocol. When I switch to the private protocol, I usually need to disable the softdevice. However, this causes my app timer to malfunction. The following is a rough outline of my process:
main()
{
....
app_timer_init();
......
//some_apptimer_start_here
......
ble_stack_init();
//scheduler_init();
gap_params_init();
gatt_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();
buffer_init();
peer_manager_init();
......
......
sd_softdevice_disable()
......
while(1)
{
app_sched_execute();
}
}
Then, when I disable the protocol stack, an error usually occurs, and the program crashes in places like the following:
So, I’d like to ask:
  1. Why does disabling the protocol stack affect the app timer? Is there a way to avoid this issue? I still want to use the app timer after disabling the protocol stack.
  2. What is the correct process for disabling the protocol stack? Is my method correct, like using sd_softdevice_disable()?
Parents Reply Children
Related