<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85096/supervision-timeout-following-connection-parameter-updates-on-limited-devices</link><description>We are using SDK 15.3.0 and S140 v6.1.1 SoftDevice. We are using an external LF crystal with tolerance of +/-20ppm, and are therefore using 
 
 #define NRF_SDH_CLOCK_LF_SRC 1 
 
 #define NRF_SDH_CLOCK_LF_ACCURACY 7 
 
 which correspond to LF_SRC_XTAL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Mar 2022 12:22:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85096/supervision-timeout-following-connection-parameter-updates-on-limited-devices" /><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/358640?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 12:22:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:721b26a8-ab4d-4c86-935e-2468a7f6eca0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t give you any crystal recommendation from specific vendors, but you can look at the bill of materials for reference designs and DKs to see what kind of crystals we have used there if that&amp;#39;s helpful (&lt;a href="https://www.nordicsemi.com/Products/Development-hardware/nRF52840-DK/Download?lang=en#infotabs"&gt;downloadable here&lt;/a&gt;). The&lt;a href="https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.7.pdf"&gt; product specification&lt;/a&gt; should also explain what kind of crystals are fitting to use as LF crystals.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/358500?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 19:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c0b3c13-e4e6-4718-80da-859134905fc8</guid><dc:creator>BretH</dc:creator><description>&lt;p&gt;Does Nordic have LF crystal part recommendations?&amp;nbsp;We are using a low capacitance crystal that may have too stringent of a load capacitance range.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/357069?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 09:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae2f7bab-f836-458a-973b-f0f9122207ac</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Glad to hear the LF SYNTH resolved the issues. That means our assumption that the XTAL being off was correct.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, but my last reply might have been misleading. There&amp;#39;s not really a reliable way to calculate the LF oscillators accuracy in firmware, as the PPI is not &amp;quot;timeless&amp;quot; and might take a clock cycle or so to report, which will result in inaccurate numbers (9000ppm is way off for the RC oscillator at least, as it is specified to &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fclock.html&amp;amp;anchor=unique_1732287760"&gt;+-500ppm in our spec&lt;/a&gt;. The most accurate way to determine the accuracy of the clock sources would be to make a GPIO toggle at the frequency of the LF clock source, and measure this with external HW.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/356900?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 13:20:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d320503-dc8c-437d-bcc0-cf604a1ca3e8</guid><dc:creator>BretH</dc:creator><description>&lt;p&gt;I did try SYNTH for the clock source and it resolves the issue. However, I&amp;#39;d still like to characterize the issue with our XTAL to better understand the distribution of error across units.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To do this, I created a small test for comparing the HF and LF clocks. I used the RTC, a Timer, and PPI. I set a RTC compare event to trigger a timer clear through PPI, and another RTC compare event to trigger a timer capture through PPI 10 seconds later.&lt;/p&gt;
&lt;p&gt;When using RC or XTAL for LF clock sources, I found the accuracy to be about 9000ppm (10090ms elapsed on timer vs 10s elapsed on RTC). This scaled if I increased or decreased the time, always being 9000ppm.&lt;/p&gt;
&lt;p&gt;To verify the test setup, I tried the SYNTH LF clock source. Over 10 seconds on the RTC, the timer read 9999.924ms (8ppm). I&amp;#39;d expect this to be closer to 0ppm, but I understand there is slight inaccuracies due to the different time domains.&lt;/p&gt;
&lt;p&gt;Are my PPM calculations incorrect, or is this a faulty test?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
#define COMPARE_COUNTERTIME  (10UL)

nrf_ppi_channel_t ppiStartChannel;
nrf_ppi_channel_t ppiStopChannel;
const nrfx_timer_t timer = NRFX_TIMER_INSTANCE(4);
const nrfx_rtc_t rtc = NRFX_RTC_INSTANCE(2); /**&amp;lt; Declaring an instance of nrf_drv_rtc for RTC0. */


