<?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>printf problem after startup of device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49382/printf-problem-after-startup-of-device</link><description>Hello 
 I&amp;#39;m facing with printf over uart problem in my app. Application based on uart example from SDK 15.2. 
 However, it happens that printf function prints message to uart while on debugger. After start-up every time the first printf miss to print</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jul 2019 20:06:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49382/printf-problem-after-startup-of-device" /><item><title>RE: printf problem after startup of device</title><link>https://devzone.nordicsemi.com/thread/196912?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2019 20:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d0af551-5c39-42a6-ba78-75336f368245</guid><dc:creator>Simon</dc:creator><description>[quote user=""]After start-up every time the first printf miss to print something. After that, it works properly.[/quote]
&lt;p&gt;&amp;nbsp;Are you calling &lt;em&gt;printf()&amp;nbsp;&lt;/em&gt;before &lt;em&gt;uart_init()? &lt;/em&gt;That will not work.&lt;em&gt;&amp;nbsp;&lt;/em&gt;However, then the program should hang, like explained &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43575/using-pin-6-as-gpio-in-spi-functionality"&gt;here&lt;/a&gt;, and it doesn&amp;#39;t seem that&amp;#39;s your case.&lt;/p&gt;
&lt;p&gt;Could you share your project or a minimal project that demonstrates this behavior, then I can try to reproduce it. I can make the case private if you would like so.&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: printf problem after startup of device</title><link>https://devzone.nordicsemi.com/thread/196644?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 15:31:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a7bd177-72b8-4ae9-9949-db76a9053b9e</guid><dc:creator>awneil</dc:creator><description>[quote userid="75374" url="~/f/nordic-q-a/49382/printf-problem-after-startup-of-device/196642"]suggest another way[/quote]
&lt;p&gt;i&amp;nbsp;suggest that you use a terminal or similar to see what is actually being sent.&lt;/p&gt;
&lt;p&gt;Best to use something that&amp;nbsp;shows the raw hex - so that you can see if stuff is getting corrupted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printf problem after startup of device</title><link>https://devzone.nordicsemi.com/thread/196642?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 15:15:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8246691-324f-4f72-9e94-bbf44bca9e43</guid><dc:creator>predragn</dc:creator><description>&lt;p&gt;I use while (app_uart_get(&amp;amp;cr) != NRF_SUCCESS): to receive the message character by character, (meanwhile parse it). I have led indication to tell me the message is received,&amp;nbsp; and so on. So I don&amp;#39;t think the problem is in receiving but if you think the problem is in approach that i showed (i took this approach from the example) you can suggest another way. Except these i have an Uart error handler. Imagine&amp;nbsp; &lt;a href="https://infocenter.nordicsemi.com/index.jsp"&gt;https://infocenter.nordicsemi.com/index.jsp&lt;/a&gt; just without the loopback test and with logic for receiving and parsing the message character by character.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printf problem after startup of device</title><link>https://devzone.nordicsemi.com/thread/196636?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 15:01:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb3abe4b-b621-4d54-8122-99da2ce3e946</guid><dc:creator>awneil</dc:creator><description>[quote userid="75374" url="~/f/nordic-q-a/49382/printf-problem-after-startup-of-device/196632"]I send some command, wait for the answer that never happen that time.[/quote]
&lt;p&gt;So how do you know whether the problem is in the sending or the receiving?&lt;/p&gt;
&lt;p&gt;Or both?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printf problem after startup of device</title><link>https://devzone.nordicsemi.com/thread/196632?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 14:55:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:487fb833-cefd-46d1-bbf0-98f647ef3187</guid><dc:creator>predragn</dc:creator><description>&lt;p&gt;I wasn&amp;#39;t absolutely precise about that - thing is: I have implemented some commands that come over the same uart where the printf flushes it&amp;#39;s stream. Now the problem is after startup - I send some command, wait for the answer that never happen that time. Next time I send same command i have expected answer sent back. No power off s between steps.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is one more thing weird about that (take a look the code bellow): Explained situation happens when have some led togglings (based on &lt;strong&gt;nrf_delay_ms()&lt;/strong&gt;); If put the printf above the Master_UsrLedsToggle() printf sends character stream normaly. If situation is that I have printf bellow the&amp;nbsp; toggling, i don&amp;#39;t get the answer after startup.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(CMD_BUFF[2]==&amp;#39;U&amp;#39;){
								Master_UsrLedsToggle();
								printf(&amp;quot;LEDU ENTER\n&amp;quot;);
						}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: printf problem after startup of device</title><link>https://devzone.nordicsemi.com/thread/196623?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 14:31:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4afe87e-b70c-4391-8d71-d07f1329cde0</guid><dc:creator>awneil</dc:creator><description>[quote userid="75374" url="~/f/nordic-q-a/49382/printf-problem-after-startup-of-device"]the first printf miss to print something[/quote]
&lt;p&gt;What, exactly, do you mean by that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>