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

nrf51822 random disconnection problem

Hi to all,

i am developing a device with nrf51822 soc. i am using nrf51822 custom board, my board is https://pl.aliexpress.com/item/2V-3-3V-NRF51822-Bluetooth-4-0-Wireless-Module-For-iBeacon-Base-Station-Intelligent-Control-System/32824004498.html. i am implementing an peripheral device and the central side is windows 10 laptop. the problem is in this manner that after pairing the device with windows, after some time(randomly, sometime one hour and some time one day) ble get disconnected with 0x08 reason. i want to imply to this subject that disconnection happen more when we use the device without case. there is anything that can i done to solve the problem?? i heard in some forums that changing the clock setting may help to solve the problem but i am not familiar with clock setting and i do not have any idea that how this can solve the problem. can any give me an advice to solve the problem??

thanks

update: clock configuration of my device in below manner:

#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

and also i am setting clock setting in below manner:

static void ble_stack_init(void)
{
  uint32_t err_code;
	
	ble_manager_init();

  nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;

  // Initialize the SoftDevice handler module.
  SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
  
  .
  .
  .
}

Parents
  • Hi,

    Disconnect reason 0x08 is Connection timeout (BLE_HCI_CONNECTION_TIMEOUT), which is caused by a connection supervision timeout. The main reasons are typically:

    • Device goes out of range or a lot of noise.
    • Optimistic connection parameters (too short connection supervision timeout relative to the connection interval) so that only a few packet drops will lead to disconnect.
    • Clock drift between the peers.

    You can experiment to see if clock drift is the issue by setting a higher xtal_accuracy (for instance NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM). This will increase the listening windows to give more margin. If the disconnects become less frequent with this setting, then you are on to something.

    The typical reason for the 32 kHz crystal to be off is improper value of the load capacitors. Which 32 kHz crystal do you use, and what is the value of your load caps?

    Br,

    Einar

Reply
  • Hi,

    Disconnect reason 0x08 is Connection timeout (BLE_HCI_CONNECTION_TIMEOUT), which is caused by a connection supervision timeout. The main reasons are typically:

    • Device goes out of range or a lot of noise.
    • Optimistic connection parameters (too short connection supervision timeout relative to the connection interval) so that only a few packet drops will lead to disconnect.
    • Clock drift between the peers.

    You can experiment to see if clock drift is the issue by setting a higher xtal_accuracy (for instance NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM). This will increase the listening windows to give more margin. If the disconnects become less frequent with this setting, then you are on to something.

    The typical reason for the 32 kHz crystal to be off is improper value of the load capacitors. Which 32 kHz crystal do you use, and what is the value of your load caps?

    Br,

    Einar

Children
No Data
Related