[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.