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

[NRF51822][S130 V2.0.1]Customized BLE Dongle has unexpected disconnect errors 0x22 and 0x3E

Hi there,

I am developing a BLE dongle, and a BLE peripheral both based on NRF51822QFAC. The BLE dongle scans, connects, and disconnects the BLE peripheral by UART commands, sent by a customized PC GUI.

My problem is I get unexpected disconnect errors occasionally when I use the dongle to connect the BLE peripheral, the unexpected disconnect error codes are 0x22 and 0x3E

I did pressure tests on the connection process(let BLE dongle initiated connection and disconnection to the BLE slave repeatedly), and used a Nordic official dongle to sniff the BLE packets. There are several cases when the unexpected disconnection occurs, which are as follows,

1. Disconnection Error = 0x22 (LMP RESPONSE TIMEOUT / LL RESPONSE TIMEOUT):

1) Dongle Initiated a disconnection successfully(0x16), and then the dongle scanned and reconnected to the slave. No CONNECT_REQ captured.

Sniffer only captured SCAN_REQ and SCAN_RSP, but no CONNECT_REQ captured.

The slave kept advertising, and the dongle reported a disconnection error 0x22 after a 4s connection supervision timeout.

2) Dongle Initiated a disconnection, LL_TERMINATE_IND was send many times(kept re-sending in 4s connection supervision time) but no response from the slave.

Dongle gave the disconnection error 0x22.

  

3) Dongle Initiated a disconnection successfully, and tried to scanned and reconnected the slave.

No SCAN_REQ and SCAN_RSP was captured.

2. Disconnection Error = 0x3E (CONNECTION FAILED TO BE ESTABLISHED):

1) Dongle sent CONNECT_REQ successfully, and sent 6 Empty Data PDUs, however, no response from the peripheral. After 4s timeout, the dongle got a 0x3E error.

2) Similarly to the 0x22 first case, SCAN_REQ and SCAN_RSP was sniffed, but CONNECT_REQ was not captured.

 

From the Devzone, I found the issue may be induced by clock accuracy and the boards RF performance. 

To compare with my customized dongle board, I downloaded my dongle firmware into the PCA10028 board, and let the PCA10028 board to connect and disconnect the peripheral. 0x22 and 0x3E occurred as well.

There is no external 32.768KHz crystal oscillator on my dongle board (only one external 16MHz). My LFCLK settings are as below,

 

#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \
                                 .rc_ctiv       = 1,                                \
                                 .rc_temp_ctiv  = 1,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

Do anyone know what cause the problem? The RF or the clock accuracy? 

PS: No whitelist advertising on the BLE peripheral.

Thank you very much.

  

Parents
  • 1.

    1) In environment with noise it may be that the sniffer don't receive all the packets.

    2) In environments with noise, it may be that the acknowledge from the peripheral, that the disconnect packet was received, is lost. In such case only the peripheral will disconnect, while the central will repeat the disconnect packet until supervisor timeout occurs. This is according the BLE spec.

    3) This may be the same case as above, but in this case the sniffer did receive the acknowledge, only the central did not receive it, thereby the sniffer don't anymore monitor that the central is still in a connection until supervisor timeout.

    2.

    1) In environments with noise, it may be that the connection request from the central was not received by the peripheral. In such case the central will send 6 packets after connection request, if no packet is received from the peripheral during this time, then the central will consider the link failed to establish. This is according the BLE spec.

    2)This may be the same case as above, but in this case the sniffer didn't receive the connection request either. Thereby the sniffer doesn't monitor the central try to establish a link.

Reply
  • 1.

    1) In environment with noise it may be that the sniffer don't receive all the packets.

    2) In environments with noise, it may be that the acknowledge from the peripheral, that the disconnect packet was received, is lost. In such case only the peripheral will disconnect, while the central will repeat the disconnect packet until supervisor timeout occurs. This is according the BLE spec.

    3) This may be the same case as above, but in this case the sniffer did receive the acknowledge, only the central did not receive it, thereby the sniffer don't anymore monitor that the central is still in a connection until supervisor timeout.

    2.

    1) In environments with noise, it may be that the connection request from the central was not received by the peripheral. In such case the central will send 6 packets after connection request, if no packet is received from the peripheral during this time, then the central will consider the link failed to establish. This is according the BLE spec.

    2)This may be the same case as above, but in this case the sniffer didn't receive the connection request either. Thereby the sniffer doesn't monitor the central try to establish a link.

Children
Related