<?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>Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60993/bit-loss-on-nrf52840-uarte-at-115-200</link><description>Summary 
 I am using UARTE on NRF52840 at 115,200 but am experiencing &amp;quot;bit loss&amp;quot;, i.e. the UARTE is losing a few bits in the incoming stream causing corruption of all incoming characters from that point onwards. I am setting the baud rate correctly, using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 May 2020 17:00:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60993/bit-loss-on-nrf52840-uarte-at-115-200" /><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247995?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 17:00:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c86c627-256c-4a9f-96bc-f356cb4755b4</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;Ooo, good&amp;nbsp;spot, I was calling&amp;nbsp;&lt;strong&gt;nrf_drv_clock_init()&lt;/strong&gt;&amp;nbsp;but wasn&amp;#39;t asking for the HF clock, I had missed that entirely.&amp;nbsp;&amp;nbsp;Starting the HF clock definitely seems to have improved things, though now I&amp;#39;m seeing the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/60808/uarte-dropping-received-characters-115-200"&gt;single character loss&lt;/a&gt;&amp;nbsp;issue again, which I guess was being masked by this.&lt;/p&gt;
&lt;p&gt;Still, many thanks for your insight, closing this call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247987?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 16:21:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab56bc3c-c2e3-432d-ad8b-6403e3137f52</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;One more thing to check - did you start HFCLK?&amp;nbsp; As nRF52840 spec says,&lt;em&gt;&amp;nbsp;&amp;#39;External crystal oscillator must be enabled to obtain sufficient clock accuracy for stable communication.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247983?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 16:05:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0daa2a9a-9ac7-4811-b93e-2c08a21d756a</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;FYI, I have measured the received character rate as seen by the Saleae logic probe and I&amp;#39;m receiving 10 characters (i.e. each consisting of one start bit, eight data bits and one stop bit) in 0.869 ms, so I make that a rate of 115,074 or just 0.1% error.&amp;nbsp; So I don&amp;#39;t believe the far end is at fault, there must be something wrong at my NRF52840 end.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247979?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 15:44:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fab1e792-93d3-4dff-a819-8f6be96347a4</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Oh - I see.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247972?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 15:29:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4434b628-60ef-412f-9427-b4b404001c28</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;I think the problem is that the AT modem is now expecting 2 stop bits (i.e. the setting is bidirectional), which it is not getting unless the NRF52840 UART is set up the same way.&lt;br /&gt;&lt;br /&gt;Thanks for the suggestion though, it was a good idea to check.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247963?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 15:19:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89426b59-0ebf-40f9-9139-500608a25e3c</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;I was suggesting it as a test rather than a solution.&lt;/p&gt;
&lt;p&gt;Adding extra stop bits at the sender should not require any change in the receiver - a Stop bit is indistinguishable from line idle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247957?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 15:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e67bfe2-387d-49c1-8729-1c0389feb37a</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;Unfortunately this is multi-platform code intended to work with multiple chipsets (i.e. other than NRF52840) and multiple AT modems so the answer is &amp;quot;not without a lot of pain&amp;quot;.&lt;br /&gt;&lt;br /&gt;In this particular instance I can hack the AT modem by sending it an AT command to switch it into sending 2 stop bits but that stops everything working unless I also set 2 stop bits on the NRF52840 side and, curiously, the NRF API omits the ability to do that (&lt;strong&gt;nrf_uarte_configure()&lt;/strong&gt; doesn&amp;#39;t include a &amp;quot;number of stop bits&amp;quot; parameter).&amp;nbsp; If I hack that as well by writing to the register directly then of course it doesn&amp;#39;t work to begin with because the AT modem doesn&amp;#39;t initially send two stop bits it has to be &lt;em&gt;told&lt;/em&gt; to do so via an AT command, etc...&lt;br /&gt;&lt;br /&gt;So&amp;nbsp;it would be a last resort as I would have to&amp;nbsp;introduce platform dependencies up in the generic AT driver code.&lt;br /&gt;&lt;br /&gt;Running a pair of UARTs talking to each other at 115,200 shouldn&amp;#39;t be much of a strain on the system: is there anything&amp;nbsp;I might configure on the NRF52840 side to improve matters?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247939?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 14:44:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f97c4836-ef5e-4350-a450-f7bc2549a92b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;can you get the sender to add an extra Stop bit? or an inter-character delay ... ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247937?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 14:40:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e5c9a8-7571-46d0-91fa-1e87da2efa7c</guid><dc:creator>RobMeades</dc:creator><description>&lt;p&gt;An excellent question, I should have thought to check that.&lt;br /&gt;&lt;br /&gt;Dumping the return value &lt;span&gt;of&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;strong&gt;nrf_uarte_errorsrc_get_and_clear()&lt;/strong&gt;&amp;nbsp;in the&amp;nbsp;&lt;strong&gt;NRF_UARTE_EVENT_ERROR&lt;/strong&gt;&amp;nbsp;part of the interrupt into an array and printing the values out afterwards, when there is no problem I get no error events and when the problem occurs I get alternating framing errors/breaks followed by lots of framing errors, something like this:&lt;/p&gt;
&lt;p&gt;framing error&lt;br /&gt;framing error&lt;br /&gt;break&lt;br /&gt;framing error&lt;br /&gt;break&lt;br /&gt;framing error several 10s of times&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bit loss on NRF52840 UARTE at 115,200</title><link>https://devzone.nordicsemi.com/thread/247911?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 14:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0018afb2-07a9-41d3-89fc-3cd203b5561b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Are you getting framing errors reported by the UART ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>