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
  • Hi,

    Error code 0x00001001 means "NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDeviceinterrupt is already enabled". See the description of sd_softdevice_enable.

    Have you made sure you have disabled it before you enable it again ?

    When you testing with our ble_app_gzll do you have the same issue ?

  • @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.

Reply
  • @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.

Children
No Data
Related