<?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>hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51404/hang-in-sd_softdevice_enable-when-use-nrf52840-internal-oscillator</link><description>Hi, 
 
 I am try to configure internal RC (LFCLK) but device hang in &amp;quot;sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler);&amp;quot; API. 
 Changed in &amp;quot;sdk_config.h&amp;quot; to enable internal RC. 
 Used &amp;quot;...\...\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Aug 2019 11:37:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51404/hang-in-sd_softdevice_enable-when-use-nrf52840-internal-oscillator" /><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206349?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 11:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b853308f-aee5-4fa4-adc1-23d52e31243b</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Thanks!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206337?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 11:26:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19715f0c-43fe-4928-a59b-7619e13131ae</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. I am not able to reproduce this issue with the production chip, but I can reproduce it with 0.9.0, which has an old engineering sample IC. You should not use that for development, as the chip has a number of issues that were fixed in the production version. The release SoftDevice and SDK&amp;#39;s&amp;nbsp;no longer include workarounds for issues that were fixed in the production version (revision 1). So the recommendation here is to test with a newer version of the nRF52840 DK (PCA10056) - at least one which has the production IC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206314?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 10:08:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e89ca3f0-54ab-4d84-bca2-c8899d11f272</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;PCA10056 (V0.9.0) DK used for test&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Nirav Patel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206312?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 10:05:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddefd197-2d30-4f0b-9b06-25636aafccb8</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please receive attached example project.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF5_5F00_SDK_5F00_15.2.0_5F00_9412b96.rar"&gt;devzone.nordicsemi.com/.../nRF5_5F00_SDK_5F00_15.2.0_5F00_9412b96.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Nirav Patel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206294?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 09:18:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dea9114-b2ca-4b39-88a1-5d376f53b57e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Let me just recap the previous post:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You are testing on the nRF52840 DK.&lt;/li&gt;
&lt;li&gt;You are testing the&amp;nbsp;\examples\ble_peripheral\ble_app_hrs\pca10056\s140\arm5_no_packs example project in SDK 15.2&lt;/li&gt;
&lt;li&gt;Your &lt;em&gt;only&lt;/em&gt; modification is what you have listed for the projects sdk_config.h (which is the correct settings for using the internal 32.768 kHz RC oscillator).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Is this correct? Or have you made other modifications as well? I ask because there is nothing wrong with what you described, and I just tested the example with the modifications you have described, and it works as expected. Please explain any other modifications you have made, and please upload your complete zipped example project so that I can see if there are any other changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206228?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 06:59:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a495c1a-7700-4ce1-b9f9-de1d1cce4bf2</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;&lt;span&gt;Thanks, Einar Thorsrud,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How have you verified that it hangs in&amp;nbsp;sd_softdevice_enable()? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;==&amp;gt; In debug mode&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That will happen if you configure the SoftDevice to start the xtal oscillator and the xtal is not in the HW.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;==&amp;gt;Used nRF52840 DK (PCA10056) for testing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Your sdk_config.h configuration seems sensible, but it is the configuration for the SoftDevice handler library and it seems you are calling&amp;nbsp;sd_softdevice_enable() directly. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I cannot tell from your question how you have populated&amp;nbsp;clock_lf_cfg. Can you share that?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;==&amp;gt; I made only below changes in HRS example:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&amp;quot;...\...\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_hrs\pca10056\s140\arm5_no_packs&lt;/strong&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;/h&amp;gt; 
//==========================================================

// &amp;lt;h&amp;gt; Clock - SoftDevice clock configuration

//==========================================================
// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
 
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_SRC_RC 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_SRC_XTAL 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_SRC_SYNTH 

#ifndef NRF_SDH_CLOCK_LF_SRC
#define NRF_SDH_CLOCK_LF_SRC 0
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
#ifndef NRF_SDH_CLOCK_LF_RC_CTIV
#define NRF_SDH_CLOCK_LF_RC_CTIV 16
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
// &amp;lt;i&amp;gt; How often (in number of calibration intervals) the RC oscillator shall be calibrated
// &amp;lt;i&amp;gt;  if the temperature has not changed.

#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
#endif

