<?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>what happens if LFCLKSRC that is selected isn&amp;#39;t available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing</link><description>On nRF52832, 
 A1&amp;gt; Out of the Softdevice scope: if we are using RTC and have LFCLKSRC configured to XTAL source and if XTAL source gets turned off for some reason what happens. Does the system automatically switch to LFRC source? any NMI or event generated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Oct 2019 19:32:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing" /><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/215377?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 19:32:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f869bbf-b2f6-4bb5-b586-7d5a4f328a41</guid><dc:creator>santosh athuru</dc:creator><description>&lt;p&gt;Hi Sigrud,&lt;/p&gt;
&lt;p&gt;sounds good. Thanks for the confirmation.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Santosh Athuru&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/208446?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 11:16:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e95a5381-9715-4fcd-a8ad-ceffd471af0d</guid><dc:creator>Sigurd</dc:creator><description>[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/208336"]Is my understanding right?[/quote]
&lt;p&gt;Yes. If the SoftDevice is the one starting the LFCLK, it will wait for&amp;nbsp;&lt;span&gt;LFCLKSTARTED&amp;nbsp;with WFE. But if the application itself started the LFCLK with&amp;nbsp;source XTAL, before enabling the SD with source clock_lf_cfg.source=1 (XTAL), the SoftDevice will detect that the application already started the LFCLK, and&amp;nbsp;&lt;/span&gt;&lt;span&gt;will then just loop waiting for&amp;nbsp;LFCLKSTAT SRC to change from RC to XTAL.(and this will never happen if XTAL is missing). If you want to avoid this in your application, then you should wait for&amp;nbsp;LFCLKSTARTED(with WFE) in the application before enabling the SoftDevice.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/208336?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2019 20:20:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f0d9826-5ccf-49fd-848b-6039aa0d133d</guid><dc:creator>santosh athuru</dc:creator><description>&lt;p&gt;Thanks, so there is a WFE based wait (based on your response above) and a CPU loop waiting for LFCLKSTAT SRC.&lt;/p&gt;
&lt;p&gt;The former one comes in based on clock_lf_cfg (nrf_sdh.c)&amp;nbsp;and irrespective of LFCLKSRC it doesn&amp;#39;t consume extra current because it is WFE based wait. I didn&amp;#39;t see the extra current and I didn&amp;#39;t see Softdevice running either here, if XTAL is OFF and clock_lf_cfg.source = 1.&lt;/p&gt;
&lt;p&gt;The latter one,&amp;nbsp;however,&amp;nbsp;puts the CPU in a spin loop which results in extra current draw, if XTAL is not available when LFCLKSRC is set to 1.&lt;/p&gt;
&lt;p&gt;Is my understanding right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Santosh Athuru&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/207918?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2019 11:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a6b3d3c-c1cd-4c16-8e8f-25412fca0daa</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;If the&amp;nbsp;LFCLK is already started or in the process of starting with the correct clock source(XTAL), the SD will just wait for the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=3_1_0_18_2_5#register.LFCLKSTAT"&gt;LFCLKSTAT SRC&lt;/a&gt; to change from RC to XTAL. It&amp;#39;s the CPU current you are seeing here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/206726?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 22:05:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d48f640a-4706-4650-85a2-18fb46d45d36</guid><dc:creator>santosh athuru</dc:creator><description>&lt;p&gt;I&amp;#39;ve a reboot counter that is incremented every time code is run after reboot. So I can tell reboot isn&amp;#39;t happening, also there are some IO, I monitor on scope.&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206684"]The CPU will enter WFE(Wait For Event) sleep, while waiting for the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fclock.html&amp;amp;cp=3_1_0_18_1&amp;amp;anchor=concept_xkj_np1_2r"&gt;LFCLKSTARTED event&lt;/a&gt;.[/quote]
&lt;p&gt;If we start our application with LFCLKSRC = 1, XTAL is missing, so RTC assumes LFRC as source and runs. We don&amp;#39;t wait for any Clock started event in our code and start softdevice. Now, softdevice is trying to use XTAL as LFCLKSRC and is stuck doing something. Here we observe about 2mA of current draw, till XTAL is available.&lt;/p&gt;
&lt;p&gt;But, if we start our application with LFCLKSRC = 0, XTAL is missing, RTC uses LFRC as source. We configure&amp;nbsp;softdevice to use XTAL as LFCLKSRC, soft device is stuck waiting for XTAL. Here we don&amp;#39;t see the 2mA current draw we saw in above case.&lt;/p&gt;
&lt;p&gt;So we are wondering what inside softdevice is causing this extra 2mA current draw in first case above.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Santosh Athuru&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/206684?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 14:41:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83e2ae69-1ea4-4b52-9be6-8ee46e70898f</guid><dc:creator>Sigurd</dc:creator><description>[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206452"] Softdevice is not enabled yet, so what is CPU doing, I mean which clock source is the CPU running off at this time.[/quote]
&lt;p&gt;The CPU is not using the LFCLK, the CPU uses the HFCLK, see the figure at &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=3_1_0_18#frontpage_clock"&gt;this page.&lt;/a&gt;&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206452"]If the LFCLKSRC that is chosen is not available, RTC will not run, correct? [/quote]
&lt;p&gt;The&amp;nbsp;RTC itself will still work, it can run from internal&amp;nbsp;&lt;span&gt;RC oscillator. But if&amp;nbsp;LFCLK XTAL is chosen, but not&amp;nbsp;available, you will be stuck in&amp;nbsp;sd_softdevice_enable().&lt;/span&gt;&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206452"]Can you clarify &amp;#39;stuck in sd_softdevice_enable()&amp;#39; ?&amp;nbsp;CPU is running, but the SW is waiting for some event...forever? [/quote]
&lt;p&gt;The CPU will enter WFE(Wait For Event) sleep, while waiting for the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fclock.html&amp;amp;cp=3_1_0_18_1&amp;amp;anchor=concept_xkj_np1_2r"&gt;LFCLKSTARTED event&lt;/a&gt;.&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206452"]Again which clock source is CPU running off?[/quote]
&lt;p&gt;HFCLK(If HFXO is not explicitly started, it will run from 64 MHz internal oscillator(HFINT)).&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206452"]I don&amp;#39;t see a reset happening here, it looks like Nordic pauses and resumes back when the XTAL is available. I need some way to correctly confirm this behavior while using soft device. [/quote]
&lt;p&gt;I have not tested it, but I find the&amp;nbsp;behavior you&amp;nbsp;describe&amp;nbsp;feasible. How did you test this ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/206452?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 17:29:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b094ba7f-8608-4751-b837-f5fc5cdf3b79</guid><dc:creator>santosh athuru</dc:creator><description>&lt;p&gt;[quote userid="15146" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206108"][/quote]&lt;/p&gt;
&lt;blockquote class="quote"&gt;
&lt;div class="quote-user"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"&gt;santosh athuru said:&lt;/a&gt;&lt;/div&gt;
&lt;div class="quote-content"&gt;Does the system automatically switch to LFRC source?&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;No.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the above use case , Softdevice is not enabled yet, so what is CPU doing, I mean which clock source is the CPU running off at this time. If the LFCLKSRC that is chosen is not available, RTC will not run, correct? but will the CPU be running?&lt;/p&gt;
&lt;p&gt;[quote userid="15146" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206108"][/quote]&lt;/p&gt;
&lt;blockquote class="quote"&gt;
&lt;div class="quote-user"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"&gt;santosh athuru said:&lt;/a&gt;&lt;/div&gt;
&lt;div class="quote-content"&gt;what happens if the softdevice is started with LFCLKSRC missing (Configure LFCLKSRC to XTAL and XTAL is not available)?&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;It will indefinitely wait for the LFCLK XTAL to start. You will be stuck in&amp;nbsp;sd_softdevice_enable().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the above use case, softdevice is being enabled. Can you clarify &amp;#39;stuck in sd_softdevice_enable()&amp;#39; ?&amp;nbsp;CPU is running, but the SW is waiting for some event...forever? Again which clock source is CPU running off?&lt;/p&gt;
&lt;p&gt;[quote userid="15146" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing/206108"][/quote]&lt;/p&gt;
&lt;blockquote class="quote"&gt;
&lt;div class="quote-content"&gt;what happens if the XTAL goes missing during run time? is there any interrupt generated?&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;The code will likely assert and reset.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see a reset happening here, it looks like Nordic pauses and resumes back when the XTAL is available. I need some way to correctly confirm this behavior while using soft device. Please advise.&lt;/p&gt;
&lt;p&gt;One of the problems, I&amp;#39;m looking at is,if Radio is transmitting while the clock goes missing and if the Nordic is stuck in that state then&amp;nbsp;it keeps drawing extra current?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Santosh Athuru&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)</title><link>https://devzone.nordicsemi.com/thread/206108?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 12:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbf7c454-b023-4ab2-aeb6-6df209d2ba49</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"]Does the system automatically switch to LFRC source?[/quote]
&lt;p&gt;No.&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"]any NMI or event generated for software to know/handle?[/quote]
&lt;p&gt;No.&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"]what happens if the softdevice is started with LFCLKSRC missing (Configure LFCLKSRC to XTAL and XTAL is not available)?[/quote]
&lt;p&gt;It will indefinitely wait for the LFCLK XTAL to start. You will be stuck in&amp;nbsp;sd_softdevice_enable().&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"]what happens if the XTAL goes missing during run time? is there any interrupt generated?[/quote]
&lt;p&gt;The code will likely assert and reset.&lt;/p&gt;
[quote userid="73547" url="~/f/nordic-q-a/51322/what-happens-if-lfclksrc-that-is-selected-isn-t-available-for-ex---goes-missing"]Is there any documentation available that shows the nRF52832 behavior for above scenarios?[/quote]
&lt;p&gt;Not&amp;nbsp;specifically. If you are worried for the&amp;nbsp;scenario you&amp;nbsp;describe, you could implemented a LFCLK XTAL test function, that you run before you enable the SD. The function could check that you are able to start the LFCLK with XTAL within some time limit. If the test passes, use XTAL, if not use RC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>