how to diable and restart softdevice on nrf552840

I need to run a time-sensitive application on the NRF52840 platform, hence I require disabling and re-enabling the softdevice. After successfully disabling and re-enabling the softdevice, when running ble_advertising_init, an ERROR 12289 [Unknown error code] occurs.

sdk: 17

Main Working Process:

 1)**init part**  

source code:

    ble_stack_init();
    sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); // enable dc/dc translate power
    peer_manager_init();
   
    gap_params_init();
    gatt_init();
    conn_params_init();
    services_init();
    update_sensor_mac();
    advertising_init(BLE_ADV_INI_MEAS, BLE_ADV_LOW_POWER_MODE);

 2)**stop softdevices**

source code:

nrf_sdh_disable_request();

3)**start softdevice**

source code:

    err_code = nrf_sdh_enable_request();  

    NRF_LOG_INFO("start softdevice return stats:%d", err_code);

    if(err_code != NRF_SUCCESS)
    {
        err_code = nrf_sdh_request_continue();
    }

    NRF_LOG_INFO("restart softdevice return stats:%d", err_code);

 

LOG INFO:

    app: start softdevice return stats:0

    app: restart softdevice return stats:0

4) **start advertising**

   source code:

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code);

LOG INFO:

   ERROR 12289 [Unknown error code]

Related