<?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>Delay in 1st byte of sent UART message</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12261/delay-in-1st-byte-of-sent-uart-message</link><description>I am currently trying to communicate with a GPS module using the UART on an nRF51422 (using the Dynastream N548M5CB module). I am using SDK v9.0.0 and the FIFO version of the UART module, with only software flow control. 
 I am sending UART messages</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Mar 2016 03:26:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12261/delay-in-1st-byte-of-sent-uart-message" /><item><title>RE: Delay in 1st byte of sent UART message</title><link>https://devzone.nordicsemi.com/thread/46373?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 03:26:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d68c77a-68d9-4711-b223-a5734e4ae781</guid><dc:creator>Cindy Xiao</dc:creator><description>&lt;p&gt;Thanks for the reply, Martin. The device I&amp;#39;m using is also serving as a BLE client; the &lt;code&gt;gps_init&lt;/code&gt; function took place just before I initialized the BLE stack, called &lt;code&gt;device_manager_init&lt;/code&gt;, &lt;code&gt;db_discovery_init&lt;/code&gt;, and &lt;code&gt;scan_start&lt;/code&gt;. I think one of these had something to do with the byte being delayed.&lt;/p&gt;
&lt;p&gt;Here is my original code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
bool erase_bonds;

// Initialize.
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, NULL);

uart_init();
gps_init();
buttons_leds_init(&amp;amp;erase_bonds);

ble_stack_init();
device_manager_init(erase_bonds);
db_discovery_init();
bas_c_init();

scan_start();
for (;; )
{
    power_manage();
}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Moving the &lt;code&gt;uart_init&lt;/code&gt; and &lt;code&gt;gps_init&lt;/code&gt; to after all of the bluetooth initialization functions, as well as &lt;code&gt;scan_start&lt;/code&gt;, seemed to resolve my issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in 1st byte of sent UART message</title><link>https://devzone.nordicsemi.com/thread/46372?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 11:22:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40f385c0-a302-46dc-a4fb-eae8ebe48950</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I have tried this exact code and it seems to work fine on my system. I don&amp;#39;t use any flow control and I call uart_init() gps_init(); in main. That&amp;#39;s it. Are you doing anything else in your application? Could it be your software flow control?&lt;/p&gt;
&lt;p&gt;Logic trace:
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6170.Untitled.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>