<?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 splitting buffer data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101937/libuarte-splitting-buffer-data</link><description>Hello, 
 I&amp;#39;m using the libuarte module to receive and send data. In the NRF_LIBUARTE_ASYNC_EVT_RX_DATA, when the buffer is full, it sends two events with the data split. I know this is by design, but how can I change the code to not allow this to happen</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 May 2024 09:05:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101937/libuarte-splitting-buffer-data" /><item><title>RE: Libuarte splitting buffer data</title><link>https://devzone.nordicsemi.com/thread/482973?ContentTypeID=1</link><pubDate>Mon, 13 May 2024 09:05:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bb661c7-d7ed-446c-bb84-c98f8b2a4ce3</guid><dc:creator>SheepWool</dc:creator><description>&lt;p&gt;Thanks Jerome. Some more digging here &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/83837/libuarte-rx-buffer-full-event/349008"&gt;RE: LIBUARTE RX Buffer Full event&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;also found the similar solution. Thank god for these forums!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Libuarte splitting buffer data</title><link>https://devzone.nordicsemi.com/thread/482964?ContentTypeID=1</link><pubDate>Mon, 13 May 2024 08:34:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c95713c-1042-4c03-bd93-158e70235a01</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;Yea, it was such a pain when I had to deal with it.&amp;nbsp;My way of dealing with it was to check if the libuarte buffer was full using the sub_rx_count, if so, check if I received my full packet by looking the start and end header. If the libuarte buffer was not full (so the data isn&amp;#39;t split), check if I&amp;#39;ve received a full packet.&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t really, remember all the details, but maybe to code snippet below will help (edited to remove sensitive information).&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if (p_libuarte-&amp;gt;p_ctrl_blk-&amp;gt;sub_rx_count == 0) { // LIBUARTE buffer is full
        // Start filling app buffer.
        memcpy(app_buffer, p_evt-&amp;gt;data.rxtx.p_data, app_length);
        // Index to add more data to.
        app_buffer_idx = app_length;

        // Check if full packet
        if ( I received a full packet process it) {
            // Full packet so go to processing
            NRF_LOG_INFO(&amp;quot;Full packet so head to processing&amp;quot;);
            // Reset the last index.
            app_buffer_idx = 0;
        } else { 
            // Not a full packet so wait until a full packet.
            return;
        }
    } else { // Buffer not full but ready to process data
        // Copy data to the work buffer starting from last index.
        memcpy(app_buffer + app_buffer_idx, p_evt-&amp;gt;data.rxtx.p_data, app_length);

        app_length += app_buffer_idx; // Add on the extra length of partially full buffer.

        NRF_LOG_INFO(&amp;quot;Printing full buffer:&amp;quot;);
        NRF_LOG_HEXDUMP_INFO(app_buffer, app_length);

        // Reset the last index.
        app_buffer_idx = 0;
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Libuarte splitting buffer data</title><link>https://devzone.nordicsemi.com/thread/482958?ContentTypeID=1</link><pubDate>Mon, 13 May 2024 08:18:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4573a391-cd71-4429-ae60-ef0d2a1c91d5</guid><dc:creator>SheepWool</dc:creator><description>&lt;p&gt;This is also causing problems for me as the uart messages are being split and extra code has to be written to join them together. This is a right pain in the ars# for us because we need to act on specific message headers which come in asynchonously. It would be way easier if a ring buffer was used by Libuarte and a event was not generated just because it is at the end of its buffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Libuarte splitting buffer data</title><link>https://devzone.nordicsemi.com/thread/437406?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 08:22:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90e580ec-a2d5-4980-9eb9-c47e251d5fbd</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;It&amp;#39;s causing problems as I expect a full packet at a time, which gets processed later. I&amp;#39;ve fixed the issue, by putting the data into a buffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Libuarte splitting buffer data</title><link>https://devzone.nordicsemi.com/thread/437265?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2023 13:18:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cad6a76-675a-47b2-8fc2-b250c4eeb280</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Is there any way to either modify the libraries to either only use one buffer, reset the rx index (and any other variables) after every transmission, or to use implement a buffer of some kind to store both parts of the data? I[/quote]
&lt;p&gt;I don&amp;#39;t think this is possible without redesigning the the module considerably.&amp;nbsp;&lt;/p&gt;
[quote user=""], it will get the first part of the data (store into a buffer), and then in the next event, the second part will come. However, even with this implementation, it&amp;#39;s causing problems.[/quote]
&lt;p&gt;How is this not working, is it due to the latency of waiting for the second buffer to be filled?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>