Reasons for 0x22 error on disconnection

I am seeing many 0x22 error codes on the disconnect event when I connect to an iPhone with 5.2/5.3 BT version.  I do not see the 0x22 error when connecting to iPhones with 5.1 BT such as the iPhone XR or Android phones.  I am experiencing this in my custom product using Softdevice 7 but I can reproduce the problem in the NCS peripheral example project using Zephyr and the PCA10040 devkit.  In the NCS example, the 0x22 only happens if I use the Nordic stack.  It does not occur with the open source stack.  In the peripheral example, I made these changes to cause the 0x22 error:

After connection, change connection interval to 2s

Wait 6s and disconnect

I attached the Ellisys captures of the Nordic and open source stack.  The Nordic capture has 2 markers when the 0x22 error occurred.  It seems to be related to the Channel Map Indication sent by the phone but in my custom product I have seen the 0x22 error when no Channel Map Indication is sent.  Is there a list of reasons for why I can see 0x22 error on disconnect?

z-nordic.bttz-open.btt

Parents Reply
  • Hi,

    The issue is that when receiving a channel map update as a peripheral, the channel is selected using the old channel map when the instant occurs. So the first packet after a channel map update will be lost and retransmitted. This is not a serious issue (which may be why it has not been found before), but may lead to lightly lower performance due to packet loss when connected to a central that does a lot of channel pap updates.

    This causes the behavior you reported, where the peripheral disconnects, and the ACK from the central to the termination happens at the instant of a channel map update, and is not received due to this bug. This will cause the peripheral to wait the supervision timeout before disconnecting and generate a timeout event (0x22 in this case). This is the same as will happen if there is interference when the ACK from the central is sent, and we get a CRC error.

    This will be fixed in the SoftDevice Controller, but there are no plans to fix the old SoftDevices. The consequences are low as channel map updates are typically not very frequent, and the same behavior can occur doe to packet loss caused by other reasons.

Children
No Data
Related