I can't get BLE_GAP_EVT_DISCONNECTED event

Hi!

S132, SDK17.1, nRF52832

Very strange behavior, I connected my central to the bonded peripherial success and got an BLE_GAP_EVT_CONNECTED event, but when I disconnected peripherial, I didn't get BLE_GAP_EVT_DISCONNECTED  event.

On this project I got recently this event, but I just added some code and now I have this behavior.

What possible reason? What should I check?

Thanks.

  • Hi Tomas, 
    Do you know what kind of code you added ? Did you modify the SDK's code or only your application code ? 
    Does it has anything with pulling out the event from the softdevice interrupt handler ? 
    There is some similar tickets , for example: missing BLE_GAP_EVT_DISCONNECTED event 

    Please try testing with some simple example in the SDK to see if you have the same issue ? 

  • Hi! 
    Similar tickets- it is good. I used SDK7.2.0 In this ticket pointed that this known bug and fixed it it SDK 7.3.0

    I have tested with simple SDK and it works. I made project on central example. And It worked. But I added some code, in the config.h I have changed cmt of UUID services, changed memory size in Keil project and after that I can't receive this event.

    But event BLE_GAP_EVT_CONNECTED I got successfully. But WO BLE_GAP_EVT_DISCONNECTED  evnt.  

  • Hi Tomas, 
    Changing UUID shouldn't be a problem, but changing memory size could be an issue. Could you show what you changed ? 
    Can you try changing step by step to see at which step you see the problem ? 

  • Hi Hung,

    I found out that when I got BLE_GAP_EVT_CONNECTED event, but in this event I didn't do 

    all works properly. I gon an event BLE_GAP_EVT_DISCONNECTED like expected.

    But with this string



    I didn't get any messages in the RTT like:

    And I din't get BLE_GAP_EVT_DISCONNECTED . 

    But before Keil's memories changed, it worked properly (also discovery nus_c worked).
    Now I have Keil's settings here:


    Seems, all services in the config.h are enabled. I don't know the reason of this behavior.

  • Hi ,
    If you comment out ble_db_discovery_start(&m_db_disc, p_ble_evt->evt.gap_evt.conn_handle);, then there will be no BLE_NUS_C_EVT_DISCOVERY_COMPLETE event. So it's as expected. 

    So you observed that you only see the issue after you change the memory configuration. What did you change and why you changed ? 
    Could yo

1 2