Central connection attempt times out the peripheral connection

We have an nRF5340 device that maintains a peripheral connection to a central device and then makes several of its own central connections to other peripherals.  We ran into a strange issue where this device attempted to form a central connection, but after 1 second (CONFIG_BT_CREATE_CONN_TIMEOUT) a connection failure was reported with reason 0x02 (BT_HCI_ERR_UNKNOWN_CONN_ID).  Three seconds later (4 seconds after the initial connection attempt which is our supervisor timeout), we got notified that our peripheral connection disconnected with reason 0x08 (BT_HCI_ERR_CONN_TIMEOUT).  The central device also reported the reason as 0x08 (BT_HCI_ERR_CONN_TIMEOUT).  After this timeout, the device was able to advertise and regain its peripheral connection quickly.  There were no radio errors reported in the log.

Each time we see this issue, it happens with the same pattern: a central connection is requested, is unsuccessful and then the peripheral connection times out.  It does not happen with every connection attempt.  Sometimes it happens quickly and other times it can take 30min to reproduce it.

Since we are not actively trying to close the connection we think the issue must be lower in the radio code.  One item we wanted to double check was the behavior of the CLOCK_CONTROL_NRF_ACCURACY_PPM setting.  As I understand it, this setting is used to determine the sleep time and receive window for peripheral connections  For a device that just connects to a central it is easy to visualize the impact.  However, for a device that also behaves as a central while maintaining a peripheral connection it is harder to understand the impact of this setting and how it is used by the scheduler?  Can you shed some light on that?  Could an incorrect PPM setting result in the behavior we are seeing?

Most crystals have a 20ppm accuracy at 25C, but then lose accuracy considerably at temperature up to 150ppm.  Should we be using the nominal accuracy for the PPM configuration, or should we be taking into account the worst case ppm over temperature and with crystal aging?

Thanks.

Parents
  • Hello,

    Just to clarify:

    We ran into a strange issue where this device attempted to form a central connection, but after 1 second (CONFIG_BT_CREATE_CONN_TIMEOUT) a connection failure was reported with reason 0x02 (BT_HCI_ERR_UNKNOWN_CONN_ID).  Three seconds later (4 seconds after the initial connection attempt which is our supervisor timeout), we got notified that our peripheral connection disconnected with reason 0x08 (BT_HCI_ERR_CONN_TIMEOUT).

    These two connections, when you say central and peripheral. Are these two different connections from the same device? First, the central connection fails to establish with BT_HCI_ERR_UNKNOWN_CONN_ID, and then 3 seconds later, another connection from that same device, where the nRF53 is the peripheral times out? Or is the peripheral connection in this context the other device that the central tried to connect to?

    I know you said that this was not easy to reproduce. Is it possible for me to reproduce it on a DK?

    Perhaps it reproduces easier if you turn down the TX power of the peripheral device that the central tries to connect to in the first place?

    What NCS version are you using when you are seeing this?

    Best regards,

    Edvin

Reply
  • Hello,

    Just to clarify:

    We ran into a strange issue where this device attempted to form a central connection, but after 1 second (CONFIG_BT_CREATE_CONN_TIMEOUT) a connection failure was reported with reason 0x02 (BT_HCI_ERR_UNKNOWN_CONN_ID).  Three seconds later (4 seconds after the initial connection attempt which is our supervisor timeout), we got notified that our peripheral connection disconnected with reason 0x08 (BT_HCI_ERR_CONN_TIMEOUT).

    These two connections, when you say central and peripheral. Are these two different connections from the same device? First, the central connection fails to establish with BT_HCI_ERR_UNKNOWN_CONN_ID, and then 3 seconds later, another connection from that same device, where the nRF53 is the peripheral times out? Or is the peripheral connection in this context the other device that the central tried to connect to?

    I know you said that this was not easy to reproduce. Is it possible for me to reproduce it on a DK?

    Perhaps it reproduces easier if you turn down the TX power of the peripheral device that the central tries to connect to in the first place?

    What NCS version are you using when you are seeing this?

    Best regards,

    Edvin

Children
No Data
Related