<?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>nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116079/nrf52840---uarte-dropping-7th-character</link><description>I&amp;#39;m essentially building a BLE to UART gateway to allow our microcontroller device to talk to our apps. The BLE section is the nRF52840 and I&amp;#39;m trying to simply use it to pass through the data from the UART (from the microcontroller) to the BLE using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Nov 2024 21:20:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116079/nrf52840---uarte-dropping-7th-character" /><item><title>RE: nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/thread/509327?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2024 21:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f33506ff-ea23-4557-b90e-b37f13c1d1ae</guid><dc:creator>DarkMeans</dc:creator><description>&lt;p&gt;Thank you for all of the help.&lt;/p&gt;
&lt;p&gt;In addition to the changes in the above post (marked as &amp;quot;verified answer&amp;quot; above), there was some additional logic inserted into the project was causing the system to disable the uart multiple times using uart_rx_disable().&amp;nbsp; For whatever reason, instead of crashing, the system just took it.&amp;nbsp; This happened to close and re-open at the time of the 7th character coming in.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/thread/509279?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2024 14:49:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c525faf-1cbe-4386-a7b2-d51c23068a3f</guid><dc:creator>DarkMeans</dc:creator><description>&lt;p&gt;I&amp;#39;ll have to turn on all of the logs and rerun some things later this morning.&amp;nbsp; We initially turned them all off thinking that the logs were part of what was causing the data to be lost.&lt;/p&gt;
&lt;p&gt;We are queueing up this data in the uart_cb, and the ble nus_send is happening in it&amp;#39;s own thread with a semaphore just waiting for data.&amp;nbsp; My question with the UART_RX_RDY queuing point was really looking to bounce the idea off, is that where you would trigger the ble send on your side doing the same type of data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/thread/509241?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2024 13:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f23941c-bb81-407a-a5cb-fd62fabfd6e7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that the &amp;quot;uart_cb&amp;quot; is running in interrupt context, and you should rather send data in a dedicated thread or&amp;nbsp;schedule the operation to the main-context. Queueing the data in uart_cb is fine, but you should not call a ble-related function directly from that function.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you share any logs from the sequence?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/thread/509182?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 23:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e311a1f5-4570-4801-9537-27f54b1f5cb6</guid><dc:creator>DarkMeans</dc:creator><description>&lt;p&gt;Alright, your changes helped quite a bit I think.&amp;nbsp; The first response now works as expected, but now all subsequent responses don&amp;#39;t, and when I let my Windows machine sit there and watches the announcements, when the system looks like this icon &lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1730845002169v2.png" alt=" " /&gt; which it has always looked like in the past.&amp;nbsp; With this icon, it responds properly.&amp;nbsp; After the first response, the icon changes to this heart thing &lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1730844949020v1.png" alt=" " /&gt; and it still drops the 7th byte.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When data comes I&amp;#39;m using uart_cb and UART_RX_RDY to queue up the data to send.&amp;nbsp; Is that the right way to do it?&amp;nbsp; Due to the nature of the data, JSON, I&amp;#39;m doing my best to queue up the entire message up until the timeout before releasing it to the NUS service.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/thread/509176?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 19:26:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9d81e11-fcc8-4c07-91a3-5b4d0f2da9df</guid><dc:creator>DarkMeans</dc:creator><description>&lt;p&gt;Thank you for your response.&amp;nbsp; I&amp;#39;m going to start investigating your changes.&lt;/p&gt;
&lt;p&gt;As you can see in the below snipped, the response always has the 7th character missing.&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/pastedimage1730832716694v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 - UARTE dropping 7th character</title><link>https://devzone.nordicsemi.com/thread/509149?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 15:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:799658c1-e174-4768-b7b2-1ed4a437617a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I understand your setup correctly, you have connected a host-controller to the nRF52840 via UART.&lt;/p&gt;
&lt;p&gt;Only the initial payload has a problem, is that correct?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I understand correctly, I believe that this line is the root-cause:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5.0/samples/bluetooth/peripheral_uart/src/main.c#L325"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.5.0/samples/bluetooth/peripheral_uart/src/main.c#L325&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Where the &amp;#39;50&amp;#39; should be changed to&amp;nbsp;UART_WAIT_FOR_RX, as done in this PR:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/commit/75304da581f92f35a7cec2c2039399e9569f43ab"&gt;https://github.com/nrfconnect/sdk-nrf/commit/75304da581f92f35a7cec2c2039399e9569f43ab&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>