<?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>How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43204/how-to-include-existing-header-files-to-main-c</link><description>Hello. 
 I want to integrate UART and SPI ,I am using SDK15.2. The problem here is i am not able to add app_uart.h to main.c(spi). 
 My question here is how to add it to main,c? 
 I am using Keil uVision. 
 Thanks in Advance.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Feb 2019 10:39:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43204/how-to-include-existing-header-files-to-main-c" /><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/170316?ContentTypeID=1</link><pubDate>Mon, 11 Feb 2019 10:39:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd06900a-9bf2-4e89-98ca-2175e74febf0</guid><dc:creator>awneil</dc:creator><description>[quote userid="75734" url="~/f/nordic-q-a/43204/how-to-include-existing-header-files-to-main-c/170262"]Of course[/quote]
&lt;p&gt;Well, not actually &amp;quot;of course&amp;quot;: it &lt;em&gt;could&lt;/em&gt; be done - be there&amp;#39;d have to be some sort of multiplexing scheme on the chip, and demultiplexing at the other end ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/170262?ContentTypeID=1</link><pubDate>Mon, 11 Feb 2019 06:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45b3ecdc-9046-4098-8b22-3a3a171a45be</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Of course, the UART cannot be used as an application and a backend logger at the same time. You will have to choose one of the functionalities, and seeing as you want to use UART in your application, you have to disable the UARTs backend logger, which is NRF_LOG_BACKEND_UART. If you want a backend logger anyway, you can use the RTT (Real-Time Terminal) as your backend logger instead.&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: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/170088?ContentTypeID=1</link><pubDate>Fri, 08 Feb 2019 10:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3410be0-73ee-4f00-9603-b5a17b9f1c4b</guid><dc:creator>MRafiq9748</dc:creator><description>&lt;p&gt;Thanks a lot,&lt;/p&gt;
&lt;p&gt;It worked fine. One request, can you please elaborate this point&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/43204/how-to-include-existing-header-files-to-main-c/169925"]You will have to set NRF_LOG_BACKEND_UART to 0 and alternatively use RTT as your backend.[/quote]
&lt;p&gt;Once again thanks.&lt;/p&gt;
&lt;p&gt;Regards.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;M Rafiq&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/169925?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 13:10:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdd224f9-9d0a-41a5-a718-dcde98521236</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t use UART as both application and log backend. I suspect you might have both enabled in sdk_config.h. You will have to set NRF_LOG_BACKEND_UART to 0 and alternatively use RTT as your backend. If you are having further trouble, please post your sdk_config.h file so I can have a look at it.&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: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/169865?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 09:30:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38af44e2-117c-4509-8965-8d576903b2db</guid><dc:creator>MRafiq9748</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;We have already enabled all functions accordingly in config and no error is shown.&lt;/p&gt;
&lt;p&gt;NRF_LOG_DEFAULT_BACKENDS_INIT() creates problem.&lt;/p&gt;
&lt;p&gt;when we comment it only uart works but when we uncomment it nothing works.&lt;/p&gt;
&lt;p&gt;We want both UART and SPI to work .&lt;/p&gt;
&lt;p&gt;Any help would be highly appreciated.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;M Rafiq.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/169292?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2019 12:32:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3977e8af-ce3f-43f6-aaa8-22c5fc3cb68a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What most people have trouble with is forgetting&amp;nbsp;to enable something in the sdk_config.h file. You have to go through the sdk_config.h file of a uart example, and make sure that all functions enabled there are also enabled in your projects sdk_config file, as in setting all functions that are set to 1 in the example sdk_config to 1 in your project as well. If there are some functions enabled in the example file that is not at all in your project, you will have to copy/paste those.&amp;nbsp;&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: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/169217?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2019 07:14:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d580be1-02e6-4a30-8988-f467156a97f8</guid><dc:creator>MRafiq9748</dc:creator><description>&lt;p&gt;Have done all the necessary steps in program,also in sdk_config.h.Its not showing any errors now,but when i look on putty nothing appears.If we comment uart portion in main, nrf_log_info statements appear.&lt;/p&gt;
&lt;p&gt;Whats the problem?&lt;/p&gt;
&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168999?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 09:06:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27fc1348-5015-45f7-8971-076021ca15fe</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;It&amp;#39;s generally better to copy &amp;amp; paste errors as text - rather than a picture.&lt;/p&gt;
&lt;p&gt;But your picture is clear enough to see in this case.&lt;/p&gt;
&lt;p&gt;Again, this is a standard &amp;#39;C&amp;#39; issue: header files just contain&amp;nbsp;&lt;strong&gt;declarations&lt;/strong&gt; (function &lt;em&gt;prototypes&lt;/em&gt;)&amp;nbsp; - so you also need to add the source (&lt;strong&gt;.c&lt;/strong&gt;) file (or pre-built binary library) with the &lt;em&gt;&lt;strong&gt;definitions&lt;/strong&gt;&lt;/em&gt; of those functions.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://c-faq.com/decl/decldef.html"&gt;http://c-faq.com/decl/decldef.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And, again, there is a Nordic-specific twist that the correct settings in &lt;strong&gt;sdk_config.h&lt;/strong&gt; are also required.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/39503/undefined-reference-on-the-linker-level"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/39503/undefined-reference-on-the-linker-level&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168972?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 05:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a140904-b3ce-4bf5-8951-c219cb2b3673</guid><dc:creator>MRafiq9748</dc:creator><description>&lt;p&gt;I am able to include all the necessary files,but when i build it shows 2 errors.&lt;/p&gt;
&lt;p&gt;I am attaching the picture of error message along with Screenshot of a file in program which appears in faded form.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/720x480/__key/communityserver-discussions-components-files/4/Screenshot-_2800_12_2900_.png" /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168848?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 11:11:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a294e02-495e-4373-864d-3a1d61b75435</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;It would have been helpful if you have said that in the first place!&lt;/p&gt;
&lt;p&gt;Again, instructions for setting up Include Paths will be in your IDE&amp;#39;s &lt;strong&gt;documentation&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.keil.com/support/man/docs/uv4/"&gt;http://www.keil.com/support/man/docs/uv4/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168844?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 11:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d67f13b2-0284-48cd-8356-9077558ed67c</guid><dc:creator>MRafiq9748</dc:creator><description>&lt;p&gt;I tried #include app_uart.h&amp;quot; at the first place but when it comes to specifying path,I am not having a proper picture how to do that.&lt;/p&gt;
&lt;p&gt;Thanks for replying.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168843?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 10:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d3f795c-525c-4a82-a691-7d6dea3b065c</guid><dc:creator>awneil</dc:creator><description>[quote userid="76918" url="~/f/nordic-q-a/43204/how-to-include-existing-header-files-to-main-c"]i am not able to add &lt;strong&gt;app_uart.h&lt;/strong&gt; to &lt;strong&gt;main.c&lt;/strong&gt;[/quote]
&lt;p&gt;What, exactly, do you mean by that?&lt;/p&gt;
&lt;p&gt;What have you tried?&lt;/p&gt;
&lt;p&gt;What was the result?&lt;/p&gt;
[quote userid="76918" url="~/f/nordic-q-a/43204/how-to-include-existing-header-files-to-main-c"]My question here is how to add it to&lt;strong&gt; main,c?&amp;nbsp;&lt;/strong&gt;[/quote]
&lt;p&gt;The simple answer is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;app_uart.h&amp;quot;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In addition, as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/shrinidhi-bhat"&gt;Shrinidhi Bhat&lt;/a&gt;&amp;nbsp;said, you will have to correctly configure your Include Paths so that the compiler knows where to find the file.&lt;/p&gt;
&lt;p&gt;The documentation for your particular IDE will tell you how to do this.&lt;/p&gt;
&lt;p&gt;All of the above is completely standard and would be the same for &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt; &lt;/em&gt;&amp;#39;C&amp;#39; project - it is not specific to Nordic.&lt;/p&gt;
&lt;p&gt;In addition to the above, many of the Nordic headers rely on settings in the &lt;strong&gt;sdk_config.h&lt;/strong&gt; file to &amp;quot;enable&amp;quot; them - so you will also need to have these settings correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BTW - how to post source code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0268._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168829?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 10:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b58fde38-7716-4d22-8500-26290b174d4f</guid><dc:creator>MRafiq9748</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;Actually I am using Keil uvison.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try this method.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include existing header files to main.c?</title><link>https://devzone.nordicsemi.com/thread/168827?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 09:53:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b79b44c5-7632-4895-8cdd-bee4136b119e</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hello Rafiq,&lt;/p&gt;
&lt;p&gt;If you are asking how one adds a header file to a project you need to follow the following steps:&lt;/p&gt;
&lt;p&gt;1)&amp;nbsp; Right click on project and select options.&lt;/p&gt;
&lt;p&gt;2) You&amp;#39;ll see the a debug option, which can be dropped down to &lt;strong&gt;common&lt;/strong&gt; (Private configurations).&lt;/p&gt;
&lt;p&gt;3) Click on preprocessor and click on User include directories.&lt;/p&gt;
&lt;p&gt;4) using the same format shown in the window, add a path to the header file you want to add. Here it is app_uart.h for you.&lt;/p&gt;
&lt;p&gt;PS:- This is how Segger Embedded studio (SES) will look like. It will be something similar for other IDEs.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>