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.