// &amp;lt;o&amp;gt; NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
 
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_ACCURACY_250_PPM 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_ACCURACY_500_PPM 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_ACCURACY_150_PPM 
// &amp;lt;3=&amp;gt; NRF_CLOCK_LF_ACCURACY_100_PPM 
// &amp;lt;4=&amp;gt; NRF_CLOCK_LF_ACCURACY_75_PPM 
// &amp;lt;5=&amp;gt; NRF_CLOCK_LF_ACCURACY_50_PPM 
// &amp;lt;6=&amp;gt; NRF_CLOCK_LF_ACCURACY_30_PPM 
// &amp;lt;7=&amp;gt; NRF_CLOCK_LF_ACCURACY_20_PPM 
// &amp;lt;8=&amp;gt; NRF_CLOCK_LF_ACCURACY_10_PPM 
// &amp;lt;9=&amp;gt; NRF_CLOCK_LF_ACCURACY_5_PPM 
// &amp;lt;10=&amp;gt; NRF_CLOCK_LF_ACCURACY_2_PPM 
// &amp;lt;11=&amp;gt; NRF_CLOCK_LF_ACCURACY_1_PPM 

#ifndef NRF_SDH_CLOCK_LF_ACCURACY
#define NRF_SDH_CLOCK_LF_ACCURACY 1
#endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;==&amp;gt; I am not sure but are you want to know about below configuration: &lt;strong&gt;(clock_lf_cfg)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;ret_code_t nrf_sdh_enable_request(void)
{
    ret_code_t ret_code;

    if (m_nrf_sdh_enabled)
    {
        return NRF_ERROR_INVALID_STATE;
    }

    m_nrf_sdh_continue = true;

    // Notify observers about SoftDevice enable request.
    if (sdh_request_observer_notify(NRF_SDH_EVT_ENABLE_REQUEST) == NRF_ERROR_BUSY)
    {
        // Enable process was stopped.
        return NRF_SUCCESS;
    }

    // Notify observers about starting SoftDevice enable process.
    sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLE_PREPARE);

    nrf_clock_lf_cfg_t const clock_lf_cfg =
    {
        .source       = NRF_SDH_CLOCK_LF_SRC,
        .rc_ctiv      = NRF_SDH_CLOCK_LF_RC_CTIV,
        .rc_temp_ctiv = NRF_SDH_CLOCK_LF_RC_TEMP_CTIV,
        .accuracy     = NRF_SDH_CLOCK_LF_ACCURACY
    };

    CRITICAL_REGION_ENTER();
#ifdef ANT_LICENSE_KEY
    ret_code = sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler, ANT_LICENSE_KEY);
#else
    ret_code = sd_softdevice_enable(&amp;amp;clock_lf_cfg, app_error_fault_handler);
#endif
    m_nrf_sdh_enabled = (ret_code == NRF_SUCCESS);
    CRITICAL_REGION_EXIT();

    if (ret_code != NRF_SUCCESS)
    {
        return ret_code;
    }

    m_nrf_sdh_continue  = false;
    m_nrf_sdh_suspended = false;

    // Enable event interrupt.
    // Interrupt priority has already been set by the stack.
    softdevices_evt_irq_enable();

    // Notify observers about a finished SoftDevice enable process.
    sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLED);

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I suspect that it is not using the SDH configuration you from your sdk_config.h.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;==&amp;gt; How can I check that?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;--&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Nirav Patel&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hang in sd_softdevice_enable() when use nRF52840 Internal oscillator</title><link>https://devzone.nordicsemi.com/thread/206122?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 12:56:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf7ce782-8b56-42d7-85e4-7a8a64c44b9a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How have you verified that it hangs in&amp;nbsp;sd_softdevice_enable()? That will happen if you configure the SoftDevice to start the xtal oscillator and the xtal is not in the HW. Your sdk_config.h configuration seems sensible, but it is the configuration for the SoftDevice handler library and it seems you are calling&amp;nbsp;sd_softdevice_enable() directly. I cannot tell from your question how you have populated&amp;nbsp;clock_lf_cfg. Can you share that? I suspect that it is not using the SDH configuration you from your sdk_config.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>