<?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>Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66846/adding-header-and-source-files-to-nrf-connect-sdk-project</link><description>Hello all, 
 I am working on a custom application that requires gps, https post requests, SPI, and CAN, and I am having trouble adding source and header files to my project. Following the tutorial on the nRF Connect SDK documentation page, I am trying</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 07 Mar 2021 17:35:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66846/adding-header-and-source-files-to-nrf-connect-sdk-project" /><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/298227?ContentTypeID=1</link><pubDate>Sun, 07 Mar 2021 17:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9fd2141-cd13-4551-9523-010fe99ab36d</guid><dc:creator>Alan</dc:creator><description>&lt;p&gt;An easier way to reload the project is to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Save CMakeLists.txt&lt;/li&gt;
&lt;li&gt;Edit the configuration (Project-&amp;gt;Configure nRF Connect SDK Project)&lt;/li&gt;
&lt;li&gt;Click the Configure button&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After that, my new c file appears in the project list.&amp;nbsp; A little clumsy, but works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/286637?ContentTypeID=1</link><pubDate>Mon, 28 Dec 2020 06:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7189d9e7-2e6f-4077-b1c2-3b3fa04112de</guid><dc:creator>SergeiA</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/crfosse"&gt;Carl Richard&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, editing CMakeLists.txt and even reloading project after that doesn&amp;#39;t work. Your modification of SES generates .emProject file only once, when user executes command &amp;quot;Open nRF Connect SDK project&amp;quot;. After that any changes to CMakeLists.txt will not update build.emProject and new files will not be included into build.&lt;/p&gt;
&lt;p&gt;So to add new .c file I have run this command again, select board, select folder in combo box (which seems always points to obscure wrong folder), check &amp;quot;clear build folder&amp;quot; and wait until whole enchilada will be regenerated again.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it that hard to reinterpret CMake file when it is changed and update Segger project file? That what other IDEs based on CMake do.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Sergei&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/274737?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 18:44:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f510e201-e11b-43ba-b199-e68372055212</guid><dc:creator>kgarland789</dc:creator><description>&lt;p&gt;Hi Carl,&lt;/p&gt;
&lt;p&gt;This is great, and makes perfect sense! thanks for the example.&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;/p&gt;
&lt;p&gt;Kyle Garland&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/274510?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 08:32:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e931df17-b446-4eae-af0e-31876ee81495</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hi again, Kyle!&lt;br /&gt;&lt;br /&gt;Good to hear. CMakeLists must indeed be updated as you have shown here, but note that the Zephyr &lt;a href="https://docs.zephyrproject.org/latest/application/index.html#application-specific-code"&gt;documentation &lt;/a&gt;recommends that both source and header files are located under the src directory. You can have a look at this small hello world sample I&amp;#39;ve put together here:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8540.hello_5F00_world.zip"&gt;devzone.nordicsemi.com/.../8540.hello_5F00_world.zip&lt;/a&gt;. What&amp;#39;s worth noting is that every subdirectory of src should contain it&amp;#39;s own CMakeLists targeting the source code of that module. You can see this in the sample I&amp;#39;ve added here.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You should not need to do anything else than updating CMakeLists according to your project contents, and updating your #includes.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Hope this makes sense!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/274108?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 17:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df006352-78eb-4919-b230-ff08b437d31e</guid><dc:creator>kgarland789</dc:creator><description>&lt;p&gt;Hi Carl,&lt;/p&gt;
&lt;p&gt;Thank you for your response! I found the src folder in the project directory and that seems to do the trick. Would I need to then do something in CMakeList.txt like:&lt;/p&gt;
&lt;p&gt;zephyr_include_directories(include)&lt;br /&gt;zephyr_library_include_directories(include)&lt;/p&gt;
&lt;p&gt;add_subdirectory(src/https)&lt;/p&gt;
&lt;p&gt;add_subdirectory(src/gps)&lt;/p&gt;
&lt;p&gt;add_subdirectory(src/device_drivers)&lt;/p&gt;
&lt;p&gt;And then after, would I need to add dependencies for each specific project? Like If I&amp;#39;m starting with https_client and want to add the gps code, do I need to change the project dependencies to include the gps project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/273983?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 09:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fbfca71-44a2-4369-b10e-12421087ee76</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hi, Kyle!&lt;br /&gt;&lt;br /&gt;This is unfortunate behavior. I will take further internally. In the meantime I recommend doing the addition of header and source files manually by: &lt;br /&gt;1. Navigating to the project folder either using the file explorer or a terminal.&amp;nbsp;&lt;br /&gt;2. Placing your .c files in the src folder located there.&lt;br /&gt;3. Making an &amp;quot;include&amp;quot; folder where you place your header files.&lt;br /&gt;4. Edit CMakeList.txt directly as described in our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_modifying.html#editing-cmakelist-txt-directly"&gt;sample modification guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Note that you may need to reload your SES project after changing CMakeLists.txt.&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding header and source files to nRF Connect SDK Project</title><link>https://devzone.nordicsemi.com/thread/273586?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 18:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcf9e0e3-0d18-4438-bce2-e33c08a56986</guid><dc:creator>kgarland789</dc:creator><description>&lt;p&gt;EDIT: Also it looks like I can&amp;#39;t even add a new folder because that option is grayed out when I right click on Project &amp;#39;app/libapp.a&amp;#39;. Is this where a new folder even goes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>