<?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>TIMER20 driver instance missing dependency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency</link><description>I need to use a nrfx timer in order for some GPIO timing, but can&amp;#39;t get past the simple examples declaring an instance. For testing I&amp;#39;m just using the 54L15DK. 
 I was using this ticket as a reference https://devzone.nordicsemi.com/f/nordic-q-a/119686</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Sep 2025 18:48:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency" /><item><title>RE: TIMER20 driver instance missing dependency</title><link>https://devzone.nordicsemi.com/thread/548104?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2025 18:48:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3272274e-be9a-435a-b799-cec8420e9a63</guid><dc:creator>Hieu</dc:creator><description>[quote user="Nick_RA"]OK, so I started afresh with a new hello_world project and copied the code over and it works. So something screwy with that particular project I guess.&amp;nbsp;[/quote]
&lt;p&gt;Right... it unfortunately seems so. Usually this happens when custom board files are being used, and a mistake was made where the timer20 definition isn&amp;#39;t &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/ncs-v3.1.0/dts/vendor/nordic/nrf54l_05_10_15.dtsi"&gt;correctly included&lt;/a&gt; or recreated.&lt;/p&gt;
&lt;p&gt;However, the fact that you could refer to it by using &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;amp;timer20&lt;/span&gt; suggests that the node is indeed available, in which case, it should satisfy &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/ncs-v3.1.0/modules/hal_nordic/nrfx/Kconfig#L791-L794"&gt;the only dependency for&amp;nbsp;CONFIG_NRFX_TIMER20&lt;/a&gt;.&lt;/p&gt;
[quote user="Nick_RA"]&lt;blockquote&gt;&lt;div&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency/547778"&gt;Hieu said:&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20&lt;/span&gt; only depends on the existence of the node &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;timer20&lt;/span&gt; in DeviceTree, with the appropriate compatible property. Whether the node is disabled or enabled doesn&amp;#39;t matter,&amp;nbsp;because the nrfx drivers configure the registers directly, unlike Zephyr drivers, which are designed to work with DeviceTree.&lt;br /&gt;That means you don&amp;#39;t have to do anything to use &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20&lt;/span&gt;.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;
&lt;p&gt;Well, it&amp;#39;s needed for sure. I haven&amp;#39;t delved into the macros but the line&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(TIMER_INST_IDX);&lt;/span&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;doesn&amp;#39;t compile without&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp;CONFIG_NRFX_TIMER20&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Could this be a hint towards what is wrong? Refer to the dependency definition I linked above, NRFX_TIMER20 only needs the node to &lt;em&gt;be presented&lt;/em&gt;. It doesn&amp;#39;t need it enabled.&lt;br /&gt;The project I attached in my last reply should also be able to prove that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIMER20 driver instance missing dependency</title><link>https://devzone.nordicsemi.com/thread/547881?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2025 09:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd284c55-37ce-4790-a862-70fb78a16670</guid><dc:creator>Nick_RA</dc:creator><description>[quote userid="9456" url="~/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency/547778"]For reference, here is the hello_world sample where I just put &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20=y&lt;/span&gt; in, and it works.[/quote]
&lt;p&gt;OK, so I started afresh with a new hello_world project and copied the code over and it works. So something screwy with that particular project I guess.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This isn&amp;#39;t my actual project; because this ecosystem is new to me when starting something new I just start with hello_world to get it going then write it into my code when I&amp;#39;m happy with it, but rather than create loads of mini test projects I normally just CTRL-A / DELETE and start again so something has obviously gone a bit awry.&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency/547778"]&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20&lt;/span&gt; only depends on the existence of the node &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;timer20&lt;/span&gt; in DeviceTree, with the appropriate compatible property. Whether the node is disabled or enabled doesn&amp;#39;t matter,&amp;nbsp;because the nrfx drivers configure the registers directly, unlike Zephyr drivers, which are designed to work with DeviceTree.&lt;br /&gt;That means you don&amp;#39;t have to do anything to use &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20&lt;/span&gt;.[/quote]
&lt;p&gt;Well, it&amp;#39;s needed for sure. I haven&amp;#39;t delved into the macros but the line&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; nrfx_timer_t timer_inst = NRFX_TIMER_INSTANCE(TIMER_INST_IDX);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;doesn&amp;#39;t compile without&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp;CONFIG_NRFX_TIMER20&lt;/span&gt;&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency/547778"]How did you build your project? You mentioned wanting to keep cross compatibility with a nRF52 project. Could you be compiling for a nRF52 target?[/quote]
&lt;p&gt;This was using 54L15DK/54L15/CPUAPP. Yes, I do need to maintain compatibility with another board using nRF52832 so I have separate builds and configs where I&amp;#39;ll be storing the timer instances.&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/124165/timer20-driver-instance-missing-dependency/547778"]I also would like to note that, by default, TIMER20 is used by the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/mpsl/doc/mpsl.html"&gt;Multiprotocol Service Layer (MPSL)&lt;/a&gt; in projects with wireless functionality like BLE or Matter. Therefore, you should choose another&amp;nbsp;TIMER instance, like TIMER21.[/quote]
&lt;p&gt;Noted, thanks (I hadn&amp;#39;t got that far yet!), but please note I was starting from&amp;nbsp;an earlier support article linked in my original post. Maybe someone needs to look at and amend that post &amp;amp; github code...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIMER20 driver instance missing dependency</title><link>https://devzone.nordicsemi.com/thread/547778?ContentTypeID=1</link><pubDate>Thu, 04 Sep 2025 14:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fcc4173-3862-4025-b223-9a4190e55070</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Nick_RA,&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20&lt;/span&gt; only depends on the existence of the node &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;timer20&lt;/span&gt; in DeviceTree, with the appropriate compatible property. Whether the node is disabled or enabled doesn&amp;#39;t matter,&amp;nbsp;because the nrfx drivers configure the registers directly, unlike Zephyr drivers, which are designed to work with DeviceTree.&lt;br /&gt;That means you don&amp;#39;t have to do anything to use &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;How did you build your project? You mentioned wanting to keep cross compatibility with a nRF52 project. Could you be compiling for a nRF52 target?&lt;/p&gt;
&lt;p&gt;It is possible to maintain one code base for both nRF52 and nRF54L, but you will need to have some separate board overlay files.&lt;/p&gt;
&lt;p&gt;I also would like to note that, by default, TIMER20 is used by the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/mpsl/doc/mpsl.html"&gt;Multiprotocol Service Layer (MPSL)&lt;/a&gt; in projects with wireless functionality like BLE or Matter. Therefore, you should choose another&amp;nbsp;TIMER instance, like TIMER21.&lt;/p&gt;
&lt;p&gt;For reference, here is the hello_world sample where I just put &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_TIMER20=y&lt;/span&gt; in, and it works.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/c350910_2D00_250904_5F00_01.zip"&gt;devzone.nordicsemi.com/.../c350910_2D00_250904_5F00_01.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>