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

    To answer your first post. It looks like your own serial code is making a ble call. There is no other explanation I can think to this.

    /Aryan

  • I narrowed it down to NVIC_ClearPendingIRQ(UART0_IRQn); NVIC_EnableIRQ(UART0_IRQn); - are you not supposed to be able to call those before initialising the softdevice? Or are there other functions I should be using instead if using the softdevice?

Reply
  • I narrowed it down to NVIC_ClearPendingIRQ(UART0_IRQn); NVIC_EnableIRQ(UART0_IRQn); - are you not supposed to be able to call those before initialising the softdevice? Or are there other functions I should be using instead if using the softdevice?

Children
No Data