<?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 APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113898/uart-app_uart_communication_error</link><description>Dear Sirs! 
 I used SDK 12.2. Product was developed some years ago and now I am working for upgrade. One of new features is UART. I faced very strange problem. 
 
 I send 14 bytes from PC via FTDI UART 3.3V cable to Nordic and Nordic send back different</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Aug 2024 08:30:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113898/uart-app_uart_communication_error" /><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498403?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 08:30:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20138a0f-b265-4351-b1e2-e5313e40ab24</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Thank you. Problem solved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498393?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 07:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebf85a44-1744-49cc-a090-bd1554d85c2a</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="PMichael"]It means that&amp;nbsp;&lt;span&gt;RXD.MAXCNT will be 1.&lt;/span&gt;[/quote]
&lt;p&gt;Yes, you are right. It is then using only one byte transfer.&lt;/p&gt;
[quote user="PMichael"]&lt;p&gt;&lt;span&gt;Assume that I use baud rate 115200 8 bit no parity (totally 10 bit). Does it mean that UART interrupt routine shall be evoked with delay less than about 85 us.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And in case that baud rate is 57600 maximum delay shall be about 170us?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;The interrupt service routine can take an addition 12 cycles of HFCLK apart from the 85us to clock out/in the data at baud 115200. Since you are using nrfx_ driver-&amp;gt;nrf_drv-&amp;gt;app_fifo-&amp;gt;app_uart-&amp;gt;your application callback handler for uart events, then the latency increases. I do not know this latency by heart but you can measure it by toggling a gpio in the first line of the ISR to the first line in your uart callback handler.&lt;/p&gt;
&lt;p&gt;Please ask any new questions in a new thread, this thread is starting to become a bit messy with many questions that do not match the title of the thread anymore.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498385?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 07:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e48bc10-05ea-406c-b6e1-f5363b806c26</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;I look at&amp;nbsp;app_uart_init code and see only&lt;/p&gt;
&lt;p&gt;return nrf_drv_uart_rx(&amp;amp;app_uart_inst, rx_buffer,1);&lt;/p&gt;
&lt;p&gt;It means that&amp;nbsp;&lt;span&gt;RXD.MAXCNT will be 1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is it correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If yes, additional question:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Assume that I use baud rate 115200 8 bit no parity (totally 10 bit). Does it mean that UART interrupt routine shall be evoked with delay less than about 85 us.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And in case that baud rate is 57600 maximum delay shall be about 170us?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498383?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 06:46:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56a891a9-585c-452d-bb7f-22d1bb5cf036</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;No, those buffers are the size of the fifo we choose in app_fifo module.&lt;/p&gt;
&lt;p&gt;The MAXCNT is set when you use&amp;nbsp;nrf_drv_uart_tx. The length argument in&amp;nbsp;&lt;span&gt;nrf_drv_uart_tx goes to the TXD.MAXCNT register. Same goes with&amp;nbsp;nrf_drv_uart_rx and RXD.MAXCNT register.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498381?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 06:20:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6bb473a-10cd-47fe-b301-ad919d29438e</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;As I wrote in first message I init UART&lt;/p&gt;
&lt;p&gt;buffers.rx_buf = rx_buf;&lt;br /&gt;buffers.rx_buf_size = 64;&lt;br /&gt;buffers.tx_buf = tx_buf;&lt;br /&gt;buffers.tx_buf_size = 64;&lt;/p&gt;
&lt;p&gt;err_code = app_uart_init(&amp;amp;comm_params, &amp;amp;buffers, uart_event_handle, APP_IRQ_PRIORITY_HIGHEST);&lt;/p&gt;
&lt;p&gt;Does it mean that&amp;nbsp;&lt;span&gt;RXD.MAXCNT register will be 64 or it is something different?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please elaborate.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498380?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 06:16:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af6f2fae-ba2f-4ab6-a840-8c96127b6911</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The RAM buffer can be of any variable size from 1-255 which can be configured in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuarte.html&amp;amp;cp=5_2_0_34_9_15&amp;amp;anchor=register.TXD.MAXCNT"&gt;TXD.MAXCNT&lt;/a&gt;&amp;nbsp;and RXD.MAXCNT register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498285?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 12:44:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f3f0754-ad70-4634-a132-7fcea45314a7</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;You wrote&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;quot;given size&amp;quot;. Can I control this size? Or it is constant number of bytes?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is it a RAM buffer that I define in&amp;nbsp;app_uart_buffers_t structure?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498266?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 12:02:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65d1cffd-5bc3-4b2a-b482-25095a1a5fdc</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The firmware FIFO you have is different than the hardware FIFO you have inside the UART&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:260px;max-width:474px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/948x520/__key/communityserver-discussions-components-files/4/pastedimage1723636618675v1.png" /&gt;&lt;/p&gt;
[quote user="PMichael"] is it correct, that DMA copy it to FIFO buffer immediately without processor?[/quote]
&lt;p&gt;Yes, EasyDMA will copy from the internal buffer to the RAM buffer of given size for one transaction. After this one transaction the CPU gets an interrupt and need to process the received bytes in RAM that the easydma already transferred. Reconfigure the easydma RXD.PTR register and get ready for more data to be received. But if the interrupt handler or the callback inside the application that the interrupt service routine calls take too long time, then there is a risk of buffer overflow. That is the exact reason why you have flow control.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you understand the implications of what happens if you disable flow control on UART?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498212?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 08:22:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e60ef749-7365-40b1-ab1e-ef6d3940882d</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Please answer my question. I have FIFO 64 bytes. When byte arrive to RX register, is it correct, that DMA copy it to FIFO buffer immediately without processor? Or despite of easy DMA processor shall call interrupt routine?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498210?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 08:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17c421fc-625a-4dff-9a85-f0abecd45098</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;In the other thread you asked,&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;Is it really&amp;nbsp;Overrun error&lt;br /&gt;A start bit is received while the previous data still lies in RXD?&lt;/p&gt;
&lt;p&gt;Does it mean that EASY DMA does not work, and interrupt is too slow to read data to FIFO?&lt;/p&gt;[/quote]
&lt;p&gt;The EasyDMA does work correctly and has nothing to do with this error. The overrun error is caused because the peer is transmitting data even after the RXD buffer is full in your nRF device and since you have disabled flowcontrol, there is no way to communicate this with the peer.&lt;/p&gt;
&lt;p&gt;This issue is happening because you have disabled flow control and using high baudrate. Do not focus your energy assuming that this is a hardware issue. Just reconfigure your firmware to enable flow control and/or reduce the baudrate and you will not see this error. The overrun error is working proper and this is how the UART works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498208?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 08:13:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ff4c526-98a8-41bd-b6a0-99ff573c599e</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;ok. Can you please answer about easy DMA. If I use easy DMA is it corrent that it transfer data to FIFO automatically without processor? If yes, why still this problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498204?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 08:10:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92b69b17-6eae-4f2c-b64c-f3bc51c36129</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Not sure why you opened a private ticket with the same query? This thread will look abandoned if we proceed in the private ticket. Let us continue here and please close the other private ticket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498201?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 08:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dc1d168-27e1-49ce-b4ee-348053f936e3</guid><dc:creator>PMichael</dc:creator><description>&lt;ul class="attribute-list"&gt;
&lt;li class="attribute-item date"&gt;&lt;span class="attribute-value"&gt;Case ID: 331565&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498200?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 08:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d91fb934-b58b-4a5c-a1f8-375ad04ea688</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;But I use EasyDMA. and FIFO 64 bytes. As I understand EasyDMA shall transfer data to FIFO without processor&amp;#39;s interrupt routine? Is it correct? Please look at code that I have sent in my first message. I also opened private ticket for this. Please go to private ticket&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498175?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2024 07:00:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208cf469-f2ef-4fc1-8e63-10252139fb72</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This is not a hardware issue, as mentioned in the product specification for ERRORSRC register&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:197px;max-width:741px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1482x394/__key/communityserver-discussions-components-files/4/pastedimage1723618663954v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;This is an overrun error which means that the peer is sending data faster than your device can pull from the RXD FIFO. This normally happens when you do not use flow control as there is no way to tell the peer to slow down or pause to avoid RXD FIFO error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Either enable flow control or reduce the baudrate on both side to avoid this error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you cannot do both, then you need to optimize your application that the UART RXD post processing is much faster in pulling the RXD data when UART receives any data. This can be done by optimizing your callback handler for uart when new data is received.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498138?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 22:17:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c988615-cc73-45e7-9fc1-b3d7ad810019</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;You can see it here. nRF52832&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498137?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 22:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:283d84b0-d405-48cd-b036-f5a03d431be6</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;It seems like a hardware issue. &amp;nbsp;Which Nordic chip ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498126?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 17:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee8f48ad-3bc3-4835-813b-fd477a1d53da</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Yes. The value of this register&amp;nbsp;&lt;span&gt;ERRORSRC&lt;/span&gt; is 1. All this written in first message&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART APP_UART_COMMUNICATION_ERROR</title><link>https://devzone.nordicsemi.com/thread/498125?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 17:46:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35025579-f801-4c1c-875f-12a12309bb64</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]As I understood this value is the same as in register&amp;nbsp;ERRORSRC. Is it correct?[/quote]
&lt;p&gt;The ERRSRC is inside the&amp;nbsp;&lt;span&gt;p_event&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;error_communication in the uart_event_handle. If you can get this value, then we can try to understand what happened and then try to get a debugging direction after that.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>