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

BLE_HCI_CONNECTION_TIMEOUT and NRF_CLOCK_LF_XTAL_ACCURACY_XX_PPM

Hi there,

We started to notice that we have been getting random disconnects with the reason BLE_HCI_CONNECTION_TIMEOUT. After profiling our device, it was found on one of our devices that our 32768 Hz timer has an accuracy of about 45 PPM. We have passed the parameter NRF_CLOCK_LFCLKSRC_XTAL_20_PPM into the sd_softdevice_enable() function. Could this be the cause of the random disconnects?

Note: we've tried running a couple units with the parameter NRF_CLOCK_LFCLKSRC_XTAL_500_PPM, and we haven't had random disconnects for a few hours. However, depending on the alignment of the sun, moon and stars, we sometimes don't get disconnects with the NRF_CLOCK_LFCLKSRC_XTAL_20_PPM parameter either.

  • FormerMember
    +1 FormerMember

    In BLE, the LF clock is used for timing in between the BLE events, it is the timekeeper for when the radio should be turned on and transmit/listen for packets.

    Depending on the LF clock accuracy, the wake-up time for transmitting/receiving packets will be more or less accurate. The LF clock accuracy parameter is used to compensate for the inaccuracy in the LF clock, so that the radio, both on the central and the peripheral side, can account for the inaccuracy by having a larger receive window (turn on/off the radio earlier/later than the expected time for the packet).

    If using a crystal with higher inaccuracy than what is specified in the software, the receive window can be too small, and the device may not receive a given packet, because the packet was transmitted too early or too late. If this happens for multiple packets (supervision timeout), there will be disconnect.

    I would therefore recommend you to use the correct LF clock accuracy in the software.

  • Please clarify how the clock accuracy is specified. If we use a crystal that has an initial accuracy of +/- 20ppm at 25 deg C is that 20ppm accuracy or 40ppm accuracy? In other words, should we be using NRF_CLOCK_LFCLKSRC_XTAL_20_PPM or NRF_CLOCK_LFCLKSRC_XTAL_50_PPM with this crystal?

  • You should use 20ppm. The window widening function will apply this as +/- 20ppm. i.e.

Related