<?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>tx_rx_non_blocking example sends extra byte of zeros (nRF5340)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100578/tx_rx_non_blocking-example-sends-extra-byte-of-zeros-nrf5340</link><description>I loaded the attached example on my board and I&amp;#39;m getting an extra byte of zeros sent: 
 
 Here is the code: 
 
 My TX and RX buffers show correct &amp;#39;U&amp;#39; characters getting sent and received: 
 
 And my call stack doesn&amp;#39;t show any weird values in registers</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Jun 2023 11:40:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100578/tx_rx_non_blocking-example-sends-extra-byte-of-zeros-nrf5340" /><item><title>RE: tx_rx_non_blocking example sends extra byte of zeros (nRF5340)</title><link>https://devzone.nordicsemi.com/thread/431230?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2023 11:40:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:affae185-974a-4d75-8b3e-d4b05d42e50a</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hi Brad,&lt;/p&gt;
&lt;p&gt;I am following up on this ticket while Raoul is on vacation.&lt;/p&gt;
&lt;p&gt;Does replacing line 60 with&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define MSG_TO_SEND {&amp;#39;U&amp;#39;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;work for you?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: tx_rx_non_blocking example sends extra byte of zeros (nRF5340)</title><link>https://devzone.nordicsemi.com/thread/430573?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 16:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:958ea425-9c5e-4097-877a-e6c8f16a9198</guid><dc:creator>rockerderek</dc:creator><description>&lt;p&gt;Hi Raoul,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t set it to a char due to the error in the attached picture. The path to this example code is:&lt;/p&gt;
&lt;p&gt;modules\hal\nordic\nrfx\samples\src\nrfx_uarte\tx_rx_non_blocking&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1686588924251v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: tx_rx_non_blocking example sends extra byte of zeros (nRF5340)</title><link>https://devzone.nordicsemi.com/thread/430486?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 12:28:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38fcfa64-5c34-46d3-ae5f-c71bacddddbc</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Brad,&lt;/p&gt;
&lt;p&gt;Could you try replacing &amp;quot;U&amp;quot; with &amp;#39;U&amp;#39; on line 68?&lt;/p&gt;
&lt;p&gt;I think the double quotes make &amp;quot;U&amp;quot; into a string literal, with an implicit /0 at the end. Single quotes would make it a char literal. I think this explanation is relevant: &lt;a href="https://stackoverflow.com/questions/31179386/difference-between-char-and-strings-in-c"&gt;https://stackoverflow.com/questions/31179386/difference-between-char-and-strings-in-c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I wanted to try this in your code, but for some reason I&amp;#39;m not able to build the project you uploaded.&lt;/p&gt;
[quote user="rockerderek"]Since this is the example code from the latest nRF Connect SDK[/quote]
&lt;p&gt;Where did you take this from? Just curious, since this is definitely no ordinary Zephyr setup.&lt;/p&gt;
&lt;p&gt;Let me know if the fix works!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: tx_rx_non_blocking example sends extra byte of zeros (nRF5340)</title><link>https://devzone.nordicsemi.com/thread/430328?ContentTypeID=1</link><pubDate>Sun, 11 Jun 2023 23:07:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9134f00-a154-477e-9aeb-9c404971cae9</guid><dc:creator>rockerderek</dc:creator><description>&lt;p&gt;Hi Raoul,&lt;/p&gt;
&lt;p&gt;Since this is the example code from the latest nRF Connect SDK, I&amp;#39;m not familiar with which part of the HAL is causing the string terminator. Could you take a look at what is causing the string terminator to be sent so I can remove it? Then the code will meet our needs.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brad&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: tx_rx_non_blocking example sends extra byte of zeros (nRF5340)</title><link>https://devzone.nordicsemi.com/thread/430071?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 19:05:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a608a216-f7dd-43bd-b401-9b0da892c24d</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Brad,&lt;/p&gt;
&lt;p&gt;If I&amp;#39;m not mistaken, the second transmission is simply the string terminator &lt;a href="https://en.wikipedia.org/wiki/C_string_handling"&gt;which in C is just NUL&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Instead of sending a single char, your code is sending a string that consist of &amp;quot;U&amp;quot; (0x55) and &lt;a href="https://stackoverflow.com/questions/4711449/what-does-the-symbol-0-mean-in-a-string-literal"&gt;then &amp;quot;\0&amp;quot;&lt;/a&gt; (0x00).&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have time today to dig into the code you&amp;#39;ve shared (although I appreciate you sharing it, it often makes things easier), but if you&amp;#39;re still stuck after this I&amp;#39;ll gladly take a look.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>