<?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>Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110445/cannot-stop-lfclkstat-from-bypass-external-xtal</link><description>Hello, i am having a weird behaviour at a NRF52832 device. To explain. Basically I am using an external RTC chip to source the clock of the LFCLK. 
 During the initialization I call: 
 However, during an investigation of a problem explained here I realized</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Apr 2024 18:24:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110445/cannot-stop-lfclkstat-from-bypass-external-xtal" /><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/481343?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 18:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3c1ce4c-09ec-4607-93a9-ef57a3f9f56d</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;I just tested your code and it does indeed works.&amp;nbsp;I don&amp;#39;t know what I was doing wrong before.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So I am able to disable the external clock now with that code.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/481333?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 17:21:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ceca7c4-2981-43d0-a7de-636598b40b3e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Unfortunately I don&amp;#39;t have an external clock to test with, at least not right away.&lt;/p&gt;
&lt;p&gt;Can you just confirm that the following code then will fail?&lt;/p&gt;
[quote user="Luis Filipe Rossi"]I tryed to start with bypass enabled and stop after that and it also didn&amp;#39;t work.&amp;nbsp;[/quote]
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    NRF_CLOCK-&amp;gt;LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos)|(CLOCK_LFCLKSRC_BYPASS_Enabled &amp;lt;&amp;lt; CLOCK_LFCLKSRC_BYPASS_Pos ) |
    (CLOCK_LFCLKSRC_EXTERNAL_Enabled &amp;lt;&amp;lt; CLOCK_LFCLKSRC_EXTERNAL_Pos);

    NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
    while(NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0)
    {//do nothing
    }

    NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;

    if(nrf_clock_lf_is_running()){
        NRF_CLOCK-&amp;gt;TASKS_LFCLKSTOP = 1; 
        while(nrf_clock_lf_is_running())
        {}
    }
    
    while(1); // It will never reach here?
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/481138?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 14:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9707adfd-e966-48d0-95b6-2ee52483653e</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;I only have checked with EXT/BYPASS enabled (i only have a full square wave ext clocK) and with internal RC. Internal RC has no problem. For now It happens evvertime even when not in a debug session. It will happen with a Soft Reset and a Debug Reset but not a Watchdog reset.&lt;br /&gt;&lt;br /&gt;I tryed to start with bypass enabled and stop after that and it also didn&amp;#39;t work.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/481071?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 12:17:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7b83546-5534-43f8-9398-d142cf23c4fe</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You might have found an unknown issue then, and you can confirm this only occurs when using&amp;nbsp;CLOCK_LFCLKSRC_BYPASS_Enabled?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does the problem only occur when in debug session and/or when you reset from debug session?&lt;/p&gt;
&lt;p&gt;Does it happen for instance if you reset from watchdog or soft reset (after a power cycle, not when debug mode)?&lt;/p&gt;
&lt;p&gt;What happens if you allways start it with bypass enabled (even when you only want to stop it), so you first (always) start it, and then try to stop it?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/480975?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 04:23:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:462e74f5-a0db-4fbf-a56d-10f0ffdabe87</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;Hello Kenneth,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tryed to disable the external clock, and still I could not stop it.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Any sugestions?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/480180?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2024 11:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:267b6c0c-87b1-4925-bfea-7ca5744fe58f</guid><dc:creator>Kenneth</dc:creator><description>[quote user="Luis Filipe Rossi"]&amp;nbsp;Any other ideas? Would you be able to replicate it?[/quote]
&lt;p&gt;Just to double check: I assume you have verified that this problem only occurs when using LFCLK source with BYPASS enabled?&lt;/p&gt;
&lt;p&gt;If it only occurs with BYPASS enabled, then I am wondering if you can just confirm that the external clock is indeed stopped here also? Or are you still feeding the external clock when you are calling&amp;nbsp;TASKS_LFCLKSTOP? Just wondering if the problem may also be related to the clock is still being provided or not.&lt;/p&gt;
&lt;p&gt;I assume you only experience the problem when doing soft reset during debug session, or do you see the problem also for other reset sources, ref:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html#unique_961802881"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html#unique_961802881&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/480050?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 15:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c57daf87-bf90-4d04-9078-8ab27e2c12f0</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;Hello Kenneth,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In this specific test I already disabled the Watchdog.&amp;nbsp;I run this right in the begin of my software&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    int watchdog_is_running = 0;
    watchdog_is_running = NRF_WDT-&amp;gt;RUNSTATUS;
    printf(&amp;quot;WatchDog Status: %d\n&amp;quot;, watchdog_is_running);

////EXT CLOCK


      if(nrf_clock_lf_is_running()){
        NRF_CLOCK-&amp;gt;TASKS_LFCLKSTOP = 1; 
        while(nrf_clock_lf_is_running())
        {}
      }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The watchdog_is_running returns 0 (so watchdog is not running) but the&amp;nbsp;while(nrf_clock_lf_is_running()) never returns after the stop.&lt;br /&gt;&lt;br /&gt;This is somehting I see after reseting the firmware&amp;nbsp;and I previously started the LFCLK as following.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos)|(CLOCK_LFCLKSRC_BYPASS_Enabled &amp;lt;&amp;lt; CLOCK_LFCLKSRC_BYPASS_Pos ) |
(CLOCK_LFCLKSRC_EXTERNAL_Enabled &amp;lt;&amp;lt; CLOCK_LFCLKSRC_EXTERNAL_Pos);

NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
while(NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0)
{//do nothing
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Any other ideas? Would you be able to replicate it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot stop LFCLKSTAT from BYPASS EXTERNAL XTAL</title><link>https://devzone.nordicsemi.com/thread/479956?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 11:03:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e27eca31-5b4c-4db2-87ba-aaea69e12be4</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Do you by any chance have watchdog enabled in your application? When using watchdog a soft reset through the debugger is not sufficient to clear the watchdog, and the watchdog will likely prevent any&amp;nbsp;change to the LFCLK source.&lt;/p&gt;
&lt;p&gt;If that is not the&amp;nbsp;problem&amp;nbsp;I suggest to check out the following two errata&amp;#39;s:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_132.html"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_132.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_36.html"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_36.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>