Central configuration - Discovery fail at MAX_CONNECTION_INTERVAL 50ms, passes at max 20ms

Hi

I am using nRF51822 for central and peripheral, S132, Based SDK12

Attempting to configure the nRF51822 as a central, I am experiencing issues with Discovery process failure, my peripheral connection interval is defined between 20ms-75ms

I have noticed that this is dependent on MAX_CONNECTION_INTERVAL, when I set up interval connection between 10-20ms it works, but if, for example I set it up 10-50ms discovery fails, not all services are discovered upon connection, why is that? is there a way around it?

Thanks

Parents Reply Children
  • Hi Kenneth,

    Yes I can try to sniff our the connection process,

    But in the meanwhile, what do you mean by enabling slave latency until after, how do I do it?

    Also, is there a way to change the max interval connection after discovery (I mean initiation of updating of connection-parameters by the central side)?

    Thanks!

  • Hi,

    Please sniff the connection when working and failng, it will be easier to understand what is actually happening then. 

    In short: Slave latency control how frequently the peripheral must listen at a given connection interval, it can skip slave latency periods.

    In short: Yes.

    Kenneth

  • Hi Kenneth

    Here are the wireshark results, passing and failing

    Discovery_23_05_06_FAIL_b000.pcapng

    Discovery_23_05_06_PASS_b000.pcapng

    If you think the solution is to update the latency, or max-interval, please refer me to an example on how-to?

    Thank you for your help! 

    Ron

  • The sniffer logs helped a bit. Looks like my first assumption is likely wrong.

    Instead, can you look into what lfclk configuration you have provided in ble_stack_init()?

    Typically you can find something like this in ble_stack_init():

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;

    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_APPSH_INIT(&clock_lf_cfg, true);

    I need to know wht you have set .xtal_accuracy to for the lf clock configuration, and in specific (at least for test) suggest to use NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM. But I would like to know all the paramters you have used for source, rc_ctiv, rc_temp_ctiv and xtal_accuracy.

    Kenneth

  • Hi Kenneth,

    I understand, makes sense, this was my configuration, 

    #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}

    After trying to update the accuracy to 500ppm as you suggested on the central side (while keeping max interval as 50ms), but it failed again

    I see that the xtal accuracy is defined by both peripheral and central, how is that negotiated? is that important?

    On the peripheral side, I am in no position to update the peripheral xtal-accuracy init parameters (peripheral side) as the peripheral is already in the field, with customers, but I did it just in the sake of the experiment and it still failed..

    Any other directions of investigations?

    Thanks! 

Related