static void rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
    if (int_type == NRF_DRV_RTC_INT_COMPARE0)
    {
        uint32_t capture_time = nrfx_timer_capture_get(&amp;amp;timer, (nrf_timer_cc_channel_t)0);
        NRF_LOG_DEBUG(&amp;quot;RTC INT COMPARE PPI %d&amp;quot;, capture_time)
        NRF_LOG_DEBUG(&amp;quot;RTC INT COMPARE non-ppi %d&amp;quot;, nrfx_timer_capture(&amp;amp;timer, (nrf_timer_cc_channel_t)0))
    }
    else if (int_type == NRF_DRV_RTC_INT_COMPARE1)
    {
        NRF_LOG_DEBUG(&amp;quot;NRF_DRV_RTC_INT_COMPARE1&amp;quot;)
        NRF_LOG_DEBUG(&amp;quot;RTC INT COMPARE start %d&amp;quot;, nrfx_timer_capture(&amp;amp;timer, (nrf_timer_cc_channel_t)0))
    }
}

/** @brief Function initialization and configuration of RTC driver instance.
 */

void timer_event_handler(nrf_timer_event_t event_type,
                        void            * p_context)
{

}

void rtc_config(void)
{
    uint32_t err_code;

    // CONFIGURE RTC
    //

    //Initialize RTC instance
    nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
    config.prescaler = 4095;
    err_code = nrf_drv_rtc_init(&amp;amp;rtc, &amp;amp;config, rtc_handler);
    APP_ERROR_CHECK(err_code);

    //Set compare channel to trigger interrupt after COMPARE_COUNTERTIME seconds
    err_code = nrf_drv_rtc_cc_set(&amp;amp;rtc, 0, 2 + (COMPARE_COUNTERTIME * 8), true);
    APP_ERROR_CHECK(err_code);

    //Set compare channel to trigger interrupt after COMPARE_COUNTERTIME seconds
    err_code = nrf_drv_rtc_cc_set(&amp;amp;rtc, 1, 2, true);
    APP_ERROR_CHECK(err_code);


    // CONFIGURE TIMER
    //
    nrfx_timer_config_t timer_config =
    {
        .frequency = NRF_TIMER_FREQ_1MHz,
        .mode = NRF_TIMER_MODE_TIMER,
        .bit_width = NRF_TIMER_BIT_WIDTH_32,
        .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY,
        .p_context = 0
    };
    err_code = nrfx_timer_init(&amp;amp;timer, &amp;amp;timer_config, timer_event_handler);
    APP_ERROR_CHECK(err_code);
    nrfx_timer_clear(&amp;amp;timer);
    nrfx_timer_enable(&amp;amp;timer);


    // CONFIGURE PPI
    //
    err_code = nrfx_ppi_channel_alloc(&amp;amp;ppiStartChannel);
    APP_ERROR_CHECK(err_code);
    err_code = nrfx_ppi_channel_alloc(&amp;amp;ppiStopChannel);
    APP_ERROR_CHECK(err_code);

    const uint32_t rtc_compare1_event = nrfx_rtc_event_address_get(&amp;amp;rtc, NRF_RTC_EVENT_COMPARE_1);
    const uint32_t timer_start_task = nrfx_timer_task_address_get(&amp;amp;timer, NRF_TIMER_TASK_CLEAR);
    err_code = nrfx_ppi_channel_assign(ppiStartChannel, rtc_compare1_event, timer_start_task);
    APP_ERROR_CHECK(err_code);

    const uint32_t rtc_compare0_event = nrfx_rtc_event_address_get(&amp;amp;rtc, NRF_RTC_EVENT_COMPARE_0);
    const uint32_t timer_capture_task = nrfx_timer_capture_task_address_get(&amp;amp;timer, 0);
    err_code = nrfx_ppi_channel_assign(ppiStopChannel, rtc_compare0_event, timer_capture_task);
    APP_ERROR_CHECK(err_code);

    err_code = nrfx_ppi_channel_enable(ppiStartChannel);
    APP_ERROR_CHECK(err_code);
    err_code = nrfx_ppi_channel_enable(ppiStopChannel);
    APP_ERROR_CHECK(err_code);


    // START RTC
    //
    nrf_drv_rtc_enable(&amp;amp;rtc);
    NRF_LOG_INFO(&amp;quot;RTC started&amp;quot;);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/355555?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 13:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3bf96b1-4426-41ed-a7b4-ccdaeb3377cf</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The RTC peripheral (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/rtc_example.html"&gt;example project available here&lt;/a&gt;) for instance, uses the LF clock for example.&lt;/p&gt;
&lt;p&gt;You can also try setting the LF clock source to&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fclock.html&amp;amp;anchor=concept_zhp_4vy_2q"&gt; synthesize from the HF clock instead&lt;/a&gt;, which will be the most accurate way to run the LF clock, but also the most current consuming. This is done by setting the&amp;nbsp;&lt;strong&gt;NRF_SDH_CLOCK_LF_SRC&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;define in sdk_config.h&amp;nbsp;to 2. If you&amp;#39;re able to connect at better PPM values than with the LF XTAL I think it&amp;#39;s safe to say that the connection issues are caused by the LF crystal.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/355330?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 15:17:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1889c1f5-1917-400d-bdfe-f56a1ebb07fa</guid><dc:creator>BretH</dc:creator><description>&lt;p&gt;Do you have any recommendations for ways firmware can evaluate the LF clock accuracy relative to the HF clock? If we have high confidence in our HF clock (we do or else BT PHY would be problematic), then we should be able to estimate LF clock frequency. However,&amp;nbsp;in the product spec, I can find several peripherals driven by&amp;nbsp;PCLK1M or&amp;nbsp;PCLK16M, but there are no references to&amp;nbsp;PCLK32KI (via Ctrl-F). Which peripherals are LFCLK-driven that could be helpful in comparing clock performance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/355197?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 09:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0784b63a-02c1-4572-9e9e-c86e50eab960</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Glad to hear you broke some ground here. This sounds like a damaged crystal to me as well. Setting the accuracy to 250ppm will&amp;nbsp; mainly just effect the radio&amp;#39;s accuracy, but also other peripherals using the LF clock, so timers, RTCs, etc. will also be somewhat less accurate.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/354848?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 14:13:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3db9d26-b14d-4218-aefc-b031a0ecea91</guid><dc:creator>BretH</dc:creator><description>&lt;p&gt;We&amp;#39;ve had a lot of activity in the past 24 hours regarding this issue. At first, we were struggling to identify which combination of phones and nRF52 devices would reproduce the issue, but now we finally got some traction.&lt;/p&gt;
&lt;p&gt;We determined that our nRF52 device is the problem. We can reproduce the issue with several phones on a specific nRF52 device, and the same phones with a different nRF52 device do not reproduce the issue.&lt;/p&gt;
&lt;p&gt;We&amp;#39;ve also determined that the issue is more likely to be reproduced when the phone&amp;#39;s clock tolerance is narrower. By looking at the CONNECT_IND payload, a phone with a 31-50ppm tolerance has a higher failure rate than a phone with a 251-500ppm tolerance.&lt;/p&gt;
&lt;p&gt;We also did as you recommended and incrementally increased the&amp;nbsp;&lt;span&gt;NRF_SDH_CLOCK_LF_ACCURACY. With one device combination, we found 150PPM failed but 250PPM was successful.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This suggests potentially significant issues with our crystal, either damage during manufacturing or a capacitance issue. We&amp;#39;ll be assessing the power impact of 250PPM&amp;nbsp; NRF_SDH_CLOCK_LF_ACCURACY vs 20PPM, but it seems likely to be negligible. Apart from RX WINDOW WIDENING, is there any other major factor affected by the value of&amp;nbsp;NRF_SDH_CLOCK_LF_ACCURACY&amp;nbsp;?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout following connection parameter updates on limited devices</title><link>https://devzone.nordicsemi.com/thread/354821?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 12:49:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c0764ee-ed07-4cdf-a57c-9f0fb126b1b7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Just to make sure I understand correctly. Is this reproducible on some phones no matter what nRF52 device it&amp;#39;s tested with? Or is it reproducible on some nRF52 devices no matter what phones they connect to? Or is it just with specific combinations of some nRF52 devices and phones? Can you specify what phone models you see this issue on, cheaper models tend to have clock drift and a relaxed relationship to the BLE specification, which can cause trouble unfortunately, for example by disconnecting because of two high of an accuracy.&lt;/p&gt;
&lt;p&gt;It could indeed be a problem with some of the LF crystals on your boards. They might have been damaged during soldering, have the wrong capacitor values mounted, or have a bad connection to the nRF52 for example. One way to check is to lower the&amp;nbsp;&lt;span&gt;NRF_SDH_CLOCK_LF_ACCURACY slightly, not all the way to 500ppm, often it&amp;#39;s enough to set it to 50ppm for example, and you will still have good accuracy. If this fixes the issue, and accuracy is not critical in your application, that can be an okay fix.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can also try desoldering the LF crystal and soldering on a new one without changing anything else to see if it&amp;#39;s a HW issue with the crystal itself.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>