<?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>Bug in app_uart in SDK 10</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10921/bug-in-app_uart-in-sdk-10</link><description>Hello,
I think there&amp;#39;s a bug in the app_uart library in SDK 10 that occurs when the FIFO is enabled. 
 Using SDK nRF51_SDK_10.0.0_dc26b5e, I was trying to write data to the UART as fast as possible in a loop with the baud rate set to 1M, to test the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Mar 2016 11:42:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10921/bug-in-app_uart-in-sdk-10" /><item><title>RE: Bug in app_uart in SDK 10</title><link>https://devzone.nordicsemi.com/thread/40833?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2016 11:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2cc9481-17c4-440d-a250-201090d27fa5</guid><dc:creator>Primož Kralj</dc:creator><description>&lt;p&gt;It is still causing HARDFAULTS sometimes, even with the new diff. My app hangs in &lt;code&gt;app_uart_put()&lt;/code&gt;: sometimes at &lt;code&gt;app_fifo_put()&lt;/code&gt;, sometimes at &lt;code&gt;nrf_drv_uart_tx()&lt;/code&gt; and other times it works :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in app_uart in SDK 10</title><link>https://devzone.nordicsemi.com/thread/40832?ContentTypeID=1</link><pubDate>Sun, 06 Mar 2016 14:27:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c9c228-f8a5-4e33-ae42-30792a79d4e2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This helped me in one scenario, Thanks Petter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in app_uart in SDK 10</title><link>https://devzone.nordicsemi.com/thread/40831?ContentTypeID=1</link><pubDate>Mon, 29 Feb 2016 13:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5de17ed-ff5e-46c0-aadf-590d67f11b78</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Sorry for the late reply.&lt;/p&gt;
&lt;p&gt;There is a bug.&lt;/p&gt;
&lt;p&gt;But it&amp;#39;s not the lack of checking if the FIFO is empty before calling nrf_drv_uart_tx.
nrf_drv_uart_tx will return NRF_ERROR_BUSY as long as there is something in the FIFO, since new bytes are fetched from the FIFO and passed to the driver in the interrupt handler.&lt;/p&gt;
&lt;p&gt;There is a race condition in app_uart_put. When nrf_drv_uart_tx returns NRF_ERROR_BUSY and the transmission finishes right after that but before the new byte is actually put into the FIFO, then this new byte will linger in the FIFO until app_uart_put is called again (non-empty FIFO won&amp;#39;t trigger a new transmission, nrf_drv_uart_tx must be called for this to happen). And the byte passed to this call is transmitted before this one from the FIFO, thus the order is incorrect. This can be observed when some delay is added in app_uart_put, right before app_fifo_put.&lt;/p&gt;
&lt;p&gt;This will be fixed in SDK 11 which will be released in the start of March.&lt;/p&gt;
&lt;p&gt;For SDK 11.0.0-2.alpha it is possible to replace nrf_drv_uart.c, nrf_drv_uart.h and app_uart_fifo.c with the files from this &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_uart_5F00_fifo_5F00_fix.zip"&gt;zip&lt;/a&gt;. &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_uart_5F00_fifo.diff"&gt;Here&lt;/a&gt; is also the diff with the changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in app_uart in SDK 10</title><link>https://devzone.nordicsemi.com/thread/40830?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2016 19:28:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1371e54-939f-4e42-80c3-2b70c1ba7f66</guid><dc:creator>Jordan Archer</dc:creator><description>&lt;p&gt;Any update?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug in app_uart in SDK 10</title><link>https://devzone.nordicsemi.com/thread/40829?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2015 15:04:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5eb07acd-2598-46f2-a27e-6b791fc53d9d</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Thank you for reporting this. We will look into it and update this when we have something.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>