<?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>UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92343/uart-package-length-problems-nrf-vs-code-sdk2-0-0</link><description>Hi everyone, 
 at the moment we are trying to upgrade our nRF9160 software form the SDK v1.8.0 to the newer version SDK2.0.0. The main issue of the migration is our UART implementation. In the last version the UART implementation worked like a charm and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Oct 2022 11:11:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92343/uart-package-length-problems-nrf-vs-code-sdk2-0-0" /><item><title>RE: UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/thread/389379?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2022 11:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8128570-a0f0-467d-851c-79d2f419a922</guid><dc:creator>AscherA</dc:creator><description>&lt;p&gt;Hi Susheel Nuguru&lt;/p&gt;
&lt;p&gt;I am sorry for the late reply.&amp;nbsp;We managed to fix the problems by adding a new command detection in the UART_RX_RDY event structure. In the end the downgrade of the baudrate already fixed most of the major problems and since all of our commands end with &amp;quot;}\r\n&amp;quot; we where able to successfully detect our commands with a strstr string search at a certain command length or if the length stays at 1 and no other event can be detected.&lt;/p&gt;
&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/thread/388517?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 10:12:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a317ac0-43a1-4f5a-b588-b6c65b9afe20</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="AscherA"]but the other 30% of the time the UART_RX_RDY event reports that it has only received 1 byte, but actually the whole message was already received and is present in the &lt;br /&gt;&amp;quot;evt-&amp;gt;data.rx.buf&amp;quot;.[/quote]
&lt;p&gt;Hmm, interesting, Do you think that the UART driver is only reporting UART_RX_RDY event with 1 byte size buffer and not reporting UART_RX_RDY event for the other bytes?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;or&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible that the UART driver is using the same buffer for received data to generate future event aswell and your application is just sniffing the&amp;nbsp;&lt;span&gt;evt-&amp;gt;data.rx.buf a bit early to know that the meaninful data is already there?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/thread/388510?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 09:41:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea5058ef-2162-4572-9522-f52fb2f44e55</guid><dc:creator>AscherA</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;the change in baudrate from 115200 to 9600 solved the problem with the missing bytes of the certificates. Thanks seems your theory was right.&lt;/p&gt;
&lt;p&gt;Unfortunately another problem has been created with the change. 60% of the time the receiving works fine. The only difference is that now each byte is recognized via the UART_RX_RDY event and the command is assembled byte by byte.&lt;/p&gt;
&lt;p&gt;This in its own is no problem, but the other 30% of the time the UART_RX_RDY event reports that it has only received 1 byte, but actually the whole message was already received and is present in the &lt;br /&gt;&amp;quot;evt-&amp;gt;data.rx.buf&amp;quot;.&lt;/p&gt;
&lt;p&gt;I tried to go down again with the baudrate, but this also did not solve this problem. DO you have any suggestions on how to takle this particular problem?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/thread/388224?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 19:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a8f04b-c8f3-4c7b-b2b1-b0f48cb4defb</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Andreas, as you may already know, sometimes it is not just enough to have a large buffer size in the application buffers. The bottle necks could be&amp;nbsp; post processing of the received data that might be slower than the speed with which the data is coming into RX buffers.&lt;/p&gt;
&lt;p&gt;One easy way to test if this is the case is to decrease the uart speed (baudrate) on both ends and see if you the do not miss any data. If you do not miss any data on slower baudrate, then we can confirm our theory.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/thread/388105?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 11:09:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f028240b-2fb0-414f-9ad4-73c9158c636b</guid><dc:creator>AscherA</dc:creator><description>&lt;p&gt;Hi Susheel Nugru,&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;br /&gt;Yes you are right we are not using hardware flow control. Due to pin restrictions we probably also will not be able to implement hardware flow control in our normal application.&amp;nbsp;Our UART Configuration looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;# Uart Config
CONFIG_SERIAL=y
CONFIG_NRFX_UARTE0=y
CONFIG_UART_ASYNC_API=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will implement the hardware flow control in a new test application to verify if this&amp;nbsp;would solve our problem. The variable &amp;quot;BUF_SIZE&amp;quot; in&amp;nbsp;our UART communication&amp;nbsp;has a value of 4096.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART package length problems nRF VS Code SDK2.0.0</title><link>https://devzone.nordicsemi.com/thread/388091?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 10:20:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:353f1f55-35e2-4462-8d30-094c42c010db</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]For example a certificate command is 1736 bytes long and the received length is 1721.[/quote]
&lt;p&gt;Can you show me how your application is configuring the UART? Is it using hardware flow control? This kind of symptoms seems very likely when there is no hardware flow control and when the receive buffers overflow, the application most likely does not have a handshake mechanism to ask the peer to resend the overflowed bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>