<?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>libUARTe sending TX buffer twice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69015/libuarte-sending-tx-buffer-twice</link><description>I&amp;#39;m having an odd issue with libUARTe sending a TX buffer twice. 
 I have a custom board using an nRF52832 running an application based on SDK 15.3.0. The libUARTe code was backported from SDK 16.0.0. It&amp;#39;s using libUARTe to communicate data with an STM32</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Feb 2021 15:37:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69015/libuarte-sending-tx-buffer-twice" /><item><title>RE: libUARTe sending TX buffer twice</title><link>https://devzone.nordicsemi.com/thread/293604?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 15:37:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c123e550-0e7c-447f-8619-230af5467d26</guid><dc:creator>Jeff</dc:creator><description>&lt;p&gt;Yes we did find it.&lt;/p&gt;
&lt;p&gt;It wasn&amp;#39;t an issue with libUARTE, rather an error in our code.&amp;nbsp;&amp;nbsp;It turned out to be a race condition due to setting a&amp;nbsp;flag indicating that the port was in use after the transmission started rather than before.&amp;nbsp; That allowed two transmissions to start at nearly the same time with the second overwriting the first&amp;#39;s buffer.&lt;/p&gt;
&lt;p&gt;We ended up needed to enable CLI and flash logging to debug this since it was only happening for us after a DFU without a debug board attached.&lt;/p&gt;
&lt;p&gt;Getting flash logging to work with a DFU was a bit challenging too since we needed to protect the flash log area from being erased during the DFU.&amp;nbsp; That involved setting&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE in the bootloader to account for the pages reserved in the app with&amp;nbsp;FDS_VIRTUAL_PAGES_RESERVED, NRF_LOG_BACKEND_FLASH_START_PAGE and&amp;nbsp;NRF_LOG_BACKEND_PAGES.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libUARTe sending TX buffer twice</title><link>https://devzone.nordicsemi.com/thread/293592?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 14:54:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2de0b8ad-bd22-4bc4-a2e4-e81c848b2d90</guid><dc:creator>Stetina</dc:creator><description>&lt;p&gt;Hello, Did you managed to solve that issue? I see similar behavior and I&amp;#39;m not able to debug it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libUARTe sending TX buffer twice</title><link>https://devzone.nordicsemi.com/thread/283260?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 08:54:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c6e9c96-622a-45c9-b757-b3b3cbb4b0a1</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]I see the normal data getting transmitted and then about 7 ms later the cleared buffer is being transmitted.&amp;nbsp; Normal operation would be to see a packet getting sent to the STM32 about every 120 ms.[/quote]
&lt;p&gt;&amp;nbsp;This sounds like a software bug inside app or library which can be&amp;nbsp;time critical behavior.&lt;/p&gt;
&lt;p&gt;Very hard to tell what is the issue here without seeing your usage of the libuarte and also how you handle the RX and TX events.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>