<?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>SoftDevice and TIMER interrupts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2213/softdevice-and-timer-interrupts</link><description>As per this thread: devzone.nordicsemi.com/.../question-regarding-hfclk-control the SD stack takes care of HFCLK, however as fas as I understand HFCLK is also responsible for timers - now, when SD stack is in use/enabled and it takes care for managing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Apr 2014 13:22:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2213/softdevice-and-timer-interrupts" /><item><title>RE: SoftDevice and TIMER interrupts</title><link>https://devzone.nordicsemi.com/thread/9332?ContentTypeID=1</link><pubDate>Wed, 23 Apr 2014 13:22:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:badd840b-ec1a-4174-9d9e-0adeb917d0eb</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Marcel,&lt;/p&gt;
&lt;p&gt;If you have tasks that are very timing critical, you can make sure that the HFCLK is running via these functions in nrf_soc.h:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
SVCALL(SD_CLOCK_HFCLK_REQUEST, uint32_t, sd_clock_hfclk_request(void));
SVCALL(SD_CLOCK_HFCLK_RELEASE, uint32_t, sd_clock_hfclk_release(void));
SVCALL(SD_CLOCK_HFCLK_IS_RUNNING, uint32_t, sd_clock_hfclk_is_running(uint32_t * p_is_running));

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;sd_clock_hfclk_request() will generate an event &amp;quot;NRF_EVT_HFCLKSTARTED&amp;quot; or you can poll using sd_clock_hfclk_is_running().&lt;/p&gt;
&lt;p&gt;There are a couple of posts already on how to start a timer:
&lt;a href="https://devzone.nordicsemi.com/index.php/discussions/setting-timer2-interval"&gt;devzone.nordicsemi.com/.../setting-timer2-interval&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regarding &amp;quot;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&amp;quot;, if you do this after the stack is initialized, you will end up in the hardfault handler, as this is a restricted peripheral (softdevice owns it)&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>