This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52832 SDK15.2 softdevice6.1.0

the execution procedure of my application as following:

bluetooth_init(void)  -> start advertising (timeout 10s) -> nrf_sdh_disable_request() ->  nrf_pwr_mgmt_run() -> after 1min -> nrf_sdh_enable_request() -> restart adverting

the result is:

<error> app: ERROR 2 [NRF_ERROR_SOFTDEVICE_NOT_ENABLED] at ..\..\..\..\..\..\components\softdevice\common\nrf_sdh_ble.c:313
0> PC at: 0x00033681
0> <error> app: End of error report

Parents
  • Hi.

    Looks like you haven't enabled the SoftDevice properly.

    Have you called ble_stack_init()?

    static void ble_stack_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_sdh_enable_request();
        APP_ERROR_CHECK(err_code);
    
        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Register a handler for BLE events.
        NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
    }
    

    Best regards,

    Andreas

  • @Andreas, It will catch the ERROR 8 [NRF_ERROR_INVALID_STATE]  if we trying to call ble_stack_init  before ble_start_advertising(), on the condition that softdevice is request to disable.

  • Hello,

    Unless it is a very similar question, it is better to create a new ticket, instead of reviving old threads.

    You have another return value from another softdevice call (I think). Is it ble_stack_init() that returns NRF_ERROR_INVALID_STATE? Perhaps it is already initialized? You should investigate which function inside ble_stack_init() that returned 8. You say it is requested to be disabled. Are you sure it is completely disabled? Did you get an event saying that the disable was completed?

    If these hints doesn't help, please create a new ticket.

    Best regards,

    Edvin

Reply
  • Hello,

    Unless it is a very similar question, it is better to create a new ticket, instead of reviving old threads.

    You have another return value from another softdevice call (I think). Is it ble_stack_init() that returns NRF_ERROR_INVALID_STATE? Perhaps it is already initialized? You should investigate which function inside ble_stack_init() that returned 8. You say it is requested to be disabled. Are you sure it is completely disabled? Did you get an event saying that the disable was completed?

    If these hints doesn't help, please create a new ticket.

    Best regards,

    Edvin

Children
No Data
Related