<?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>Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60899/custom-nrf52840-board-softdevice-clock-configuration</link><description>Hello, 
 I am having problems with a custom NRF52840 Board. My program hands at the ble_stack_init function. 
 I have encoutered this problem in the past so I have tried the different solutions that worked previously. My board uses both a HF and LF. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 May 2020 06:47:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60899/custom-nrf52840-board-softdevice-clock-configuration" /><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/250349?ContentTypeID=1</link><pubDate>Mon, 18 May 2020 06:47:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d463e8b-c732-440a-9478-1c227ec6972c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You need to specify a calibration interval and also adjust the accuracy when selecting the internal RC oscillator.&lt;/p&gt;
&lt;p&gt;Configuration settings for RC source:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&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;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/250279?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 20:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e9bda58-2348-4b5a-8fd9-073cb354f3a9</guid><dc:creator>David</dc:creator><description>&lt;p&gt;I agree. I have tested on multiple boards and they call give the same results.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am also not able to use the internal RC as the softdevice clock source. I try to select&amp;nbsp;NRF_SDH_CLOCK_LF_SRC as 0, but My program also hangs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any other clock setting I am missing in order to use this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248747?ContentTypeID=1</link><pubDate>Thu, 07 May 2020 13:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6d99de8-6bf4-4ae2-bb34-36fa78921e18</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Could it be a problem with soldering or mounting of the crystal then? Also, did you have multiple boards to test this on, or have you only tested this on one board? I think you should be able to start the crystal even if the layout is not optimal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248401?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 10:35:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc19e2d3-0634-4547-92eb-8646bf54a734</guid><dc:creator>David</dc:creator><description>&lt;p&gt;I have been using this as my reference design and it has been working. The other little thing to note is the LFCLK is physically close to the HFCLK because this is a very small form factor board. Could this be an issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248384?ContentTypeID=1</link><pubDate>Wed, 06 May 2020 09:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d966798-0c41-478c-9c11-6a552f3b635f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;C12 and C15 should be closer to 8pF (see&amp;nbsp;&lt;a title="32.768 kHz crystal oscillator (LFXO)" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1_3#concept_pln_z5y_2q"&gt;32.768 kHz crystal oscillator (LFXO)&lt;/a&gt;&amp;nbsp;chapter for calculation) if the load capacitance of your crystal is CL=6pF.&amp;nbsp; Wrong loading of the crystal will offset the frequency, but I would still have expected the crystal to ramp up. Have you seen this on more than one board?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248184?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 12:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fc50931-0e15-4157-ae6e-69d48449838c</guid><dc:creator>David</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/fdf.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is the clock circuit I am using.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://lcsc.com/product-detail/SMD-Crystal-Resonators_Seiko-Epson_X1A000141000600_Seiko-Epson-X1A000141000600_C94673.html"&gt;https://lcsc.com/product-detail/SMD-Crystal-Resonators_Seiko-Epson_X1A000141000600_Seiko-Epson-X1A000141000600_C94673.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248179?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 12:45:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b8296a2-a6ae-4419-8a2d-6bb62e989e37</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You have to explicitly select the crystal to use it. Otherwise, you will be starting the internal RC oscillator.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248176?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 12:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50dfac20-6176-43e9-97eb-9e1fa73c1d8d</guid><dc:creator>David</dc:creator><description>&lt;p&gt;This is a different board. It seems a bit odd that the crystal will start if it&amp;#39;s not explicitly selected. Can you offer a reasoning behind this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/248050?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 06:30:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdb95c45-ccee-45f1-a848-81de2923e730</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;So the crystal never starts indicating that this&amp;nbsp;a HW problem. Is it the same board that was discussed in your previous ticket? Maybe you can get Kaja to review your clock circuit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/247875?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 12:57:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af2be2f6-b76d-4a82-92be-42753f6fb7e2</guid><dc:creator>David</dc:creator><description>&lt;p&gt;So now the code hangs here:&lt;/p&gt;
&lt;p&gt;while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0);&lt;/p&gt;
&lt;p&gt;Is seems like that lfclk doesnt start when it is selected. But with our&amp;nbsp;this&amp;nbsp;NRF_CLOCK-&amp;gt;LFCLKSRC = 1;&lt;/p&gt;
&lt;p&gt;passes the while loop.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/247870?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 12:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f30fc90f-4926-47c1-a012-3af22bed4e73</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The sdk_config setting will not be applied when you don&amp;#39;t use the clock driver. Try this instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = 1; /* Select xtal source */
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/247863?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 12:34:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2ec24a3-eb20-4637-810f-b5019868ad30</guid><dc:creator>David</dc:creator><description>&lt;p&gt;Should this be selected in the sdk_config file or it should be called as a function?&lt;/p&gt;
&lt;p&gt;My config file already selects this.&lt;/p&gt;
&lt;p&gt;#define NRFX_CLOCK_CONFIG_LF_SRC 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/247855?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 12:13:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87445903-0af7-49b8-90a8-e5fb0a163a59</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You need to select xtal as the clock source in &lt;span&gt;&lt;a title="LFCLKSRC" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/clock.html?cp=4_0_0_4_3_2_20#register.LFCLKSRC"&gt;LFCLKSRC &lt;/a&gt;before running the LF clock start task. RC is the default clock source after reset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/247688?ContentTypeID=1</link><pubDate>Fri, 01 May 2020 15:13:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b92d9cb-535f-4df2-bacb-af4c61c5c20e</guid><dc:creator>David</dc:creator><description>&lt;p&gt;Hello, I changed this to&amp;nbsp;&lt;span&gt;LFCLKSTARTED and I still get the same result. The code passes the test and LFCLK is started. But still hangs at ble_stack_init&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom NRF52840 Board Softdevice Clock Configuration</title><link>https://devzone.nordicsemi.com/thread/247669?ContentTypeID=1</link><pubDate>Fri, 01 May 2020 07:50:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45767dc1-7097-4374-9e3f-3e820c0c9f07</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Clean your glasses and look closely at the posted source code:&lt;/p&gt;
&lt;p&gt;In the second step you start the LF clock with LFCLKSTART but then use the already set HFCLKSTARTED when trying to wait. You wanted to use the LFCLKSTARTED event instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>