<?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>Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37303/can-not-use-xtal-lf-clk-source-without-softdevice-on-sdk15</link><description>Hi everyone, 
 I want to set LF CLK source to XTAL without softdevice. But, LFCLKSTAT value is 0x00010000(CKL RUN, CLK SRC = RC) after clock start. 
 So, I checked same test on PCA10056 board with &amp;quot;flash_fds&amp;quot; example. and, I added followings after &amp;quot;cli_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Aug 2018 13:24:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37303/can-not-use-xtal-lf-clk-source-without-softdevice-on-sdk15" /><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143737?ContentTypeID=1</link><pubDate>Fri, 10 Aug 2018 13:24:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a7aba1a-95a4-4541-9158-6703080c5856</guid><dc:creator>masataka hasegawa</dc:creator><description>&lt;p&gt;thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143648?ContentTypeID=1</link><pubDate>Fri, 10 Aug 2018 04:17:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4946778b-3cbe-4428-ace9-6f4b324481ca</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Yes - one or the other. Whichever suits your code best then pick.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143646?ContentTypeID=1</link><pubDate>Fri, 10 Aug 2018 03:28:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ac3bd1d-9e17-47dc-871f-dc8b974ea72d</guid><dc:creator>masataka hasegawa</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I checked your advice points (added handler and receive event).&lt;br /&gt;I understood it (firstly RC clock starts, and takes a long time to change XTAL).&lt;/p&gt;
&lt;p&gt;So, If I want to wait the XTAL clock starting correctly,&lt;br /&gt;I should check LFCLKSTAT = 0x00010001, or should add the event handler.&lt;/p&gt;
&lt;p&gt;Is this correct?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143536?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 10:49:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6644dcb0-0f2a-4dfe-938f-a321de65ffa0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As RK said, this is expected behaviour. Using the driver you can provide a event handler to the call to&amp;nbsp;&lt;code&gt;nrf_drv_clock_lfclk_request()&lt;/code&gt;, which so that you get a callback when the clock has started. This is not done in the flash_fds example, where a NULL pointer is passed instead of a function pointer to the event handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143534?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 10:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:543fe2f5-9f13-4665-a786-d7faa8096ae0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;yes the 32.768kHz crystal has a long startup time, the documentation says 250ms is normal.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you read the description in the manual&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;If the LFXO is selected as the clock source, the LFCLK will initially start running from the 32.768 kHz LFRC while the LFXO is starting up and automatically switch to using the LFXO once this oscillator is running.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So nrf_clock_lf_is_running() correctly returns as there *is* an LF clock running. However until the crystal has started, it&amp;#39;s not yet the LFXO. If you actually need that clock source to be active, you need to wait for it. I assume the softdevice&amp;nbsp;actually waits for the LFXO source to be active (which is why people with no crystal who forget to change the source complain the softdevice hangs).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So there is a slight difference between the softdevice and non-softdevice versions of the code in that one waits for the actual crystal source to run, the other just waits until there&amp;#39;s some &amp;nbsp;LF clock source started even if it&amp;#39;s not yet the crystal.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143531?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 10:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afbb71cd-c5c5-42f8-bace-ecb3ed529d1c</guid><dc:creator>masataka hasegawa</dc:creator><description>&lt;p&gt;I checked it with debugger, and I got 0x00010001 value,&lt;br /&gt;but, printf debug value is 0x00010000.&lt;/p&gt;
&lt;p&gt;I found new phenomenon.&lt;br /&gt;I add printf debug into main loop of main.c&lt;/p&gt;
&lt;p&gt;and execute it,&lt;br /&gt;register value is changed on the way.&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: LFCLKSTAT&amp;nbsp; &amp;nbsp; &amp;nbsp;= 00010000&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; about 50 times&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:&lt;br /&gt;&amp;lt;info&amp;gt; app: LFCLKSTAT&amp;nbsp; &amp;nbsp; &amp;nbsp;= 00010000&lt;br /&gt;&lt;span&gt;&amp;lt;info&amp;gt; app: LFCLKSTAT&amp;nbsp; &amp;nbsp; &amp;nbsp;= 00010001&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Why?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bit 16 of LFCLKSTAT is RUN state,&lt;br /&gt;and I think that bit 1-0 of&amp;nbsp;LFCLKSTAT is validate at bit 16 rise timing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;does it take long time to change RC to XTAL?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143516?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 09:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cbd1bdd-046d-4a7b-a894-fc5113e910b0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Indeed! I only glanced at the example earlier, but I see that you are correct. In that case, the clock source depend on the driver configuration, and the example is configured to use the xtal by default, as&amp;nbsp;CLOCK_CONFIG_LF_SRC in sdk_config.h is set to 1. I tested the unmodified example now, and it seems to work as expected. LFCLKSTAT is 0x001001 when I check with a debugger. Can you check to verify that you have not accidentally changed that in your sdk_config.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143511?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 08:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7292ab99-15cf-404d-9b25-25ee8922debf</guid><dc:creator>masataka hasegawa</dc:creator><description>&lt;p&gt;&amp;quot;flash_fds example without softdevice&amp;quot; calls clock_init().&lt;br /&gt;and, clock_init() calls nrf_drv_clock_lfclk_request() and waits clock start by&amp;nbsp;nrf_clock_lf_is_running().&lt;br /&gt;So, I think that your review point is already executed.&lt;br /&gt;&amp;quot;LFCLKSTAT = 0x00010000&amp;quot; indicated to already run LF clock also.&lt;br /&gt;But, RC source instead of XTAL.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143505?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 08:31:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93a415ca-0541-4c41-b43b-2515dcdb76fd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The&amp;nbsp; &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/fds_example.html?cp=4_0_0_4_5_8"&gt;Flash Data Storage Example&lt;/a&gt; example can be used both with and without the SoftDevice. The SoftDevice will always start the LF clock, but the application&amp;nbsp;need to start the LF clock (if needed) in case you run the example without the SoftDevice, as RK suggested. You can do that using the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/hardware_driver_clock.html?cp=4_0_0_2_0_0"&gt;clock driver&lt;/a&gt;, or by writing to the clock &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_1_0_18_2#topic"&gt;CLOCK registers&lt;/a&gt; directly:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = 1;                    // Select xtal
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;            // Start LFCLK
while(NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0); // Wait for clock to start&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143468?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 05:01:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64ac5d9e-f253-417e-9f12-1c76ccbf287d</guid><dc:creator>masataka hasegawa</dc:creator><description>&lt;p&gt;I use flash_fds sample in SDK as it is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can not use XTAL LF CLK source without softdevice on SDK15.</title><link>https://devzone.nordicsemi.com/thread/143466?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 04:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:421ab4d4-1a87-4c90-afab-5740c4b0d275</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Are you actually starting the LF clock in the code? Just setting the defines won&amp;#39;t do anything.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>