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

BLE_ERROR_NOT_ENABLED with S120

Hi,

I'm using a lightly modified copy of the Multilink central S120 example code. When I get to ble_stack_init() the first thing it does is SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);

Unfortunately that gives me an error code of 4097 which is BLE_ERROR_NOT_ENABLED. The comment for that error says "sd_ble_enable has not been called". But in the example code sd_ble_enable() is after SOFTDEVICE_HANDLER_INIT() so of course it hasn't been called!

If I believe the error and move sd_ble_enable() before SOFTDEVICE_HANDLER_INIT() then sd_ble_enable() returns error code 2, which is NRF_ERROR_SOFTDEVICE_NOT_ENABLED!

What is going on here? Which one should go first, and why are there error codes for both of them not being called first?

Parents
  • What version of S120 and what version of the SDK are you building with and are you absolutely sure that the correct version of the SD is on the chip (and that you used the headers for that version when you built).

    I've been bitten by a mismatch between softdevice I thought I loaded, softdevice I actually loaded and softdevice headers built against more than once so it's worth absolutely verifying it.

  • It's definitely the right version. However I have found that the untouched multilink example does work, so it must be something I've changed. The only things I've really changed are that I'm using C++ instead of C (main is C++ now), and I'm using a different build system. As far as I can tell the build system does all the same things though.

Reply
  • It's definitely the right version. However I have found that the untouched multilink example does work, so it must be something I've changed. The only things I've really changed are that I'm using C++ instead of C (main is C++ now), and I'm using a different build system. As far as I can tell the build system does all the same things though.

Children
No Data
Related