<?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>Recommended workflow to update sdk_config.h ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40992/recommended-workflow-to-update-sdk_config-h</link><description>Hi, 
 my question might sound a bit silly, but I am certain that someone already faced the problem therefore I am wondering how it was addressed. 
 The question: 
 what is the recommended workflow to migrate the sdk_config.h file of a Nordic SDK software</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Sep 2020 16:18:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40992/recommended-workflow-to-update-sdk_config-h" /><item><title>RE: Recommended workflow to update sdk_config.h ?</title><link>https://devzone.nordicsemi.com/thread/267499?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2020 16:18:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db98e7ca-4935-401c-98cc-43bba0645511</guid><dc:creator>nordev</dc:creator><description>&lt;p&gt;Hi Andreas,&amp;nbsp;thank you for this code snippet -- it is extremely helpful. Would you kindly explain how/why&amp;nbsp;the defines in app_config.h override the defines in sdk_config.h? How does the preprocessor know that app_config.h should take precedence?&lt;/p&gt;
&lt;p&gt;Since #include app_config.h is at the beginning of the sdk_config.h file, based on &lt;a href="https://stackoverflow.com/questions/5735379/what-does-include-actually-do"&gt;this&lt;/a&gt;&amp;nbsp;and &lt;a href="https://stackoverflow.com/questions/7109795/macro-definition-conflict"&gt;this&lt;/a&gt;, you would think that when the same things get defined later in sdk_config.h, those #defines would override the #defines in app_config.h, undoing your custom configs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT: never mind, no reply needed. I see that sdk_config.h is full of #ifndef and #define, so that it doesn&amp;#39;t overwrite things that are already defined.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recommended workflow to update sdk_config.h ?</title><link>https://devzone.nordicsemi.com/thread/159940?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 11:59:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88919a4d-4b26-4235-a40f-27a04cccc9a9</guid><dc:creator>Magoo</dc:creator><description>&lt;p&gt;Dear Andreas,&lt;/p&gt;
&lt;p&gt;thank you very much for all your useful information. It really helps and I will try to follow these instructions when migrating the project to a newer SDK version.&lt;/p&gt;
&lt;p&gt;And thank you for drawing my attention to the existence of a &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fmigration.html&amp;amp;cp=4_0_1_1_9"&gt;migration guide&lt;/a&gt; (which I was not aware of).&lt;br /&gt;In fact it is rather well hidden in the tree structure of the SDK documentation (under the &amp;quot;Getting Started&amp;quot; section, and only for X.&lt;strong&gt;0.0&lt;/strong&gt; SDK major versions).&lt;/p&gt;
&lt;p&gt;Regarding the &lt;strong&gt;ble_&lt;/strong&gt;&lt;strong&gt;template_project&lt;/strong&gt;&lt;span&gt;&amp;nbsp;whose sdk_config.h you recommend when starting from scratch during a migration: j&lt;/span&gt;ust a hint which might be useful to other readers: the description of the&amp;nbsp;project can be found in the online Infocenter (or in the newer online Documentation Library), however not under the name &amp;quot;ble_app_template&amp;quot; but under the name &amp;quot;Template Application&amp;quot;:&lt;br /&gt;- in Infocenter here: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/ble_sdk_app_template.html?cp=4_0_0_4_1_2_23" rel="noopener noreferrer" target="_blank"&gt;Examples &amp;gt; Bluetooth low energy examples &amp;gt; BLE Peripheral &amp;gt; Template Application&lt;/a&gt;&lt;br /&gt;- in Documentation Library here: &lt;a href="https://www.nordicsemi.com/en/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/ble_sdk_app_template" rel="noopener noreferrer" target="_blank"&gt;Examples &amp;gt; Bluetooth low energy examples &amp;gt; BLE Peripheral &amp;gt; Template Application&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My conclusion to all this discussion is that I will try to &amp;quot;clean&amp;quot; my sdk_config.h file back to its&amp;nbsp;genuine&amp;nbsp;&amp;quot;factory&amp;quot; form as much as possible, by moving all the customizations (including overrides of #defines contained in sdk_config.h) to a separate&amp;nbsp;&lt;strong&gt;app_config.h&lt;/strong&gt;&amp;nbsp;file and follow your instructions using the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fsdk_config.html"&gt;USE_APP_CONFIG&amp;nbsp;&lt;/a&gt;macro (see above).&lt;br /&gt;This should simplify the future migration efforts, which still&amp;nbsp;requires&amp;nbsp;quite some work and presents risks of introducing potential errors.&lt;br /&gt;I also understand that such a migration should not be attempted while under project delivery deadline pressure, but should be planned with sufficient&amp;nbsp;time margin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recommended workflow to update sdk_config.h ?</title><link>https://devzone.nordicsemi.com/thread/159740?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 14:48:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d7cb798-8cf4-4956-b540-934575330d4b</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Magoo"]It is good to know that APIs are retained throughout all versions having the same major (e.g. v15.x.y).&lt;br /&gt;But that still does not completely answer the question to these developers who would like to migrate from SDK 14 (or SDK 13 or even older)&amp;nbsp;to SDK 15. &lt;br /&gt;I&amp;#39;m sure that there are many fellow developers out there who are in this situation. What workflow would you recommend in that case?[/quote]
&lt;p&gt;I would suggest you follow the migration guides on the infocenter, for example this one (&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fmigration.html&amp;amp;cp=4_0_1_1_9"&gt;from SDK 14.2 to SDK 15.0&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;There are different migration guides for a older SDK version to a newer SDK version.&lt;/p&gt;
[quote user="Magoo"]the majority (if not all) interrupt priorities (#define xxxx_IRQ_PRIORITY) in the section &amp;quot;nRF_Drivers&amp;quot;&amp;nbsp;have been changed from 6 (in SDK 15.0.0) to 7 (in SDK 15.2.0). The question that arises here&amp;nbsp;is: when I migrate my project (which was running stable under SDK 15.0.0) should I keep the interrupt priorities at 6 or change them to 7 with the new SDK? This decision can have a significant impact on the code behavior![/quote]
&lt;p&gt;&amp;nbsp;The interrupt priority levels 6 and 7 are below the SoftDevice, so there shouldn&amp;#39;t be any issue. Read here about &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.sds%2Fdita%2Fsoftdevices%2Fs130%2Fprocessor_avail_interrupt_latency%2Fprocessor_avail_interrupt_latency.html&amp;amp;cp=2_3_1_0_15"&gt;interrupt priority level&lt;/a&gt;.&lt;/p&gt;
[quote user="Magoo"]while developing my project, I have put together parts of sdk_config.h taken from various SDK example projects (i.e. from an usb peripheral example project and from a&amp;nbsp;ble peripheral example project) because I needed these functionalities. If I migrate the whole thing&amp;nbsp;to SDK 15.2.0 and start from scratch with&amp;nbsp;a genuine&amp;nbsp;&amp;quot;global&amp;quot; sdk_config.h file (which is supposed to be the one found in /SDK/config/nRFxxxx/config/, according to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33857/global-sdk_config-h-file" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt; discussion), some of the #defines needed in my project will be missing. Does this mean that I have to scan through the updated (SDK 15.2.0)&amp;nbsp;project examples and copy the relevant parts in their sdk_config.h file to my &amp;quot;new&amp;quot; sdk_config.h file? I hope not, because that&amp;#39;s a lot of work with a great risk&amp;nbsp;of screwing up things...[/quote]
&lt;p&gt;&amp;nbsp;I think that discussion might have been a bit confusing for you, here is what i would to:&lt;/p&gt;
&lt;p&gt;Use the &lt;strong&gt;ble_&lt;/strong&gt;&lt;strong&gt;template_project&lt;/strong&gt; &lt;strong&gt;sdk_config.h &lt;/strong&gt;file found in nRF5_SDK_15.2.0_clean\examples\ble_peripheral\ble_app_template\pca10040\s132\config.&lt;/p&gt;
&lt;p&gt;This file should have all the defines you need listed. You said you have CMSIS configuration wizard, and you have used code from various different examples, so what i would do is:&lt;/p&gt;
&lt;p&gt;Open the example you have used code from in Segger Embedded Studio and CMSIS Configuration for the sdk_config.h file in this example, on one screen.&lt;/p&gt;
&lt;p&gt;Open the template project in Segger Embedded Studio and CMSIS Configuration for the sdk_config.h file in the tutorial example, on one another screen.&lt;/p&gt;
&lt;p&gt;You know which libraries you have used, so you should just simply compare each CMSIS Configuration wizard with eachother. Like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f381db759ccd429e8bdaec58eb72041d/pastedimage1543589021193v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I still can see that this might be a bit work, but I think it&amp;#39;s a decent method to do it.&lt;/p&gt;
&lt;p&gt;When you are done, the &lt;strong&gt;sdk_config.h&lt;/strong&gt; file in the template project should be configurated correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Magoo"](see above): what should I do if I decide to leapfrog SDK 15.2.0 and wait until SDK 16.0.0 is released to migrate my project? I mean, given the complexity of migrating between two minor versions, what should I expect when I have to migrate between two major versions?[/quote]
&lt;p&gt;&amp;nbsp;Again, there will be migration guides from one SDK to another, both major and minor.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Magoo"]Looking at all these difficulties (potential sources of trouble)&amp;nbsp;I wonder if Nordic is suggesting to stay updated with the SDK or if they&amp;nbsp;recommend to stick with the same (old) SDK for the entire lifetime of a product?[/quote]
&lt;p&gt;&amp;nbsp;This depends, if your product works well and don&amp;#39;t require any new features, you could stick with the old SDK&lt;/p&gt;
&lt;p&gt;If you have bugs or require new features, you should upgrade.&lt;/p&gt;
&lt;p&gt;We do recommend that you have DFU capabilites.&lt;/p&gt;
[quote user="Magoo"]For how long will older SDK versions receive technical support?[/quote]
&lt;p&gt;They will always receive techincal support.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recommended workflow to update sdk_config.h ?</title><link>https://devzone.nordicsemi.com/thread/159619?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 18:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a66c699b-6dcb-47a5-86b2-21db70b31961</guid><dc:creator>Magoo</dc:creator><description>&lt;p&gt;Dear Andreas,&lt;/p&gt;
&lt;p&gt;thank you for the explanations and the useful suggestion with the USE_APP_CONFIG macro!&lt;/p&gt;
&lt;p&gt;It is good to know that APIs are retained throughout all versions having the same major (e.g. v15.x.y).&lt;br /&gt;But that still does not completely answer the question to these developers who would like to migrate from SDK 14 (or SDK 13 or even older)&amp;nbsp;to SDK 15. &lt;br /&gt;I&amp;#39;m sure that there are many fellow developers out there who are in this situation. What workflow would you recommend in that case?&lt;/p&gt;
&lt;p&gt;And returning to my original question (= migrating&amp;nbsp;from SDK 15.0.0 to 15.2.0)&amp;nbsp;I see that I cannot simply copy the sdk_config.h file from&amp;nbsp;the project in v15.0.0 to&amp;nbsp;v15.2.0.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t care much about the position of the #defines in the file. But I&amp;#39;m worried about the large number of changes. Here just a few of those that matter in my case:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;sdk_config.h in SDK 15.2.0 contains many new (or renamed)&amp;nbsp;#defines which assign a value or a macro&amp;nbsp;to a keyword. This is particularly true&amp;nbsp;within the &amp;quot;nRF_Crypto&amp;quot; and &amp;quot;nRF_Logger&amp;quot; sections.&amp;nbsp;I can imagine that if these statements&amp;nbsp;are missing (which would be the case if I simply copy the sdk_config.h file from my SDK 15.0.0 project to the 15.2.0 project), the software would not run correctly or would not even compile/link.&lt;/li&gt;
&lt;li&gt;the majority (if not all) interrupt priorities (#define xxxx_IRQ_PRIORITY) in the section &amp;quot;nRF_Drivers&amp;quot;&amp;nbsp;have been changed from 6 (in SDK 15.0.0) to 7 (in SDK 15.2.0). The question that arises here&amp;nbsp;is: when I migrate my project (which was running stable under SDK 15.0.0) should I keep the interrupt priorities at 6 or change them to 7 with the new SDK? This decision can have a significant impact on the code behavior!&lt;/li&gt;
&lt;li&gt;while developing my project, I have put together parts of sdk_config.h taken from various SDK example projects (i.e. from an usb peripheral example project and from a&amp;nbsp;ble peripheral example project) because I needed these functionalities. If I migrate the whole thing&amp;nbsp;to SDK 15.2.0 and start from scratch with&amp;nbsp;a genuine&amp;nbsp;&amp;quot;global&amp;quot; sdk_config.h file (which is supposed to be the one found in /SDK/config/nRFxxxx/config/, according to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33857/global-sdk_config-h-file" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt; discussion), some of the #defines needed in my project will be missing. Does this mean that I have to scan through the updated (SDK 15.2.0)&amp;nbsp;project examples and copy the relevant parts in their sdk_config.h file to my &amp;quot;new&amp;quot; sdk_config.h file? I hope not, because that&amp;#39;s a lot of work with a great risk&amp;nbsp;of screwing up things...&lt;/li&gt;
&lt;li&gt;(see above): what should I do if I decide to leapfrog SDK 15.2.0 and wait until SDK 16.0.0 is released to migrate my project? I mean, given the complexity of migrating between two minor versions, what should I expect when I have to migrate between two major versions?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Looking at all these difficulties (potential sources of trouble)&amp;nbsp;I wonder if Nordic is suggesting to stay updated with the SDK or if they&amp;nbsp;recommend to stick with the same (old) SDK for the entire lifetime of a product?&lt;/p&gt;
&lt;p&gt;For how long will older SDK versions receive technical support?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recommended workflow to update sdk_config.h ?</title><link>https://devzone.nordicsemi.com/thread/159538?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 11:57:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d5d42e5-5b28-4a59-95b0-2e3efa49bf6b</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;The API included in sdk_config.h in SDK 15.2 should be the same as the API included in the major versions sdk_config.h (SDK 15.0). This should apply for all major and minors (ex API should be the same in SDK 14.0, 14.1, 14.2, but it might not be the same from 14.0 to 15.0).&lt;/p&gt;
&lt;p&gt;With this in background, if you are working on a example project, the &lt;strong&gt;content&lt;/strong&gt; of the &lt;strong&gt;sdk_config.h&lt;/strong&gt; file should contain the same in SDK 15.0 as in SDK 15.2. Where the different #defines are placed should not matter, unless you want a clear structure of where you place your different #defines.&lt;/p&gt;
&lt;p&gt;You could use the &lt;strong&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fsdk_config.html"&gt;USE_APP_CONFIG &lt;/a&gt;&lt;/strong&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fsdk_config.html"&gt;macro&lt;/a&gt; to place the #defines which you miss in SDK 15.2 from SDK 15.0 in a seperate configuration file you name &lt;strong&gt;app_config.h&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef APP_CONFIG_H__
#define APP_CONFIG_H__

#include &amp;lt;stdbool.h&amp;gt;

/**
 * @defgroup APP_SDK_CONFIG SDK configuration
 *
 * Application-specific SDK configuration settings are provided here.
 *
 * @{
 */

/* Override default sdk_config.h values. */
#define THE
#define DEFINES
#define THAT
#define ARE
#define DEFINED
#define HERE
#define WILL
#define OVERRIDE
#define THE
#define DEFINES
#define DONE
#define IN
#define sdk_config.h

/** @} end of APP_SDK_CONFIG */

#endif /* APP_CONFIG_H__ */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And then you edit the top of your &lt;strong&gt;sdk_config.h&lt;/strong&gt; file to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define USE_APP_CONFIG
#ifdef USE_APP_CONFIG
#include &amp;quot;app_config.h&amp;quot;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Using this technique also allows you to be more thorough with adding only the nessesary defines, if you read the &lt;strong&gt;API &lt;/strong&gt;on the infocenter and are aware of which defines you require.&lt;/p&gt;
&lt;p&gt;I hope this helps you, best regards.&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>