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

sd_ble_gap_disconnect returns 0x08, BLE_GAP_EVT_DISCONNECTED never arrives, further attempts to disconnect fail, unable to reconnect - advertising stops.

Hey

I am working on nRF51822 SDK12, S130

I have encountered a problem when connecting and disconnecting from the device at a fast rate, occasionally comes an event in which the sd_ble_gap_disconnect() command fails (the error received is 0x08.), the BLE_GAP_EVT_DISCONNECTED never arrives, the device stops advertising and no longer available to reconnection. the device is gone. 

I have tried to disconnect again after a small interval, that does not help.

I have tried to wait for a long time for the BLE_GAP_EVT_DISCONNECTED to arrive, it never arrives.

I have tried to set m_conn_handle = BLE_CONN_HANDLE_INVALID as seen in some thread on the forum. that doesn't help.

nothing works 

Any advice will be much appreciated

Thanks!

Parents
  • Hi,

    Can you add debugging to ensure that if BLE_GAP_EVT_DISCONNECTED event occurs for instance before sd_ble_gap_disconnect() is called, then it is handled already. Error code 8 means: 

    Disconnection in progress or link has not been established.

    So either you have already disconnected (BLE_GAP_EVT_DISCONNECTED already occurred), or that you are calling sd_ble_gap_disconnect() before BLE_GAP_EVT_CONNECTED event has occurred. I can't really think of any other suggestion as long as the conn_handle is valid.

    Best regards,
    Kenneth

  • Hey, I also want to note that the conn_handle is 0 when this error occurs.

    Thanks

  • Ron said:
    I have seen that the reset to the chip does not occur if I do not initialize my ADC-PPI,

    Hmmm...  what PPI channels did you use here? Is it possible that you are somehow blocking interrupts here and/or possible touching PPI channels used by the softdevice?

    Best regards,
    Kenneth

  • Hey 

    I use channel the RTC1 channel to the ADC via PPI so:

        uint32_t timer_compare_event_addr = (uint32_t)&NRF_RTC1->EVENTS_COMPARE[2];
        uint32_t adc_sample_event_addr = nrf_drv_adc_start_task_get();
        err_code = nrf_drv_ppi_channel_alloc(&m_ppi_channel);
        APP_ERROR_CHECK(err_code);
        err_code = nrf_drv_ppi_channel_assign(m_ppi_channel, timer_compare_event_addr, adc_sample_event_addr);  //NRF_ADC->TASKS_START);
        APP_ERROR_CHECK(err_code);

    But as I said it seems the this issue was solved by properly reinitializing the Softdevice BLE configuration after the disabling.

    Did you check if it possible that there is some issue with the S130 that explains why the disconnection fails, because I don't want to be coerced to reset the softevice, that is not the greatest solution.

    Thanks!

  • Ron said:
    Did you check if it possible that there is some issue with the S130 that explains why the disconnection fails, because I don't want to be coerced to reset the softevice, that is not the greatest solution.

    I don't think I received information about which S130 release you are using? Is it v1.0.0, v2.0.0 or v2.0.1?

  • I can't any issue that may cause the disconnect event does occur, the only thing is that the BLE_GAP_EVT_DISCONNECTED event may be very delayed, e.g. until supervisor timeout occurs on the link. But it should still occur, so if you want us to look into this in more detail I am afraid we need an on-air sniffer log of the situation and/or a way to recreate it here (e.g. you provide firmware for this kits we may run).

    Best regards,
    Kenneth

Reply
  • I can't any issue that may cause the disconnect event does occur, the only thing is that the BLE_GAP_EVT_DISCONNECTED event may be very delayed, e.g. until supervisor timeout occurs on the link. But it should still occur, so if you want us to look into this in more detail I am afraid we need an on-air sniffer log of the situation and/or a way to recreate it here (e.g. you provide firmware for this kits we may run).

    Best regards,
    Kenneth

Children
No Data
Related