<?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>nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43677/nrf_serial_read-stops-receiving-data-after-some-time</link><description>Hi, 
 I am using nrf52840 dk. Also, I am using nrf_serial library with DMA mode for uart communication. I have a continuous loop running in main and there i read data using nrf_serial_read() with timeout set to 0. I have to read continuous polling message</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Feb 2019 05:44:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43677/nrf_serial_read-stops-receiving-data-after-some-time" /><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171789?ContentTypeID=1</link><pubDate>Tue, 19 Feb 2019 05:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caf43366-aa9b-400b-885f-f74e9993a1bb</guid><dc:creator>Prerit</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have read ERRORSRC on each nrf_drv_uart_evt_error and it reads out 4 (framing error). Also, what I found is, on read event (NRF_DRV_UART_EVT_RX_DONE) the uart_event_handler in nrf_serial.c reads data and puts it in queue and then generates serial rx event (NRF_SERIAL_EVENT_RX_DATA). So this already is a kind of polling. Moreover, I am pretty sure my data is not going to overflow this queue before i read it continuously in main(). So I guess directly using nrf_serial_rx in main() will make it more efficient and decrease some complexity for me.&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Prerit Choksi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171675?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 14:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96ff5114-5fce-4cd7-a7dd-91f3c9226e0d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I would recommend reading your data from an event handler, as using rx_read in your main() is ineffective. Also, what is your ERRORSRC register value? I am having trouble understanding what is wrong here as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171537?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 06:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73f0f98a-aba1-4931-b438-2dfbaff39b3c</guid><dc:creator>Prerit</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The framing error is encountered only when I read uart data continuously in main loop. In another sample code created using serial example, reading uart data in event handler, this error is not encountered for same rx data.&amp;nbsp; All other things are same. In serial example, I have just removed the while loop and read data in event handler. Moreover due to framing error, on nrf_serial_drv_err event i need to re initialize serial ( uart) and the error is quite frequent so it causes a high percentage of packet loss. All other configurations are same, also the setup is same. What could be the possible reason for this? Also, is there an alternative to handle this error?&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Prerit Choksi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171392?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 13:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0995bc10-078e-4514-9666-d6276f156279</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad to hear you got it working! Framing errors usually occur when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Baud rates are mismatched&lt;/li&gt;
&lt;li&gt;A serial line is very long&lt;/li&gt;
&lt;li&gt;When there is a lot of electrical noise on the serial cable&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;They can also occur if there is no serial ground connection between the two connected serial devices, or if the connection is intermittent/has a high impedance because of poorly connected ends. You can try to use a &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer"&gt;sniffer &lt;/a&gt;to watch your data during transmission.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171373?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 12:21:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28460ebf-3933-4e67-b963-726f519fbeed</guid><dc:creator>Prerit</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I figured out something here. On receiving NRF_SERIAL_EVENT_DRV_ERR the reception stops. I had read somewhere on devzone that on error event the rx stops so I had uninitialized and initialized serial already but uninit returns busy sometimes so the serial doesn&amp;#39;t gets restarted and data rx stops. So, i just commented out the trylock for read and write in nrf_serial_uninit and it works fine. I just need to be sure if it&amp;#39;s ok? After this the reception works properly, but the error event is encountered many times. On checking error mask i found it to be frame error. So, is there a way to decrease the frequency of this error? I also checked that both communicating devices have same baudrate and no parity.&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Prerit Choksi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171290?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 07:56:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd289bdb-f635-428e-ab18-dca9612f8688</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This seems strange. What exact changes have you made to the example? And can you describe how I can test this here on my end? It is usually easier to get to the bottom of this kind of issues if I am able to recreate the problem myself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171133?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 12:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:712dd219-141a-40d7-ac21-38583c808829</guid><dc:creator>Prerit</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the response. I am using sdk v15.2.0. Time until data is received is random (it stops within a minute). I have used serial example. Moreover, hwfc is off and I transmit data after each complete packet receive. Also, I checked the data length put into queue in uart_event_handler and data read count in nrf_serial_read and both are found to be same. I have used event handler (passed to serial config) to identify if data is transmitted completely.&amp;nbsp; I have kept fifo size pretty large( i tried with 32, 256, 5000) and buff size 1 (passed to serial config in NRF_SERIAL_CONFIG_DEF) so i guess there&amp;#39;s no probelm of buffer getting full.&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Prerit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_read() stops receiving data after some time.</title><link>https://devzone.nordicsemi.com/thread/171057?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 09:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:859e27f6-f930-4d03-92d1-d1fe4d24eb6d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This issue can be caused by multiple reasons, and it is hard to tell what by this information. Your buffer might be full, which causes it to stop, or there is a timer somewhere in your application that stops the read function after a while. So I have a few questions for you, to help me narrow down the issue. What SDK are you using? Is your code one of our example projects, or based on one? How long do you receive data for? (If it is for 180 seconds, there is probably a timer somewhere going off, as most of the timers in our default code stops there.)&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>