<?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>Best way for save project</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61726/best-way-for-save-project</link><description>Hi, 
 
 I would like to save my project and add something like a version number to it. I use an example from nordic SDK. So in my case I use solution from ...\examples\ble_peripheral\ble_app_uart. 
 If I press &amp;quot;save all&amp;quot; in SES, only main.c is saved.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 May 2020 12:57:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61726/best-way-for-save-project" /><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/252418?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 12:57:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e9a81ac-6eba-437e-837b-569f6c0e7b6b</guid><dc:creator>Simon</dc:creator><description>[quote user="simon1516"]Can you explain me that? I can´t see such folder when I create a copy of example project in &amp;nbsp;&lt;em&gt;&amp;lt;..&amp;gt;\examples\ble_peripheral\my_ble_project&lt;/em&gt;[/quote]
&lt;p&gt;The folder &lt;em&gt;my_ble_project&amp;nbsp;&lt;/em&gt;was just an imaginary folder I made up, e.g. you copy the folder&amp;nbsp;examples\ble_peripheral\ble_app_uart, rename it to e.g. &lt;em&gt;examples\ble_peripheral\my_ble_project&lt;/em&gt;, and modify it according to your needs.&lt;/p&gt;
&lt;p&gt;The reason you don&amp;#39;t see any other .c/.h files in the default projects in the SDK is that nearly all&amp;nbsp;drivers and libraries (source (.c) and header files (.h)) they&amp;#39;re using are already present in the SDK. There are some exceptions, like the&amp;nbsp;&lt;em&gt;examples\ble_peripheral\ble_app_gatts_c&lt;/em&gt; example, which has created some custom files for that project (app_adv.c, app_adv.h and app_bsp.c).&amp;nbsp;&lt;/p&gt;
[quote user="simon1516"]If I for example customize a few libraries (e.g.&amp;nbsp; &lt;em&gt;&amp;lt;..&amp;gt;\components\ble\ble_services\ble_nus). Where should i save the copy? And where do I have to change the path to it?&lt;/em&gt;[/quote][quote user="simon1516"]It´s okay for me, developing in the SDK environment, but maybe it´s neccessary to seperate the modified files. For example if I would like to upload the project with all modified files. How can I extract them?[/quote]
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;While writing this, a &amp;quot;better&amp;quot; approach all the sudden popped into my head. Jump down to the arrows (⇒⇒⇒⇒⇒⇒) to go straight to it. Pick the approach that suits you best.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You could rename folder&amp;nbsp;&lt;em&gt;components\ble\ble_services\ble_nus &lt;/em&gt;and it&amp;#39;s subfiles and copy it&amp;nbsp;into e.g.&amp;nbsp;&lt;em&gt;examples\ble_peripheral\my_ble_project. &lt;/em&gt;It will then look like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5073bfb698a64ff8886131b7d0f9eda7/pastedimage1590754908946v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then you have to&amp;nbsp;add&lt;em&gt;&amp;nbsp;#include &amp;quot;ble_nus_modified/ble_nus.h&amp;quot;&amp;nbsp;&lt;/em&gt;to main.c in addition to adding&amp;nbsp;&lt;span&gt;examples\ble_peripheral\ble_app_uart\ble_nus_modified to the path&amp;#39;s and the file&amp;nbsp;examples\ble_peripheral\ble_app_uart\ble_nus_modified\ble_nus_modified.c in Project Explorer (&lt;a href="https://www.youtube.com/watch?v=t-kh1EbesvI"&gt;https://www.youtube.com/watch?v=t-kh1EbesvI&lt;/a&gt;). It might be easier to add the files right into&amp;nbsp;&lt;em&gt;examples\ble_peripheral\my_ble_project &lt;/em&gt;since it is in the same folder as main.c and don&amp;#39;t you don&amp;#39;t need to add the path and the source file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Remember to remove all references to ble_nus.c and ble_nus.h in your project, so there won&amp;#39;t be any collisions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now your project is very portable, and you can upload&amp;nbsp;examples\ble_peripheral\ble_app_uart\ble_nus_modified to e.g. GitHub and other people can easily test your project without modifying the SDK itself.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;⇒⇒⇒⇒⇒⇒&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another approach I just thought about, which actually allows you to modify the libraries directly, is to run git init inside e.g.&amp;nbsp;nRF5_SDK_16.0.0_98a08e2, then create a branch &lt;em&gt;my_ble_project_branch&lt;/em&gt; which is only intended to be used with your project (jump back to master when building other projects in the SDK).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Then you can modify the files you want, &lt;a href="https://devconnected.com/how-to-create-and-apply-git-patch-files/"&gt;create a patch file&lt;/a&gt;, and you can simply share the patch files, which only includes the changes instead of the whole SDK and people can easily test your project by running git apply inside a fresh&amp;nbsp;&lt;em&gt;nRF5_SDK_16.0.0_98a08e2.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="simon1516"]Is there a way, to delete unused .h and .c files from project? There are much included .h files in one project. I don´t know if I need them all.[/quote]
&lt;p&gt;If there are header (.h) files included at the top of main.c in a default project,&amp;nbsp;you should not delete it, since all of the .h files are included for a reason. Functions or variables or both from the included header files will be used somewhere in the project. However, if you remove all the functions/variables from the project, declared in a specific header file, you can remove the header file as well as the associated .c file. I don&amp;#39;t think you should worry too much about&amp;nbsp;unused .h and .c&amp;nbsp;since the compiler will only include stuff that is actually used. Don&amp;#39;t take my words for this, as I&amp;#39;m not an expert in compilers. There may be exceptions.&lt;/p&gt;
&lt;p&gt;If you are referring to all the source files in the Project Explorer window or all the included paths. This will not affect the size of the project unless it is used in the actual project. Like in main.c, or indirectly by functions called in main.c.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/252265?ContentTypeID=1</link><pubDate>Thu, 28 May 2020 16:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0611dfe8-ae8f-450f-86ce-f101464fd09a</guid><dc:creator>simon1516</dc:creator><description>[quote userid="72692" url="~/f/nordic-q-a/61726/best-way-for-save-project/252168"]The folder/repo&amp;nbsp;&lt;em&gt;my_ble_project&amp;nbsp;&lt;/em&gt;will also contain all your custom libraries.[/quote]
&lt;p&gt;Can you explain me that? I can&amp;acute;t see such folder when I create a copy of example project in &amp;nbsp;&lt;em&gt;&amp;lt;..&amp;gt;\examples\ble_peripheral\my_ble_project&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/61726/best-way-for-save-project/251426"]However,&amp;nbsp;to your question.&amp;nbsp;One approach is&amp;nbsp;is to put your custom libraries inside e.g.&amp;nbsp;&lt;em&gt;examples\ble_peripheral\ble_app_uart&lt;/em&gt;[/quote]
&lt;p&gt;&lt;em&gt;&lt;/em&gt;If I for example customize a few libraries (e.g.&amp;nbsp; &lt;em&gt;&amp;lt;..&amp;gt;\components\ble\ble_services\ble_nus). Where should i save the copy? And where do I have to change the path to it?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;It&amp;acute;s okay for me, developing in the SDK environment, but maybe it&amp;acute;s neccessary to seperate the modified files. For example if I would like to upload the project with all modified files. How can I extract them?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Is there a way, to delete unused .h and .c files from project? There are much included .h files in one project. I don&amp;acute;t know if I need them all.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/252168?ContentTypeID=1</link><pubDate>Thu, 28 May 2020 12:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7cdf64c-0ca3-43b8-a28e-ddd664e6a3af</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;[quote user="simon1516"][/quote]&lt;/p&gt;
&lt;p&gt;My opinion is, that I then have a very small project folder with just my needed files in it and not a big folder with every libraries from SKD in it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Isn´t that the normal way for developing?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The normal&amp;nbsp;(at least from what I&amp;#39;ve seen) and the easiest way of creating a project with the nRF5 SDK is to do it from within the SDK. E.g. inside &lt;em&gt;&amp;lt;..&amp;gt;\examples\ble_peripheral&lt;/em&gt;.&amp;nbsp;This is because all the paths in the example projects are relative from the location they are placed.&lt;/p&gt;
&lt;p&gt;Then you can run git init from e.g.&amp;nbsp;&lt;em&gt;&amp;lt;..&amp;gt;\examples\ble_peripheral\my_ble_project&lt;/em&gt;, upload&amp;nbsp;&lt;em&gt;my_ble_project&amp;nbsp;&lt;/em&gt;to Github, and you can share it with other people. The folder/repo&amp;nbsp;&lt;em&gt;my_ble_project&amp;nbsp;&lt;/em&gt;will also contain all your custom libraries.&amp;nbsp;Then they can easily test it, by downloading the appropriate SDK and place it correctly within it.&lt;/p&gt;
&lt;p&gt;What are your main reasons for building it outside the SDK? The end result will not be any different (the compiler will only include the&amp;nbsp;software&amp;nbsp;that is actually being used by the project), and there are no practical differences except for the location of the project and all the paths it&amp;#39;s using.&lt;/p&gt;
&lt;p&gt;Are your&amp;nbsp;reason due to preference, and that it is a cleaner approach?&lt;/p&gt;
&lt;p&gt;If you would still like to build it outside the SDK I can help you with that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/252040?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 17:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5191b9a-7b88-4d76-8def-373accaa2a6a</guid><dc:creator>simon1516</dc:creator><description>[quote userid="72692" url="~/f/nordic-q-a/61726/best-way-for-save-project/251946"]Check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44638/how-to-move-an-sdk-example-out-of-the-sdk-tree"&gt;this ticket&lt;/a&gt;&amp;nbsp;which explains how to&amp;nbsp;build an example out of the SDK tree.[/quote]
&lt;p&gt;I tried this, but it doesn&amp;acute;t works as espected. I did the steps as described in the instruction. But when I do the last step (build solution), I got a few errors. The libraries doesn&amp;acute;t exist. &lt;/p&gt;
&lt;p&gt;For make this working, I have to copy all the folders from SDK (components, external and so on) to my example folder. Sure, because the libraries are all in these folders. Is that the solution the older TO was looking for? In this case, the example folder contains all existing SDK libraries.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My aim was it, to just serperate my examples and the libraries for just this example.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So in my case I would like to have two folders:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. C:\\ble_app_uart&amp;nbsp; (with the example in it)&lt;/p&gt;
&lt;p&gt;2. C:\\ble_app_uart\libraries (with just all the needed libraries for the example in it)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My opinion is, that I then have a very small project folder with just my needed files in it and not a big folder with every libraries from SKD in it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Isn&amp;acute;t that the normal way for developing?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/251946?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 12:25:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:746f2719-f15f-4712-8657-92f388c00947</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44638/how-to-move-an-sdk-example-out-of-the-sdk-tree"&gt;this ticket&lt;/a&gt;&amp;nbsp;which explains how to&amp;nbsp;build an example out of the SDK tree.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57238/adding-uart-functionality-to-a-project"&gt;This case&lt;/a&gt; may also be helpful.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/251938?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 12:02:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8222e5f-b26c-444d-a4d0-1f604f5b5aae</guid><dc:creator>simon1516</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;acute;ve copied&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;- main.c&lt;/p&gt;
&lt;p&gt;-flash_placement&lt;/p&gt;
&lt;p&gt;-EMPROJECT-file&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;to another specific folder. Now, I would like to make the example &amp;quot;ble_app_uart&amp;quot; runable. Of course I got many errors after trying to compile. I have to include all libraries which are used in main.c to my new folder. Is there an easy way for doing this? Or do I have to copy every .h file to this new folder (there are a lot of it)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/251426?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 09:20:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24c7eb54-6419-4e11-8cad-8c3d978d6a99</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I agree with&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/fero.masiar"&gt;Franti&amp;scaron;ek&lt;/a&gt;&amp;nbsp;that&amp;nbsp;it isn&amp;#39;t&amp;nbsp;recommended to modify the libraries or drivers already present in the SDK, at least you shouldn&amp;#39;t change the API (the functions in the .h file used to interact with). Since it may break other examples using that library. To copy the content into your own custom library and then modify it, is probably a safer option.&lt;/p&gt;
&lt;p&gt;However,&amp;nbsp;to your question.&amp;nbsp;One approach is&amp;nbsp;is to put your custom libraries inside e.g.&amp;nbsp;&lt;em&gt;examples\ble_peripheral\ble_app_uart, &lt;/em&gt;since (I think) this will make them part of the solution and when you press &amp;quot;save all&amp;quot; they will be included.&amp;nbsp;In addition,&amp;nbsp;you could run &lt;em&gt;git init &lt;/em&gt;inside&amp;nbsp;&lt;em&gt;examples\ble_peripheral\ble_app_uart &lt;/em&gt;which&amp;nbsp;will make it easy to track all the changes you&amp;#39;ve done.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way for save project</title><link>https://devzone.nordicsemi.com/thread/251343?ContentTypeID=1</link><pubDate>Sat, 23 May 2020 13:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deb5ad2e-4e01-4ab3-8cea-4dc187456e13</guid><dc:creator>František</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I think you should&amp;nbsp;not modify this files because it is common for many examples in SDK. I think good practice is&amp;nbsp;create new file and include needed files.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>