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

About the "BLE_GAP_EVT_DISCONNECTED" event nRF52832

Hello.

After pairing with a tablet or computer, if you leave it for a few seconds without operating it

I wrote out the cause of the disconnection by debugging.

"Error 34 (0x22): GATT CONN LMP TIMEOUT"

What are the possible causes and countermeasures?

Parents
  • Hi,

    Which SoftDevice version are you using?

    BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT (0x22) means that a link layer procedure has timed out (data length negotiation for instance). The timeout is 40 seconds, so the easiest way to find out which procedure it was that timed is to get a sniffer trace and see what happened 40 seconds prior to the disconnect.

    It may be caused by several reasons, for instance if the application does not not respond to certain SoftDevice events.

  • Hello.
    Thank you very much for your answer which will be right away.

    ≫Which SoftDevice version are you using?

    S132 is being used.

    ≫get a sniffer trace and see what happened 40 seconds prior to the disconnect.

    After a packet was captured.
    "LL_TERMINATE_IND" but a slave showed that he's sent and cuts.

    "LL_TERMINATE_IND" but sent timing.
    "The one of the ble_conn_params_init_t" "I found out that it's dependent on next_conn_params_update_delay".

    Therefore a cut thing died to change "next_conn_params_update_delay" for 24 hours from 5 seconds as a temporary measure.

    "Can't the reason that LL_TERMINATE_IND" is sent and the above measure have a proper basket view?

    I'll give you trouble and I'm sorry, but please take care.

  • Einar san

    We become indebted to.
    Thank you for your contact.

    For 0x13 disconnection
    I understand that it is not an error in itself.

    If you check it again,
    BLE_GAP_EVT_DISCONNECTED occurred in Reason22.
    This phenomenon is caused by connecting another company's application on our board and tablet.
    It is occurring. (Not reproduced in DK)

    We will send you the following, so please give us your opinion.

    1. 1. BLEControl.c source code
    (Excerpt so as not to include product information)
    2. 2. BLEControl_log.txt Soft log (disconnection occurred at L53)
    3. 3. Disconnect.pcapng Wireshark packet capture (disconnection occurred in No3592)

    When the source code L50 is enabled, the above phenomenon does not occur.

    Thank you fDisconnect_log.zipor your cooperation.

  • Hi,

    Thank for these files. They were much more informative. Here I see from the sniffer trace (Disconnect.pcapng) that the nRF disconnects with reason BLE_HCI_CONN_INTERVAL_UNACCEPTABLE (0x3B) in #1977, #2783 and #3592.

    You write that you do not see this if you include line 50, which delays the next connection parameter a very long time (24 hours, which I assume is longer than the time you test). Therefore my first assumption was that the conn_params module disconnected, but that is not the case as you have set disconnect_on_fail = false.

    The actual reason this fails is that you explicitly disconnect on the BLE_CONN_PARAMS_EVT_FAILED event in your ConnectParamsEventHandler() function, with the reason BLE_HCI_CONN_INTERVAL_UNACCEPTABLE. So the nRF is doing exactly as you would expect with this code. If you do not want to disconnect even when you do not get the connection parameters you request, you should remove line 670 - 678 in your BLEControl.c.

    Einar

  • We become indebted to.


    Let me ask you an additional question about advertise.

    ・ Question

     After starting the advertisement and passing "APP_ADV_DURATION (180s)",

     Advertise will stop and sleep.

    If you want to continue advertising without going to sleep

    Should I resume advertising when the BLE_ADV_EVT_IDLE event occurs?

    In that case, the function to call is


    "Ble_advertising_start"

    "Ble_advertising_restart_without_whitelist"

    Which one?

    We apologize for the inconvenience, but thank you.

  • Hi,

    As you use the advertising module, you can restart advertising with ble_advertising_start(). I do not see any reference to whitelist in your code so in practice this would be equivalent to using ble_advertising_restart_without_whitelist() in your case. Generally, which one to use depends on if you want to start advertising with whitelist or not.

    Note that you can also prevent advertising from timeout out by setting the duration to 0.

Reply
  • Hi,

    As you use the advertising module, you can restart advertising with ble_advertising_start(). I do not see any reference to whitelist in your code so in practice this would be equivalent to using ble_advertising_restart_without_whitelist() in your case. Generally, which one to use depends on if you want to start advertising with whitelist or not.

    Note that you can also prevent advertising from timeout out by setting the duration to 0.

Children
Related