<?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>Pure NRFX RTC code - how to?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41141/pure-nrfx-rtc-code---how-to</link><description>Hi, 
 I&amp;#39;m trying to adopt my nRF52832 projects to the nRF5 SDK version 15.2.0 and the NRFX drivers framework. I&amp;#39;m using a short app_config.h with NRFX_RTC_ENABLED and NRFX_RTC0_ENABLED only. Unfortunately, it won&amp;#39;t work because it&amp;#39;s locked on the legacy</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Dec 2018 23:33:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41141/pure-nrfx-rtc-code---how-to" /><item><title>RE: Pure NRFX RTC code - how to?</title><link>https://devzone.nordicsemi.com/thread/160087?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 23:33:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a0716cd-c97e-411b-a08f-ab780b792ead</guid><dc:creator>Mishka</dc:creator><description>&lt;p&gt;Uhm, libraries are still dependent on nrf_drv_* stuff. Patched the &lt;span&gt;apply_old_config.h&lt;/span&gt; as you&amp;#39;ve suggested above:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;sed -E &amp;#39;s/^(#if defined\(([A-Z_0-9]+_ENABLED)\))/\1 \&amp;amp;\&amp;amp; (\2 == 1)/&amp;#39; integration/nrfx/legacy/apply_old_config.h&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pure NRFX RTC code - how to?</title><link>https://devzone.nordicsemi.com/thread/160063?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 16:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5db3dfd-bcd1-4c92-8c09-eb5b8bcfe0e9</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, that is also an alternative if you do not use legacy drivers for any peripherals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pure NRFX RTC code - how to?</title><link>https://devzone.nordicsemi.com/thread/160003?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 14:34:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87094229-a8b6-48cd-b621-666d7b8e0687</guid><dc:creator>Mishka</dc:creator><description>&lt;p&gt;Hi J&amp;oslash;rgen,&lt;/p&gt;
&lt;p&gt;thanks for your reply! I&amp;#39;m using standard unmodified SDK 15.2 config from the config/nrf52832/config/sdk_config.h. All overrides are going into a local app_config.h (-DUSE_APP_CONFIG) - it allows me to keep my codebase clean and portable, and don&amp;#39;t bother about changes in the SDK (for example when upgrading it). Therefore there is no legacy configs - only the new shiny NRFX defs.&lt;/p&gt;
&lt;p&gt;Your patch will definitely do its job. Of course I can walk through the &lt;span&gt;apply_old_config.h&lt;/span&gt; and patch all definitions. Or is it better to eliminate old definitions with something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if defined(NRF_DEV_LEGACY_COMPAT) &amp;amp;&amp;amp; (NRF_DEV_LEGACY_COMPAT==1)
#include &amp;lt;legacy/apply_old_config.h&amp;gt;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In any case hope to see it addressed in the next SDK release :-)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pure NRFX RTC code - how to?</title><link>https://devzone.nordicsemi.com/thread/159960?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 13:00:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9af04f9d-9c74-4e20-b950-75230c2bcee9</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would recommend that you completely remove the legacy RTC config from sdk_config.h if switching to NRFX drivers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, you can also make modify&amp;nbsp;&lt;span&gt;apply_old_config.h by only overwriting the settings if the legacy drivers was enabled&lt;/span&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if defined(RTC_ENABLED) &amp;amp;&amp;amp; (RTC_ENABLED == 1)

#undef NRFX_RTC_ENABLED
#define NRFX_RTC_ENABLED  RTC_ENABLED&lt;/pre&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pure NRFX RTC code - how to?</title><link>https://devzone.nordicsemi.com/thread/159880?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 08:16:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e92ca290-9eb0-44ba-a040-47532fce9bbb</guid><dc:creator>Mishka</dc:creator><description>&lt;p&gt;Okay, here are more details on what happens:&lt;/p&gt;
&lt;pre&gt;Compiling file: sys_rtc.c
In file included from /Users/mishka/my/l.a.b./src/sdk/modules/nrfx/nrfx.h:45:0,
                 from /Users/mishka/my/l.a.b./src/sdk/modules/nrfx/drivers/include/nrfx_rtc.h:44,
                 from sys_rtc.c:2:
/Users/mishka/my/l.a.b./src/sdk/modules/nrfx/drivers/include/nrfx_rtc.h:86:39: error: &amp;#39;NRFX_RTC0_INST_IDX&amp;#39; undeclared here (not in a function)
     .instance_id      = NRFX_CONCAT_3(NRFX_RTC, id, _INST_IDX), \
                                       ^
/Users/mishka/my/l.a.b./src/sdk/modules/nrfx/drivers/nrfx_common.h:117:37: note: in definition of macro &amp;#39;NRFX_CONCAT_3_&amp;#39;
 #define NRFX_CONCAT_3_(p1, p2, p3)  p1 ## p2 ## p3
                                     ^~
/Users/mishka/my/l.a.b./src/sdk/modules/nrfx/drivers/include/nrfx_rtc.h:86:25: note: in expansion of macro &amp;#39;NRFX_CONCAT_3&amp;#39;
     .instance_id      = NRFX_CONCAT_3(NRFX_RTC, id, _INST_IDX), \
                         ^~~~~~~~~~~~~
sys_rtc.c:9:24: note: in expansion of macro &amp;#39;NRFX_RTC_INSTANCE&amp;#39;
 const nrfx_rtc_t rtc = NRFX_RTC_INSTANCE(0);
                        ^~~~~~~~~~~~~~~~~
make: *** [obj/dhrystone/sys_rtc.c.o] Error 1
&lt;/pre&gt;
&lt;p&gt;The NRFX_RTC_INSTANCE macro refers to NRFX_RTC0_INST_IDX which should be &amp;quot;initialized&amp;quot; by the enum in the modules/nrfx/drivers/include/nrfx_rtc.h (see below), but it fails to do so because the NRFX_RTC0_ENABLED will always be reset to 0 due to the integration/nrfx/legacy/apply_old_config.h defs (please see the originating post).&lt;/p&gt;
&lt;pre&gt;enum {
#if NRFX_CHECK(NRFX_RTC0_ENABLED)
    NRFX_RTC0_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_RTC1_ENABLED)
    NRFX_RTC1_INST_IDX,
#endif
#if NRFX_CHECK(NRFX_RTC2_ENABLED)
    NRFX_RTC2_INST_IDX,
#endif
    NRFX_RTC_ENABLED_COUNT
};&lt;/pre&gt;
&lt;p&gt;Perhaps the SDK should not always include legacy defs, but rather make it optional.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>