<?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>Another SoftDevice LFCLOCK issue, this time on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53888/another-softdevice-lfclock-issue-this-time-on-nrf52840</link><description>We are developing with the nRF52840, in this instance present in a Laird BL654 module carried by their DVK-BL654 dev board. 
 After trying three separate examples that attempt to use SoftDevice, they all seem to lock up in the SoftDevice code, waiting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Nov 2019 17:18:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53888/another-softdevice-lfclock-issue-this-time-on-nrf52840" /><item><title>RE: Another SoftDevice LFCLOCK issue, this time on nRF52840</title><link>https://devzone.nordicsemi.com/thread/218017?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2019 17:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1820ab1-b3d7-4528-9a40-cfc42cf254d9</guid><dc:creator>Rob R</dc:creator><description>&lt;p&gt;Hi Bj&amp;oslash;rn,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for that, it worked!&lt;/p&gt;
&lt;p&gt;(SDK v16, SoftDevice 240)&lt;/p&gt;
&lt;p&gt;Best Wishes&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Rob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Another SoftDevice LFCLOCK issue, this time on nRF52840</title><link>https://devzone.nordicsemi.com/thread/217974?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2019 13:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f7be384-eba7-4ac2-9e9f-8fac8e3052c3</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Rob,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which SDK and SoftDevice version are you using?&lt;/p&gt;
&lt;p&gt;All SoftDevices for the nRF52840 support both 32kHx XTAL and the use of the internal 32kHz RC oscillator&lt;/p&gt;
&lt;p&gt;You should only have to set the following defines in sdk_config.h for the nRF52840 to use the RC oscillator&amp;nbsp; instead of the XTAL&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&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

// &amp;lt;/h&amp;gt; 
//==========================================================&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Another SoftDevice LFCLOCK issue, this time on nRF52840</title><link>https://devzone.nordicsemi.com/thread/217948?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2019 12:27:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:217bb494-b23a-4a1f-9752-4763b53c4b97</guid><dc:creator>Rob R</dc:creator><description>&lt;p&gt;Following up my own post,&lt;/p&gt;
&lt;p&gt;Aggressive cleaning and rebuilding has revealed different behaviour:&amp;nbsp; ble_init trips an assertion if any clock source other than XTAL is selected.&amp;nbsp; The root cause of this seems to be that sd_softdevice_enable returns an error code.&amp;nbsp; (That symbol corresponds to an entry point on the softdevice binary.)&lt;/p&gt;
&lt;p&gt;So that would seem to be an end to the matter (Somewhere I read something that Softdevices on this silicon don&amp;#39;t yet support non XTAL clocks)&lt;/p&gt;
&lt;p&gt;For the sake of completeness...&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve noted that there are three separate macros in the config file.&lt;/p&gt;
&lt;p&gt;NRFX_CLOCK_CONFIG_LF_SRC which is read by nrfx_clock_enable and which may be overridden by CLOCK_CONFIG_LF_SRC (Sadly I don&amp;#39;t have the time to fully unwind the inclusion graph of the project.)&lt;/p&gt;
&lt;p&gt;CLOCK_CONFIG_LF_SRC (might override the above, also used for some logic in regard of calibration enabling.)&lt;/p&gt;
&lt;p&gt;NRF_SDH_CLOCK_LF_SRC which is used to populate a structure in nrf_sdh_enable_request, which it passes to sd_softdevice_enable,&lt;/p&gt;
&lt;p&gt;I applied a breakpoint to nrfx_clock_enable, and it doesn&amp;#39;t seem to get called, which is a little surprising, it would seem that the SoftDevice handles that internally rather than using the callbacks.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve noticed that when the crystal is selected but missing, the Heart Rate sensor app tends to get caught waiting for the clock to start, but the mouse&amp;nbsp;simulator stalls on trying to read the UART: Waiting for either a BRK or to receive 0x01.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>