<?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>NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34052/nrf52-sdk-15-0-issue-legacy-driver-layer-upgrade-to-new-nrfx-driver-layer</link><description>Hi, 
 
 I have some problems changing from the legacy driver to the new nrfx driver structure. 
 I have done the following: 
 1) Opened pwm example in SDK 15.0. 
 2) Renamed the pwm functions to nrfx_pwm from nrf_drv_pwm, likewise with relevant data structures</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Jun 2018 09:34:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34052/nrf52-sdk-15-0-issue-legacy-driver-layer-upgrade-to-new-nrfx-driver-layer" /><item><title>RE: NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/thread/135869?ContentTypeID=1</link><pubDate>Wed, 13 Jun 2018 09:34:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:588d916c-617c-4bd1-9cf3-4b20452c580e</guid><dc:creator>Adam Varga</dc:creator><description>&lt;p&gt;Thank you for the detailed explanation!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/thread/135736?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 12:06:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0d34629-942c-475b-83c6-fd7b933648e6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Adam,&lt;/p&gt;
&lt;p&gt;No response yet. We will have to wait and see if they do any changes in a new SDK release.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically, all the peripherals uses nrfx drivers in SDK15. It is only a matter of what your defines are called. SDK15 uses files that are just mapping the old driver names to the new nrfx drivers. I am not 100% sure, but I guess they use the old names for porting reasons (customers porting applications from older SDKs). There really isn&amp;#39;t a problem using the old define names in sdk_config.h, and in the application layer. The function names are, as I mentioned, simply mapped to the new nrfx drivers.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, remove every file that you can find which includes the old &amp;quot;legacy&amp;quot; driver names (including apply_old_config.h) , and replace the function calls with the new names from the nrfx drivers. But again, you will still use the nrfx drivers if you keep the old names. Just be aware that the NRFX defines in sdk_config.h are overruled by the old &amp;quot;legacy&amp;quot; defines in apply_old_config.h. The easiest way to work around this is to define the old &amp;quot;legacy&amp;quot; defines and new nrfx defines to be the same.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/thread/135706?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 09:29:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f2da7d9-80f7-47d5-aab5-ac66c5c73a9a</guid><dc:creator>Adam Varga</dc:creator><description>&lt;p&gt;I have also came across this same &amp;quot;issue&amp;quot; that Erik has.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Edvin, can you please update us in this thread if you received any feedback about what would be the best-practice&amp;nbsp;for using&amp;nbsp;the legacy and the new nrfx peripheral drivers? &lt;br /&gt;It would be also great if you&amp;#39;ll be able to write just a couple of sentences in the changelog about these kinds of modifications in future sdk releases.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards, &lt;br /&gt;Adam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/thread/131970?ContentTypeID=1</link><pubDate>Tue, 15 May 2018 08:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6284940d-5a23-44f0-b286-5881316f7954</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry. I understand now. I see that they are both&amp;nbsp;defined&amp;nbsp;in the PWM examples.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nrfx drivers are standalone working drivers intended to work without the SDK. However, the SDK still uses the PWM_ENABLED for wrapping functions. Exactly why it is like this, I am not completely sure. I think it is because of portability reasons. If you look in the apply_old_config.h file, that you mentioned, the NRFX_PWM_ENABLED is overwritten by the PWM_ENABLED.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically:&lt;/p&gt;
&lt;p&gt;nrfx_pwm uses only NRFX_PWM_ macros, but in the SDK, there is a legacy layer that makes it possible to use nrfx_pwm_ API via the old nrf_drv_pwm_ namespace. It is correct as you say, that if PWM_ENABLED = 0 and NRFX_PWM_ENABLED&amp;nbsp; = 1, then the PWM will not be enabled, due to the implementation. If you want to use only the NRFX_PWM_ENABLED, you should remove the #define PWM_ENABLED completely, and not set it to 0.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I agree that this might be a bit confusing. I have forwarded this internally, and they will see if it can be done more comprehensible in the SDK examples.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your input.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So to answer your question, what combinations are allowed:&lt;br /&gt;All, but (!) it depends on whether you include the file apply_old_config.h. If you only want to use the new NRFX_ drivers, you should either remove this file, or completely remove the old driver defines (such as PWM_ENABLED).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/thread/131804?ContentTypeID=1</link><pubDate>Mon, 14 May 2018 08:03:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b553a6-6d76-4a2a-92d5-8acc2e69b388</guid><dc:creator>Erik_pxq</dc:creator><description>&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; I am not sure I understand what you mean. Are you porting an old project &lt;br /&gt;&amp;gt;&amp;gt; to a new SDK, or porting the new driver back to an old SDK?&lt;/p&gt;
&lt;p&gt;I am working with the PWM example in SDK 15.0. &lt;br /&gt;I Have renamed functions and datatypes, so they use the new driver layer interface name convention.&amp;nbsp;&lt;br /&gt;It works fine, when NRFX_PWM_ENABLED=1 &amp;amp; PWM_ENABLED=1.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;gt;&amp;gt; And is this a question, or a suggestion?&lt;/p&gt;
&lt;p&gt;It is both a question and a suggestion(suggestion is dependant on your answer).&lt;br /&gt;Look for the question marks. Sorry if my text was unclear.&lt;/p&gt;
&lt;p&gt;I will try asking the question again:&lt;/p&gt;
&lt;p&gt;A) When using the new driver structure in SDK15, which combination of values for NRFX_PWM_ENABLED &amp;amp; PWM_ENABLED is intended/allowed?&lt;/p&gt;
&lt;p&gt;In sdk_config.h, from by best of understanding, I get:&lt;br /&gt;NRFX_PWM_ENABLED=0 &amp;amp; PWM_ENABLED=0 =&amp;gt; PWM functionality disabled.&lt;/p&gt;
&lt;p&gt;NRFX_PWM_ENABLED=0 &amp;amp; PWM_ENABLED=1 =&amp;gt; PWM enabled with old legacy driver layer naming functionality.&lt;/p&gt;
&lt;p&gt;NRFX_PWM_ENABLED=1 &amp;amp; PWM_ENABLED=0 =&amp;gt;&amp;nbsp;&lt;span style="font-family:inherit;"&gt;PWM functionality enabled, but only new driver layer naming functionality??? Not working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;NRFX_PWM_ENABLED=1 &amp;amp; PWM_ENABLED=1 =&amp;gt; PWM enabled with both Old legacy driver layer &amp;amp; new driver layer naming functionality.&lt;/p&gt;
&lt;p&gt;If the combination NRFX_PWM_ENABLED=1 &amp;amp; PWM_ENABLED=0 is valid, there is something faulty (the compilation fails). I have suggested a fix, which seems to solve it.&lt;/p&gt;
&lt;p&gt;Best regards, Erik.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer</title><link>https://devzone.nordicsemi.com/thread/131563?ContentTypeID=1</link><pubDate>Wed, 09 May 2018 14:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5271e33c-2923-402c-a2bc-e4bcb4c493ff</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not sure I understand what you mean. Are you porting an old project to a new SDK, or porting the new driver back to an old SDK?&lt;/p&gt;
&lt;p&gt;And is this a question, or a suggestion?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>