<?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>How to detect the external low-frequency vibration crystal work?When it doesn&amp;#39;t work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21697/how-to-detect-the-external-low-frequency-vibration-crystal-work-when-it-doesn-t-work-how-to-switch-frequency-crystals</link><description>52832，SDK12.0.0 
 I met such a situation:
In the use of JLink burning program or air upgrade, after the completion of the program card died in initialization low-frequency crystals. 
 &amp;quot;sd_softdevice_enable(p_clock_lf_cfg, softdevice_fault_handler);</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 May 2017 11:46:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21697/how-to-detect-the-external-low-frequency-vibration-crystal-work-when-it-doesn-t-work-how-to-switch-frequency-crystals" /><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85220?ContentTypeID=1</link><pubDate>Fri, 26 May 2017 11:46:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99c6b08a-132b-4136-a97a-9fc72f738351</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;No effect, as in the LFCLKSTAT reads 0x00010000 after you&amp;#39;ve triggered the TASKS_LFCLKSTOP task? If the LFCLKSRC is set to Xtal, and you trigger the TASKS_LFCLKSTART do you get the EVENTS_LFCLKSTARTED event?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85216?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 09:47:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a8ba076-c331-4f43-8788-15e0eb77cacd</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;After the exception occurs, I&amp;#39;ve tried NRF_CLOCK-&amp;gt;TASKS_LFCLKSTOP = 1, But there is no effect.
I&amp;#39;ve tested external low-frequency crystals did not work at this moment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85215?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 07:20:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0fd574b-0954-4be4-a61e-5015cafb767f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Triggering the TASKS_LFCLKSTOP task, i.e. &lt;code&gt;NRF_CLOCK-&amp;gt;TASKS_LFCLKSTOP = 1;&lt;/code&gt; should stop the LFCLK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85214?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 13:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7a67d7c-afd1-4349-9e9a-61e6174987fe</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;What method can make NRF_CLOCK-&amp;gt;LFCLKSTAT == 0？&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85213?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 06:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb6bc0b5-6ca2-4410-ba82-0c3edead5cda</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Could you clarify what you mean with &amp;quot;remove NRF_CLOCK-&amp;gt;LFCLKSTAT&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85211?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 14:34:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fa7d6cc-1a42-4d44-ab0c-ec4ea433f6f5</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;Have a way to remove NRF_CLOCK - &amp;gt; LFCLKSTAT status?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85212?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 13:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f411ba7-92b0-4a64-a25f-1d3c2db14d9f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Have you confirmed that you have the correct load caps for the external crystal? I have never seen this issue before, i.e. that the XTAL does not start up correctly when you set NRF_CLOCK_LF_SRC_XTAL as source, provided that a crystal with the correct specs and the correct load caps are used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85210?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 12:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5d6bb4c-7e47-48ae-9f26-4a46ebddacd1</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;When using external low-frequency crystals, if NRF_CLOCK - &amp;gt; LFCLKSTAT = = 0 x00010000, the program will stuck in sd_softdevice_enable (p_clock_lf_cfg softdevice_fault_handler);
In the use of JLink burning program, I met many times this exception, air upgrade also appeared in the process.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85221?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 08:12:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89c57ea8-1f2b-486e-b250-4848b34df2bf</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I apologize, I referred to an incorrect register value( 0x8001) and corrected my comment. The default value of the LFCLKSRC is 0x00000000 so if you start the LFCLK using the TASKS_LFCLKSTART task then you will read 0x00010000. I still do not understand why you need to check this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85209?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 15:23:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1a794fe-44d9-41bb-8b83-90530e58278a</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;yes.I read 0x00010000 from the LFCLKSTAT register.
I use projects: SDK12.0.0 ; examples\ble_peripheral\ble_app_hrs_freertos
The following code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
    ret_code_t err_code;
    uint32_t lfclk_state = 1;
    
    while(lfclk_state)
    {
        lfclk_state = NRF_CLOCK-&amp;gt;LFCLKSTAT; //lfclk_state =0x00010000
    }
    
    err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);
....
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After the exception occurs, I put the low-frequency clock configuration set to use internal frequency clock, the program can run, but related to low frequency clock driver is invalid, such as app_timer, WDT, etc&lt;/p&gt;
&lt;p&gt;After this exception occurs,Cut off the chip power supply, and then to electricity to make the program run normally&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85208?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 07:31:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0148998e-512b-47f2-9e9f-bfe120dcce25</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;After initialization, you mean that after you&amp;#39;ve called &lt;code&gt;sd_softdevice_enable&lt;/code&gt; with the following clock config&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    // Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then you read  &lt;code&gt;0x00010000&lt;/code&gt; from the LFCLKSTAT register?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85207?ContentTypeID=1</link><pubDate>Wed, 17 May 2017 12:40:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c090ba6-7c07-48ad-94b5-c0ee7164f871</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;Before 52832 program into the main function, initialize the clock:
Under normal circumstances: NRF_CLOCK - &amp;gt; LFCLKSTAT = 0;
After the abnormal: NRF_CLOCK - &amp;gt; LFCLKSTAT = 0 x00010000, (1 low frequency clock is still running, 00 said RC internal clock)&lt;/p&gt;
&lt;p&gt;Now, initialize the clock before I join lfclk_stop (), the program will stuck waiting for the clock stopped while (nrf_clock_lf_is_running ())&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    // Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85219?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 07:56:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fcbb951-86d0-4283-9df7-55e77e796e24</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You can the trigger the TASKS_LFCLKSTART task and wait for the EVENTS_LFCLKSTARTED and/or read the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_2_0_18_2_5#register.LFCLKSTAT"&gt;LFCLKSTAT&lt;/a&gt; register. See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_2_0_18_2#topic"&gt;this&lt;/a&gt; page in the NRF52832 PS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85218?ContentTypeID=1</link><pubDate>Thu, 04 May 2017 14:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f3bce4e-87c7-429c-ac06-2eed4c7b602f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Why do you need to detect &amp;quot;abnormal external low-frequency crystals&amp;quot; ? I assume that you know which crystal that is on your pcb?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85217?ContentTypeID=1</link><pubDate>Thu, 04 May 2017 14:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c34725a-8068-4962-9b95-783f31ad5174</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;How to detect abnormal external low-frequency crystals, then automatically switch to the internal low-frequency crystals？&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85205?ContentTypeID=1</link><pubDate>Thu, 04 May 2017 14:07:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c919932-8a29-4828-aad6-de4cac0a6374</guid><dc:creator>juge90</dc:creator><description>&lt;p&gt;How to detect abnormal external low-frequency crystals, then automatically switch to the internal low-frequency crystals？&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?</title><link>https://devzone.nordicsemi.com/thread/85206?ContentTypeID=1</link><pubDate>Fri, 28 Apr 2017 08:49:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:850add9c-e8c0-45c0-939a-2661df69f158</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You need to modify the NRF_CLOCK_LFCLKSRC in the pca10040.h or custom_board.h to the following&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \

                                 .rc_ctiv       = 16,                             \

                                 .rc_temp_ctiv  = 2,                              \

                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>