<?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>Timing Issue with app_uart_put()?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17613/timing-issue-with-app_uart_put</link><description>Hello everyone, 
 I have very pesky bug that is leaving me in fits. I have a feeling it is a timing issue, but I am not sure at this point. Here is my issue, and I would love anyone&amp;#39;s debugging help: 
 I have helper functions to write chars over UART</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Dec 2016 23:20:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17613/timing-issue-with-app_uart_put" /><item><title>RE: Timing Issue with app_uart_put()?</title><link>https://devzone.nordicsemi.com/thread/67726?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2016 23:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9386de87-d78c-423e-8b9a-ffe3476fd9c3</guid><dc:creator>Akshay</dc:creator><description>&lt;p&gt;I guess one modification you needed in your code was this, not sure if this was your actual problem. It was skipping few character for me.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; void uart_print(char *str){   
    int i = 0;
    while (str[i] != &amp;#39;\0&amp;#39;){
        while(app_uart_put(str[i])!= NRF_SUCCESS);
        i++;
    }
 }

void uart_println(char *str){
    uart_print(str);
    while(app_uart_put(&amp;#39;\n&amp;#39;)!= NRF_SUCCESS);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;strong&gt;&amp;#39;app_uart_put&amp;#39;&lt;/strong&gt; function needs to wait before the previous characters which you have already put are sent, Hence the while loop. Hope this will help others.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timing Issue with app_uart_put()?</title><link>https://devzone.nordicsemi.com/thread/67725?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2016 04:08:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53561dce-fe71-4993-8fad-da8de3374ea7</guid><dc:creator>Josh Grob</dc:creator><description>&lt;p&gt;UPDATE&lt;/p&gt;
&lt;p&gt;I did some digging in the SDK (V11), and I came across the RTT/UART logging (NRF_LOG) apis.  I switched over the code to use those APIs work great and I can log out the values I need.  Thus, in short I had a bad implementation, and doesn&amp;#39;t make sense to troubleshoot my original question anymore (Doah!).  Sorry for the errant post before doing my homework.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;P.S -
I implemented the NRF_LOG_USES_RAW_UART option, and nrf_log.c failed since it couldn&amp;#39;t find UART0_CONFIG_BAUDRATE macro.  I added &amp;quot;nrf_drv_uart.h&amp;quot; and everything works well now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timing Issue with app_uart_put()?</title><link>https://devzone.nordicsemi.com/thread/67724?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 22:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e837ac5-0339-478d-b758-f8384720b2ff</guid><dc:creator>Josh Grob</dc:creator><description>&lt;p&gt;As an update I think I am hitting a seg fault since the chip keeps resetting, and faulting at the same place each time.  The SIGTrap is a red herring I think since the debugger stops at the program entry point again on reset (I think).  When the firmware runs without gdb, I see the crashing and resetting behavior in a loop.  Now to find where the memory is getting corrupted...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>