<?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>NRFX_TIMER3_INST_IDX&amp;#39; undeclared (first use in this function), SDK enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73213/nrfx_timer3_inst_idx-undeclared-first-use-in-this-function-sdk-enabled</link><description>I&amp;#39;m uploading a BLE &amp;amp; TWI code to nRF52 DK. Now, I&amp;#39;m getting this error: 
 NRFX_TIMER3_INST_IDX&amp;#39; undeclared (first use in this function) 
 According to other similar posts, I have enabled timers in SDK. 
 
 In my nrfx_timer.c file. timer3 section is the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Mar 2021 07:36:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73213/nrfx_timer3_inst_idx-undeclared-first-use-in-this-function-sdk-enabled" /><item><title>RE: NRFX_TIMER3_INST_IDX' undeclared (first use in this function), SDK enabled</title><link>https://devzone.nordicsemi.com/thread/302675?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 07:36:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aab5da51-b602-4d3d-ad53-38d8a7438c72</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for your patience with this - we are short staffed due to the national easter holidays here in Norway.&lt;/p&gt;
[quote user="StevenW807"]&lt;strong&gt;Step 1)&lt;/strong&gt;&amp;nbsp;For the error &amp;quot;&lt;strong&gt;NRFX_TIMER3_INST_IDX&amp;#39; undeclared (first use in this function)&lt;/strong&gt;&amp;quot;, my solution is: in sdk_config.h, I enabled both &amp;quot;&lt;strong&gt;TIMER#_ENABLED&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;span&gt;&lt;strong&gt;legacy TIMER#_ENABLED&lt;/strong&gt;&amp;quot;.&lt;/span&gt;[/quote]
&lt;p&gt;If you have left the&amp;nbsp;&lt;em&gt;apply_old_config&amp;nbsp;&lt;/em&gt;file unchanged, this would mean that NRFX_TIMER_ENABLED is redefined to 0, since you also define TIMER_ENABLED&lt;/p&gt;
[quote user="StevenW807"](Because I shouldn&amp;#39;t delete the below red box code).[/quote]
&lt;p&gt;I agree, you definitely should not have to delete the offending section - this is often just deleting the symptoms of the real issue.&lt;/p&gt;
[quote user="StevenW807"]I simply deleted the code in the red box (see below image). I guess it&amp;#39;s because I accidentally deleted some timer 3 code elsewhere.[/quote]
&lt;p&gt;In general I would have to say that this approach is a short-term solution.&lt;br /&gt;Are you speculating whether you might have deleted code accidentally elsewhere, or are you stating that &lt;em&gt;you have&lt;/em&gt; accidentally deleted code elsewhere?&lt;br /&gt;I would recommend that you redownload the SDK, to make sure you have a functional and complete version. The code you might have deleted could break other functionality in the SDK.&lt;br /&gt;&lt;br /&gt;Could I ask you to remove the legacy definitions of TIMER_ENABLED and TIMER#_ENABLED all together from your sdk_config, and see if this changes the issue of the greyed out sections?&lt;br /&gt;As in, do &lt;em&gt;not&amp;nbsp;&lt;/em&gt; just&amp;nbsp;change their definition to 0 (that will still leave them&amp;nbsp;&lt;em&gt;defined&lt;/em&gt; to 0), but either comment them out, or remove them entirely from the file.&lt;br /&gt;Do this, and see if the greyed out NRFX_CHECK is no longer grayed out, after cleaning the build and rebuilding the project.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX_TIMER3_INST_IDX' undeclared (first use in this function), SDK enabled</title><link>https://devzone.nordicsemi.com/thread/302020?ContentTypeID=1</link><pubDate>Thu, 25 Mar 2021 23:05:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f45ff7c-c58e-4346-8775-c57e5f31d8d4</guid><dc:creator>StevenW807</dc:creator><description>&lt;p&gt;Thanks, Karl.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried your method, unfortunately, the problem didn&amp;#39;t solve. Here is how I solved the issue today by 2 steps:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1)&lt;/strong&gt;&amp;nbsp;For the error &amp;quot;&lt;strong&gt;NRFX_TIMER3_INST_IDX&amp;#39; undeclared (first use in this function)&lt;/strong&gt;&amp;quot;, my solution is: in sdk_config.h, I enabled both &amp;quot;&lt;strong&gt;TIMER#_ENABLED&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;span&gt;&lt;strong&gt;legacy TIMER#_ENABLED&lt;/strong&gt;&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver
//==========================================================
#ifndef NRFX_TIMER_ENABLED
#define NRFX_TIMER_ENABLED 1
#endif
// &amp;lt;q&amp;gt; NRFX_TIMER0_ENABLED  - Enable TIMER0 instance
 

#ifndef NRFX_TIMER0_ENABLED
#define NRFX_TIMER0_ENABLED 1
#endif

// &amp;lt;q&amp;gt; NRFX_TIMER1_ENABLED  - Enable TIMER1 instance
 

#ifndef NRFX_TIMER1_ENABLED
#define NRFX_TIMER1_ENABLED 1
#endif

// &amp;lt;q&amp;gt; NRFX_TIMER2_ENABLED  - Enable TIMER2 instance
 

#ifndef NRFX_TIMER2_ENABLED
#define NRFX_TIMER2_ENABLED 1
#endif

// &amp;lt;q&amp;gt; NRFX_TIMER3_ENABLED  - Enable TIMER3 instance
 

#ifndef NRFX_TIMER3_ENABLED
#define NRFX_TIMER3_ENABLED 1
#endif

// &amp;lt;q&amp;gt; NRFX_TIMER4_ENABLED  - Enable TIMER4 instance
 

#ifndef NRFX_TIMER4_ENABLED
#define NRFX_TIMER4_ENABLED 1
#endif



// ==============================================



// &amp;lt;e&amp;gt; TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer
//==========================================================
#ifndef TIMER_ENABLED
#define TIMER_ENABLED 1
#endif
// &amp;lt;o&amp;gt; TIMER_DEFAULT_CONFIG_FREQUENCY  - Timer frequency if in Timer mode
 
// &amp;lt;0=&amp;gt; 16 MHz 
// &amp;lt;1=&amp;gt; 8 MHz 
// &amp;lt;2=&amp;gt; 4 MHz 
// &amp;lt;3=&amp;gt; 2 MHz 
// &amp;lt;4=&amp;gt; 1 MHz 
// &amp;lt;5=&amp;gt; 500 kHz 
// &amp;lt;6=&amp;gt; 250 kHz 
// &amp;lt;7=&amp;gt; 125 kHz 
// &amp;lt;8=&amp;gt; 62.5 kHz 
// &amp;lt;9=&amp;gt; 31.25 kHz 

#ifndef TIMER_DEFAULT_CONFIG_FREQUENCY
#define TIMER_DEFAULT_CONFIG_FREQUENCY 0
#endif

// &amp;lt;o&amp;gt; TIMER_DEFAULT_CONFIG_MODE  - Timer mode or operation
 
// &amp;lt;0=&amp;gt; Timer 
// &amp;lt;1=&amp;gt; Counter 

#ifndef TIMER_DEFAULT_CONFIG_MODE
#define TIMER_DEFAULT_CONFIG_MODE 0
#endif

// &amp;lt;o&amp;gt; TIMER_DEFAULT_CONFIG_BIT_WIDTH  - Timer counter bit width
 
// &amp;lt;0=&amp;gt; 16 bit 
// &amp;lt;1=&amp;gt; 8 bit 
// &amp;lt;2=&amp;gt; 24 bit 
// &amp;lt;3=&amp;gt; 32 bit 

#ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH
#define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0
#endif

// &amp;lt;o&amp;gt; TIMER_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
 

// &amp;lt;i&amp;gt; Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// &amp;lt;0=&amp;gt; 0 (highest) 
// &amp;lt;1=&amp;gt; 1 
// &amp;lt;2=&amp;gt; 2 
// &amp;lt;3=&amp;gt; 3 
// &amp;lt;4=&amp;gt; 4 
// &amp;lt;5=&amp;gt; 5 
// &amp;lt;6=&amp;gt; 6 
// &amp;lt;7=&amp;gt; 7 

#ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY
#define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif

// &amp;lt;q&amp;gt; TIMER0_ENABLED  - Enable TIMER0 instance
 

#ifndef TIMER0_ENABLED
#define TIMER0_ENABLED 1
#endif

// &amp;lt;q&amp;gt; TIMER1_ENABLED  - Enable TIMER1 instance
 

#ifndef TIMER1_ENABLED
#define TIMER1_ENABLED 1
#endif

// &amp;lt;q&amp;gt; TIMER2_ENABLED  - Enable TIMER2 instance
 

#ifndef TIMER2_ENABLED
#define TIMER2_ENABLED 1
#endif

// &amp;lt;q&amp;gt; TIMER3_ENABLED  - Enable TIMER3 instance
 

#ifndef TIMER3_ENABLED
#define TIMER3_ENABLED 0
#endif

// &amp;lt;q&amp;gt; TIMER4_ENABLED  - Enable TIMER4 instance
 

#ifndef TIMER4_ENABLED
#define TIMER4_ENABLED 0
#endif

// &amp;lt;/e&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Step 2)&lt;/strong&gt; For the error &amp;quot;&lt;strong&gt;in nrfx_timer.c file. Timer3 section is the only part that is NOT greyed out.&amp;nbsp;&lt;/strong&gt;&amp;quot; I simply deleted the code in the red box (see below image). I guess it&amp;#39;s because I accidentally deleted some timer 3 code elsewhere. I will share the answer with you if I could find it (Because I shouldn&amp;#39;t delete the below red box code). But if you have any idea, please share your answer, too. Thank you very much!&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1616713352822v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX_TIMER3_INST_IDX' undeclared (first use in this function), SDK enabled</title><link>https://devzone.nordicsemi.com/thread/301908?ContentTypeID=1</link><pubDate>Thu, 25 Mar 2021 13:05:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60bd7e80-01d6-46e8-bb0a-33c27e197d59</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Have you defined both the legacy and NRFX TIMER definitions?&lt;br /&gt;If you leave the legacy TIMER#_ENABLED defined in your SDK config, it will overwrite your NRFX definition.&lt;br /&gt;Please make sure that only the NRFX_TIMER#_ENABLED is defined, and none of the TIMER#_ENABLED are defined, and see if this resolves the issue.&lt;br /&gt;For a more in-depth discussion of this apply_old_config issue, please see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/60127/compare-sdk_config-files"&gt;this ticket&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If this does not resolve the issue, could you share your entire sdk_config file?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>