<?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>Analysis of  Clock source</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60454/analysis-of-clock-source</link><description>Hi , 
 
 
 
 
 I am working on project which is based on nrf9160 Development board. 
 could you please verify these points- 
 1. I am sharing the snapshot of the registers before going through the function nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Apr 2020 11:03:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60454/analysis-of-clock-source" /><item><title>RE: Analysis of  Clock source</title><link>https://devzone.nordicsemi.com/thread/245818?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 11:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07c8f86e-3a59-464d-b6cb-639e07215ecf</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>[quote user="shruti mishra"]1. According to initial values in LFCLKSTAT register which is [1:0] ,Board is using 32kHZ clock source initially. means 1 refers to the LFRC and 0 refers to the requested LFCLK source has not been started.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;The clock source is set by the kernel, with this symbol:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-zephyr/blob/v2.1.99-ncs1/drivers/clock_control/Kconfig.nrf#L27"&gt;https://github.com/NordicPlayground/fw-nrfconnect-zephyr/blob/v2.1.99-ncs1/drivers/clock_control/Kconfig.nrf#L27&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is not started until the kernel has started the LFCLK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="shruti mishra"]But why the status is not running . To show the status as running we need to trigger the&amp;nbsp;&lt;span&gt;NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1; then what will be the difference . means both the cases using the same clock of 32kHz.&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;I think you&amp;#39;re breaking before main, at which point the kernel hasn&amp;#39;t booted up properly yet. Can you try breaking in main and see if the clocks are set properly?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Analysis of  Clock source</title><link>https://devzone.nordicsemi.com/thread/245810?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 10:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c377b49-8325-4ba9-97b2-ab221faaebed</guid><dc:creator>shruti mishra</dc:creator><description>&lt;p&gt;Hi Hakon&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please verify these points also-&lt;/p&gt;
&lt;p&gt;1. According to initial values in LFCLKSTAT register which is [1:0] ,Board is using 32kHZ clock source initially. means 1 refers to the LFRC and 0 refers to the requested LFCLK source has not been started.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But why the status is not running . To show the status as running we need to trigger the&amp;nbsp;&lt;span&gt;NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1; then what will be the difference . means both the cases using the same clock of 32kHz.&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;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Analysis of  Clock source</title><link>https://devzone.nordicsemi.com/thread/245731?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 07:31:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f960ce7-1c3a-4d0a-8bc7-0c877b37263b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s two clock sources:&lt;/p&gt;
&lt;p&gt;* HFCLK&lt;/p&gt;
&lt;p&gt;* LFCLK (automatically started by the zephyr kernel)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are changing the LFCLK (32.768 kHz) and inspecting the HFCLK registers. Try triggering&lt;/p&gt;
&lt;p&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;p&gt;while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then checking HFCLKSTAT register.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>