This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Re-enable softdevice

Hi. I'm trying to enable and disable softdevice repeatedely. In my code, softdevice is firstly enabled then advertising properly. After some seconds, softdevice is disabled and ESB is enabled. It is worked properly too. and then esb is deisabled, softdevice is re-enabled and try to start advertising. But I found an error code when re-enabling softdevice.

in ble_stack_handler.c

err_code = sd_softdevice_enable(clock_source, softdevice_assertion_handler);

returns 0x00001001 at second enabling. (at first enabling, it returns NRF_SUCCESS)

I don't know how to solve the problem. please help.

Parents Reply Children
  • Hi. I used ble_conn_params_stop() and softdevice_handler_sd_disable(), as in ble_app_gzll. I didn't check the return values of sd_softdevice_enable() in the ble_app_gzll yet.

    And, ble_app_evt_wait() function returns 0x02 that means soft device is not enabled. (devzone.nordicsemi.com/.../) If the softdevice is already enabled, why the function ble_app_wait_evt() returns 0x02?

    So I think the error code 0x00001001 means "enabled interrupt has an illegal priority level". How can I check priority level of enabled interrupts?

  • @LKH: You can get the priority level by using NVIC_GetPriority or sd_nvic_GetPriority() when softdevice is enabled. Make sure you don't use interrupt priority level 0 or 2 in your application when starting softdevice.

    I would suggest you to test by not enabling any other interrupt /code when disable and enable the softdevice. (follow what we did in ble_app_gzll). And then gradually add your code in and see when the issue happens.

Related