<?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 trash value on Thingy91</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76232/uart-trash-value-on-thingy91</link><description>Hi Devzone, 
 I use Thingy91. On the nrf9160 side, I run mqtt_simple example; on the nrf52840, I run connectivity_bridge with BLE feature. 
 When I send &amp;quot;900&amp;quot; via nus service, what I receive on nrf9160 side are: 
 
 The reason is because of noise or software</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Jun 2021 07:59:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76232/uart-trash-value-on-thingy91" /><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/315292?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 07:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a53b584-50ba-4c6c-8b51-e6c5705d9c8d</guid><dc:creator>awneil</dc:creator><description>[quote userid="102563" url="~/f/nordic-q-a/76232/uart-trash-value-on-thingy91/315255#315255"] use strcat to add an individual character to a string (array buffer).[/quote]
&lt;p&gt;Again,&amp;nbsp;strcat is a standard C library function - so plenty of documentation on how to use it; eg,&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cplusplus.com/reference/cstring/strcat/"&gt;http://www.cplusplus.com/reference/cstring/strcat/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see, both of its parameters need to be C &lt;em&gt;&lt;strong&gt;strings&lt;/strong&gt;&lt;/em&gt; - so you can&amp;#39;t just use it to add an individual character without first making that character a string ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/315255?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 01:32:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e83a756b-55aa-4169-9687-84e34eb7c1a9</guid><dc:creator>Nahan_Trogn</dc:creator><description>&lt;p&gt;I use strcat to add an individual character to a string (array buffer). I can achieve this by assigning each character for each member in the array.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/315045?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 08:19:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:996408ad-6473-4ae2-825b-1e49b7a7aa45</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;strcat is a standard C library function - so plenty of documentation on how to use it; eg,&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cplusplus.com/reference/cstring/strcat/"&gt;http://www.cplusplus.com/reference/cstring/strcat/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Remember that C strings need a NUL termination - which you won&amp;#39;t get when reading direct from a UART ...&lt;/p&gt;
&lt;p&gt;Perhaps show what you were doing with strcat ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/315005?ContentTypeID=1</link><pubDate>Sat, 12 Jun 2021 15:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:457ab60c-518e-491f-8603-7254c5735c3b</guid><dc:creator>Nahan_Trogn</dc:creator><description>&lt;p&gt;Hi, the problem is came from&amp;nbsp;&lt;strong&gt;strcat&lt;/strong&gt; functi&lt;strong&gt;on.&amp;nbsp;&lt;/strong&gt;Thanks for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/315004?ContentTypeID=1</link><pubDate>Sat, 12 Jun 2021 15:30:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db0b6680-b9f3-4722-9886-2419ca3df3db</guid><dc:creator>Nahan_Trogn</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I found that the problem came from &lt;strong&gt;strcat&lt;/strong&gt; function. When when I assign each character (read from uart) to my array, the problem disappeared. Currently I don&amp;#39;t know how to use &lt;strong&gt;strcat&lt;/strong&gt; so that there is no garbage value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/314949?ContentTypeID=1</link><pubDate>Fri, 11 Jun 2021 14:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b134eec-95c1-42c3-a106-59b72b4dab31</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello!&lt;br /&gt;&lt;br /&gt;Thanks for reaching out. I agree with &lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt; here that you should make sure you know what&amp;#39;s being sent/recived, as it seems like there is a consistenty in the wrong data (i.e. it&amp;#39;s not junk, but something else). Could it be that some line breaks are transmitted with the message as well?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What sample is your application based on?&lt;br /&gt;&lt;br /&gt;I will test your code on Monday to see if I can reproduce this.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/314693?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 12:14:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9071b3f4-b71b-4e94-8963-979b00b019ef</guid><dc:creator>Nahan_Trogn</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First, I used nrf52840 to send uart data to PC to confirm it work well. After that, I sent it to nrf9160 on Thingy91 board and get junks as above.&lt;/p&gt;
&lt;p&gt;I use uart_fifo_read function to save character directly to my buffer. Where can I go deeper to get uart data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/314686?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 12:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60deb312-3960-4c70-a468-77c7c81cb36f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;have you got something using &amp;quot;wide&amp;quot; characters?&lt;/p&gt;
&lt;p&gt;have you used the debugger to trace what&amp;#39;s happening - from the stuff arriving at the UART to it ending up in your buffer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/314685?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 12:01:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cd673e8-60ef-4f87-addd-4fc0f4141fd7</guid><dc:creator>Nahan_Trogn</dc:creator><description>&lt;p&gt;Hi, I received exactly what I sent, in this case is &amp;quot;900&amp;quot;. But there is some junk between these characters.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve checked baudrate in zephyr.dts in build folder, the baudrate is the same on two side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART trash value on Thingy91</title><link>https://devzone.nordicsemi.com/thread/314678?ContentTypeID=1</link><pubDate>Thu, 10 Jun 2021 11:38:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad505df6-c555-4cf1-8778-029a15ae5499</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The usual reason for receiving junk on an async serial link is that the baud rate is wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>