<?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>Hard fault on the timer interrupt with Softdevice project included</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63107/hard-fault-on-the-timer-interrupt-with-softdevice-project-included</link><description>I am using nRF SDK 16,0 and ble_app_template for pca10040 with Softdevice 132. 
 The example works fine, on my DK board but I need to utilize timers for my application. 
 Since TIMER0 is reserved for SoftDevice, I tried to initialize TIMER1,2,3 or 4 using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jul 2020 06:04:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63107/hard-fault-on-the-timer-interrupt-with-softdevice-project-included" /><item><title>RE: Hard fault on the timer interrupt with Softdevice project included</title><link>https://devzone.nordicsemi.com/thread/257969?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 06:04:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6db7f0cf-e3b9-4a4f-ae5f-84280d6dc88d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Glad you were able to figure this one out. I&amp;#39;m sorry that we didn&amp;#39;t think of that right away, but you&amp;#39;re correct. Some peripherals (like the timer for example) use both NRFX and legacy functions, which means you will have to enable both the legacy layer and the NRFX driver to get it up and running correctly.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard fault on the timer interrupt with Softdevice project included</title><link>https://devzone.nordicsemi.com/thread/257945?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 21:32:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7540f3a-c86c-4e4c-83d1-0dbb0a689554</guid><dc:creator>Aleksandar Atanasovski</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
&lt;p&gt;We found that the problem was in some legacy defines not enabled in sdk_config.h. After that, the TIMER1 works fine in parallel with the SoftDevice.&lt;/p&gt;
&lt;p&gt;So the point&amp;nbsp; was to enable not just NRFX_TIMER but also a legacy driver as well:&lt;/p&gt;
&lt;p&gt;// &amp;lt;e&amp;gt; TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer&lt;br /&gt;#define TIMER_ENABLED 1&lt;br /&gt;#define TIMER1_ENABLED 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard fault on the timer interrupt with Softdevice project included</title><link>https://devzone.nordicsemi.com/thread/257815?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 12:03:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:950a6d57-ce77-44c6-992c-9b31535bc957</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Susheel is gone for the remainder of this week, so I&amp;#39;ve been tasked to manage this case for now. As you can see in the link in the previous reply,&amp;nbsp;priority levels 0, 1, and 4 are all used by the SoftDevice, so if you are using any of these priorities for your timer(s) that is bound to cause trouble. Did you set all the timers in your project to other priorities than these values or just the one?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard fault on the timer interrupt with Softdevice project included</title><link>https://devzone.nordicsemi.com/thread/257501?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 08:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9df6011-eaf1-4906-9e2e-1433a5d205cb</guid><dc:creator>Aleksandar Atanasovski</dc:creator><description>&lt;p&gt;Hi, thanks for your answer.&lt;/p&gt;
&lt;p&gt;Unfortunately, the timer still causes HardFault, I set interrupt priority with both&amp;nbsp;&lt;span&gt;NVIC_SetPriority and through&amp;nbsp;NRF_DRV_TIMER_DEFAULT_CONFIG.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tested with all interrupt levels (0-6) but without any impact.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard fault on the timer interrupt with Softdevice project included</title><link>https://devzone.nordicsemi.com/thread/257424?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 13:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b8edc9a-9b57-41a5-b82a-d1be4d1dd30c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;you need to change the priority of the timer instance from default 0 to lower before calling timer_compare. Please check &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s132%2FSDS%2Fs1xx%2Fprocessor_avail_interrupt_latency%2Fexception_mgmt_sd.html&amp;amp;cp=4_7_3_0_15_1"&gt;this &lt;/a&gt;out to know more about what priorities the app can use with softdevice.&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NVIC_SetPriority&lt;/span&gt;&lt;span&gt;(Timer1_IRQn, 6);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>