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

Examples for enabling/disabling of BLE SoftDevice

So far I haven't run across any code examples that will switch the BLE (S110) stack in and out. I'm looking to test enabling and disabling of the softdevice to see how that works with a separate protocol that uses the radio. So far simply calling sd_softdevice_enable after calling sd_softdevice_disable doesn't seem to completely re-enable the soft device.

Any suggestions?

Parents
  • You can refer to ble_app_gzll in the SDK, which does such toggling.

    However, what do you mean that it doesn't seem to re-enable it completely? There are no intermediate steps; either enabling succeeds or it fails. Do you check the error code returned by the second enable? Could it be that you have some interrupts enabled with an illegal interrupt configuration (i.e. have enabled one of the interrupts that the softdevice needs, or have another interrupt with priority 0)? If so, enable will return NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION.

  • Hi Ole,

    Yes, my simple test revealed that I need to do more than simply re-enable the softdevice with a sd_softdevice_enable call. I see in the jzll example that the ble_stack_start uses BLE_STACK_HANDLER_INIT to re-enable things. I'll give that a try. I'm also having a bit of difficulty using Eclipse to debug with the app I created around the softdevice. That is likely a separate issue and will mark this thread resolved.

    Thanks

Reply
  • Hi Ole,

    Yes, my simple test revealed that I need to do more than simply re-enable the softdevice with a sd_softdevice_enable call. I see in the jzll example that the ble_stack_start uses BLE_STACK_HANDLER_INIT to re-enable things. I'll give that a try. I'm also having a bit of difficulty using Eclipse to debug with the app I created around the softdevice. That is likely a separate issue and will mark this thread resolved.

    Thanks

Children
No Data
Related