<?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>RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25248/rc-lfclk-and-app-timer-without-softdevice-sdk13</link><description>I am taking the Radio Test example and introducing a button and LED for control over the various tests. However I have struck an issue in trying to call the LFCLK when it is RC and getting the timers to work. 
 The Radio Test uses the HFCLK as well.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Sep 2017 09:04:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25248/rc-lfclk-and-app-timer-without-softdevice-sdk13" /><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99472?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2017 09:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5fe800c-8150-40d7-bf6c-8a5b48a6281c</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Mystery solved, hadn&amp;#39;t removed Cortex_M_Startup.s from the SES project.  Oh well, lesson for all SES users out there - double check you&amp;#39;ve set the project up correctly!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99466?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2017 08:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67e16185-056f-43bb-8ea9-fb9ae65bebe5</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;You are right.  So I copied over an sdk_config.h file from another project as the sdk_config.h for the Radio Test is an extremely pared down version, so I might not have added/activated all the correct modules.  So now I can start the LFCLK and the app will continue to run without any issues UNTIL I go to start the timer and then I fall back into that interrupt handler so I still need to troubleshoot.  Now Radio Test example has&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NVIC_EnableIRQ(TIMER0_IRQn);
__enable_irq();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Could this be interfering with the app_timers by any chance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99468?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2017 08:06:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:622d948b-3fa8-4031-b23f-5c7554324cf6</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;it won&amp;#39;t be anything to do with calibration - either the LF clock is started or it isn&amp;#39;t started. There&amp;#39;s no &amp;#39;half started&amp;#39; or &amp;#39;not started correctly&amp;#39;. I did suggest you checked the registers to see what source has been selected and what source it claims is actually running. But this is the LF clock off the RC source, there&amp;#39;s no way it can&amp;#39;t run.&lt;/p&gt;
&lt;p&gt;If you had a priority inversion you&amp;#39;d be in the hardfault handler (the timer and SWI have to have the same priority or it doesn&amp;#39;t work).&lt;/p&gt;
&lt;p&gt;The LF clock is running, calibration is a total red herring, you have a different problem which you just need to find.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99467?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2017 07:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8289315-029a-47a8-ade5-e9ac88331c4d</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;I think this interrupt is being caused by the LFCLK.  If I don&amp;#39;t start LFCLK, it never gets to this interrupt handler.  If I start the LFCLK and comment the timer it still gets to this interrupt handler.  So it looks like everything is pointing to the LFCLK not being set up/started correctly.  It might have something to do with calibration not being set-up and so the LFCLK stopping in short order.  I can&amp;#39;t seem to start the calibration with &lt;code&gt;nrf_drv_clock_calibration_start(10 ,clock_handler)&lt;/code&gt;, but nor can I use &lt;code&gt;nrf_drv_clock_lfclk_request()&lt;/code&gt; either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99465?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2017 23:42:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5bd2e06-c8c0-4096-a3c2-096cdfd03176</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well you are, in that image, in the SWI interrupt handler, you&amp;#39;ve just chosen to show the code which sets the interrupt flag instead of the code you&amp;#39;re actually running. Do you have an SWI interrupt handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99464?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2017 22:01:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08014232-335e-4d1c-a818-dade0dd7a875</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;I scrapped the method above and used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_RC &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_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;/code&gt;&lt;/pre&gt;
&lt;p&gt;which is kind of how the Radio Test example starts the HFCLK and this appears to work in that I now get a 1 for &lt;code&gt;nrf_drv_clock_lfclk_is_running();&lt;/code&gt;.  However now I appear to have an issue with the timers, I&amp;#39;ll edit the question above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99471?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2017 20:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:030eb46d-6196-472e-8816-f2540bb5c699</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I don&amp;#39;t think the cal matters. Nor do I think the default HAL driver does any calibrations, the softdevice does do it automatically, but not the plain drivers.&lt;/p&gt;
&lt;p&gt;Richie the png made somewhere between little and no sense to me. I suggest stepping through the lf clock drivers and seeing what it sets the registers to. What I was expecting is that you start the lf clock and the driver waits for it to start, but because of a misconfiguration it never does, so it stays in the waiting for start loop forever.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99463?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2017 18:58:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:951bbdc3-9543-4765-9b59-ed66e328c31f</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;In the examples they normally don&amp;#39;t start a cal immediately after requesting the lfclk. It will take a moment to start. It could just be that you are requesting a cal before the clock has started.
Also, I don&amp;#39;t believe it is necessary to request a cal.  The driver is set up with cal intervals and should take care of this on its own.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99470?ContentTypeID=1</link><pubDate>Sun, 17 Sep 2017 23:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6ba39ee-3fd6-4c43-87b7-2b819948f5f4</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Hi RK, edited above with screenshot of call stack.  You can a &amp;quot;C&amp;quot; from the printf line.  If I comment out that printf then it stops are the nrf_delay_ms(20) line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RC LFCLK and App Timer without SoftDevice SDK13</title><link>https://devzone.nordicsemi.com/thread/99469?ContentTypeID=1</link><pubDate>Sun, 17 Sep 2017 22:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10e1e008-c471-43ce-ad34-74d3016e95df</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;when the code &amp;#39;stops&amp;#39; hit break - where are you?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>