<?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>nRF52 LF crystal initialization best practices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36091/nrf52-lf-crystal-initialization-best-practices</link><description>Hi all, I used SDK example as a reference on how to initialize LF clock. 
 The code is : 
 
 The nrf_drv_clock_lfclk_request(NULL) is asynchronous and in current example callback handler was not assigned for handling successful start. I have a few questions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Jul 2018 13:36:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36091/nrf52-lf-crystal-initialization-best-practices" /><item><title>RE: nRF52 LF crystal initialization best practices</title><link>https://devzone.nordicsemi.com/thread/139125?ContentTypeID=1</link><pubDate>Thu, 05 Jul 2018 13:36:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:233bb6c9-c8e7-4d5a-b874-e70ffe5239a4</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;1) The SD will start the LF clock. Either the RC or the crystal depending on configuration.&lt;/p&gt;
&lt;p&gt;2.1) yes.&lt;/p&gt;
&lt;p&gt;2.2) It think it will continue to run from RC. So you should start the crystal first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 LF crystal initialization best practices</title><link>https://devzone.nordicsemi.com/thread/139119?ContentTypeID=1</link><pubDate>Thu, 05 Jul 2018 13:03:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:874ede31-4626-45a8-a819-8d681987e976</guid><dc:creator>Valerii_Ie</dc:creator><description>&lt;p&gt;Thanks run_ar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1) According to the code&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;bool nrf_drv_clock_lfclk_is_running(void)
{
    ASSERT(m_clock_cb.module_initialized);

#ifdef SOFTDEVICE_PRESENT
    if (nrf_sdh_is_enabled())
    {
        return true;
    }
#endif // SOFTDEVICE_PRESENT

    return nrfx_clock_lfclk_is_running();
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I suggest that if I receive&amp;nbsp;NRF_SDH_EVT_STATE_ENABLED event after calling&amp;nbsp;nrf_sdh_enable_request() the LF clock have to be enabled. So if I use softdevice I do not need to init LF clock manually. Does it make sense?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;2) If I start LF clock (on crystal source) before starting WDT, the last will use crystal as a clock source?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2&amp;#39;) If I start WDT before starting softdevice with&amp;nbsp;NRF_SDH_CLOCK_LF_SRC == 1 (XTAL).&amp;nbsp;Will WDT stay on RC clock source or switch to XTAL clock?&lt;br /&gt;&lt;br /&gt;3)clear&lt;/p&gt;
&lt;p&gt;thanks!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 LF crystal initialization best practices</title><link>https://devzone.nordicsemi.com/thread/139095?ContentTypeID=1</link><pubDate>Thu, 05 Jul 2018 11:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7477013e-8e0e-4371-9ea1-9c195dc2b98a</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;1) you can add a while(nrf_drv_clock_lfclk_is_running()); after the request. This will make sure the app is not proceeding unless you are able to start the LF crystal.&lt;/p&gt;
&lt;p&gt;2)According to &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/wdt.html?cp=2_1_0_39#concept_ywz_4xw_sr"&gt;documentation&lt;/a&gt;: When started, the watchdog will automatically force the 32.768 kHz RC oscillator on as long as no other 32.768 kHz clock source is running and generating the 32.768 kHz system clock, see chapter &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html#frontpage_clock"&gt;CLOCK — Clock control&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;3) Yes. Not sure which sdk version you are using ,but you do not want to rely in the bootloader to do initialization for the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>