<?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>lfclk initialization trouble when switching between ble and esb</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19334/lfclk-initialization-trouble-when-switching-between-ble-and-esb</link><description>Hello, 
 In my application I want to switch between using bluetooth low energy and enhanced shockburst (esb). I have tried using the timeslot api to run both of them together, but although it works very well, waiting for available timeslots severely</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Feb 2017 12:24:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19334/lfclk-initialization-trouble-when-switching-between-ble-and-esb" /><item><title>RE: lfclk initialization trouble when switching between ble and esb</title><link>https://devzone.nordicsemi.com/thread/75000?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 12:24:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cba2d3c3-457d-4100-a2ca-21635e6af9b2</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry that my answer was not correct, but it&amp;#39;s good that you have found a solution. As stated in the documentation for sd_softdevice_disable(..), the &amp;quot;LFCLK source chosen in sd_softdevice_enable will be left running&amp;quot; after the softdevice has been disabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lfclk initialization trouble when switching between ble and esb</title><link>https://devzone.nordicsemi.com/thread/74999?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2017 17:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4eccaa35-24ef-4829-bfb8-dd23051a5b74</guid><dc:creator>jrowe</dc:creator><description>&lt;p&gt;here is th logic in the nrf_drv_clock_init() function for reference&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#ifndef SOFTDEVICE_PRESENT
    m_clock_cb.p_lf_head      = NULL;
    m_clock_cb.lfclk_requests = 0;
    nrf_clock_xtalfreq_set(CLOCK_CONFIG_XTAL_FREQ);
    nrf_clock_lf_src_set((nrf_clock_lfclk_t)CLOCK_CONFIG_LF_SRC);
    nrf_drv_common_irq_enable(POWER_CLOCK_IRQn, CLOCK_CONFIG_IRQ_PRIORITY);
#if CALIBRATION_SUPPORT
    m_clock_cb.cal_state = CAL_STATE_IDLE;
#endif // CALIBRATION_SUPPORT
#else // SOFTDEVICE_PRESENT
    uint8_t is_enabled;
    result = sd_softdevice_is_enabled(&amp;amp;is_enabled);
    if((result == NRF_SUCCESS) &amp;amp;&amp;amp; !is_enabled)
    {
        result = NRF_ERROR_SOFTDEVICE_NOT_ENABLED;
    }
#endif // SOFTDEVICE_PRESENT
    m_clock_cb.module_initialized = true;
    return result;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lfclk initialization trouble when switching between ble and esb</title><link>https://devzone.nordicsemi.com/thread/74998?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2017 17:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e26bd6db-df60-4a5b-a88c-ca6dde1ff291</guid><dc:creator>jrowe</dc:creator><description>&lt;p&gt;Thanks for the quick response! It looks like the nrf_drv_clock_init() function might not work quite the way that you describe, but your answer did lead me to what I believe will be a workable solution.&lt;/p&gt;
&lt;p&gt;The nrf_drv_clock_init() function raises an NRF_ERROR_SOFTDEVICE_NOT_ENABLED error if the SOFTDEVICE_PRESENT tag is defined but the softdevice is not enabled. Simply disabling the softdevice does not allow that code to execute, but this seems to be intentional.&lt;/p&gt;
&lt;p&gt;The key is that disabling the softdevice does not disable the LFCLK. As long as I startup in bluetooth mode before switching into ESB mode, the LFCLK will be properly configured such that it will work both when the softdevice is enabled and when it is not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lfclk initialization trouble when switching between ble and esb</title><link>https://devzone.nordicsemi.com/thread/74997?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2017 08:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1abb4bf6-ec93-4374-bcce-bdfc8ef69b8d</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;If the softdevice is disabled when you use ESB (you have called sd_ble_disable(..) ), it will, for the application,  be the same as if the softdevice wasn&amp;#39;t present. The tag SOFTDEVICE_PRESENT means if the softdevice is present and enabled. In your case, since the softdevice is disabled, &amp;quot;SOFTDEVICE_PRESENT&amp;quot; should be false. You should then be able to initialize the LFCLK when using ESB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>