<?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>sending UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14077/sending-uart</link><description>Hi. I&amp;#39;m using PCA10028, SDK10.0.0, S130. 
 I want to go to nrf_drv_uart_uninit(); right after sending data.
in order to save current consumption. 
 So I made source code as below. 
 uart_start_sending=1;
for(int i=0;i&amp;lt;datalen;i++) app_uart_put(ptrData</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 May 2016 00:59:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14077/sending-uart" /><item><title>RE: sending UART</title><link>https://devzone.nordicsemi.com/thread/53822?ContentTypeID=1</link><pubDate>Thu, 26 May 2016 00:59:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d4acd5d-a800-4711-8886-c6170045e63c</guid><dc:creator>roger.k</dc:creator><description>&lt;p&gt;Thanks. It works well now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending UART</title><link>https://devzone.nordicsemi.com/thread/53821?ContentTypeID=1</link><pubDate>Wed, 25 May 2016 15:26:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55697787-e26f-4735-bd3a-ce8e48811b08</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Seems like this is a bug in the SDK. If you look at &lt;code&gt;uart_event_handler()&lt;/code&gt; in &lt;strong&gt;app_uart_fifo.c&lt;/strong&gt;, you can see that when it gets the &lt;code&gt;NRF_DRV_UART_EVT_TX_DONE&lt;/code&gt; event, it will transfer one byte from the FIFO and send it using &lt;code&gt;nrf_drv_uart_tx()&lt;/code&gt;. If this is the last byte in the FIFO then the FIFO will be empty. Then on the next line it checks if the FIFO is empty and then issue the &lt;code&gt;APP_UART_TX_EMPTY&lt;/code&gt; event, before the last byte has been sent.&lt;/p&gt;
&lt;p&gt;IMO the two IF statements should have switched places like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;else if (p_event-&amp;gt;type == NRF_DRV_UART_EVT_TX_DONE)
{
    if (FIFO_LENGTH(m_tx_fifo) == 0)
    {
        // Last byte from FIFO transmitted, notify the application.
        // Notify that new data is available if this was first byte put in the buffer.
        app_uart_event.evt_type = APP_UART_TX_EMPTY;
        m_event_handler(&amp;amp;app_uart_event);
    }
    // Get next byte from FIFO.
    if (app_fifo_get(&amp;amp;m_tx_fifo, tx_buffer) == NRF_SUCCESS)
    {
        (void)nrf_drv_uart_tx(tx_buffer,1);
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I tried with the above code and it transmitted all bytes. I will report this internally as a bug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>