<?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>Lpuart on the 5340 using interrupt mode fails to recover from a TX timeout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104794/lpuart-on-the-5340-using-interrupt-mode-fails-to-recover-from-a-tx-timeout</link><description>I am using the lpuart between an nRF5340DK and an nRF9160DK.The lpuart is configured to operate in interrupt mode. Everything seems to work fine as long both DK boards come up at the same time. However, if the nRF9160DK takes a while to come up and the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Oct 2023 20:33:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104794/lpuart-on-the-5340-using-interrupt-mode-fails-to-recover-from-a-tx-timeout" /><item><title>RE: Lpuart on the 5340 using interrupt mode fails to recover from a TX timeout</title><link>https://devzone.nordicsemi.com/thread/451141?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 20:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b960ae05-0697-4375-962a-5272c20db3d6</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;The logic analyzer trace helped, there is no need to perform test with pull-up or longer timeout based on this trace.&lt;/p&gt;
&lt;p&gt;I have been reading how the&amp;nbsp;actual flow control is occuring in the lpuart driver:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/nrf/drivers/uart_nrf_sw_lpuart.html#control-protocol"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/nrf/drivers/uart_nrf_sw_lpuart.html#control-protocol&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suspect the root problem in this case is that the nRF9160 lpuart driver&amp;nbsp;rely on receiving a rising edge on the RDY line (this is handled by the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/gpiote.html"&gt;gpiote hardware peripheral&lt;/a&gt;), however if the nRF9160 power up after the RDY line went high,&amp;nbsp;the nRF9160&amp;nbsp;don&amp;#39;t get the rising edge on RDY line and you end up with a timeout on the transmitter. Unfortunately it seems that the transmitter is not able to gracefully recover from this situation, your workaround by simply reset the .txlen to workaround this issue seems like a good approach if you ask me, though a longer term workaround could be that the lpuart driver&amp;nbsp;could check if the RDY line was already high on startup and based on that not wait for the rising edge on RDY line (though I have not looked into how that could be implemented, at the moment all rely on that rising edge in the first place).&lt;/p&gt;
&lt;p&gt;I think the best I can do at the moment is to report it internally so some of the developers can look into making an appropriate fix for this in future.&lt;/p&gt;
[quote userid="88759" url="~/f/nordic-q-a/104794/lpuart-on-the-5340-using-interrupt-mode-fails-to-recover-from-a-tx-timeout/451132"]Is there a way to pull an SDK driver file into my local source, use that file rather than the one in the SDK? This way I can make the modification needed where it can be tracked.[/quote]
&lt;p&gt;Check out:&lt;/p&gt;
&lt;div&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/zephyr/samples/application_development/out_of_tree_driver/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/zephyr/samples/application_development/out_of_tree_driver/README.html&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Kenneth&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lpuart on the 5340 using interrupt mode fails to recover from a TX timeout</title><link>https://devzone.nordicsemi.com/thread/451132?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 19:01:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45ee6ff1-3aae-44bd-9bee-b5a97a0c703c</guid><dc:creator>kseegmiller</dc:creator><description>&lt;p&gt;Is there a way to pull an SDK driver file into my local source, use that file rather than the one in the SDK? This way I can make the modification needed where it can be tracked.&lt;/p&gt;
&lt;p&gt;--Kyle&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lpuart on the 5340 using interrupt mode fails to recover from a TX timeout</title><link>https://devzone.nordicsemi.com/thread/451130?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 18:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1470f1cb-8768-4d19-8663-bcc185fe7103</guid><dc:creator>kseegmiller</dc:creator><description>&lt;p&gt;I have not considered an external pull up on the control lines as it doesn&amp;#39;t seem to be the root of the issue. If you have additional data that would support using pull ups I would like to see it. Also, increasing the timeout will only kick the can down the road in my opinion and would not be a viable solution for this device. I have attached some traces for you to look at. One with the uart_nrf_sw_lpuart.c unmodified and the other with the modification of adding support for the UART_TX_ABORTED event in the&amp;nbsp;int_driven_evt_handler(). The only thing the UART_TX_ABORED&amp;nbsp; code does is to set the txLen to zero.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	case UART_TX_ABORTED:
		LOG_DBG(&amp;quot;tx aborted&amp;quot;);
		data-&amp;gt;int_driven.txlen = 0;
		call_handler = true;
		break;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Failure_2D00_with_2D00_lpuart_2D00_mod.sal"&gt;devzone.nordicsemi.com/.../Failure_2D00_with_2D00_lpuart_2D00_mod.sal&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Lpuart_2D00_tx_2D00_timeout_2D00_no_2D00_recover.sal"&gt;devzone.nordicsemi.com/.../Lpuart_2D00_tx_2D00_timeout_2D00_no_2D00_recover.sal&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;--Kyle&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lpuart on the 5340 using interrupt mode fails to recover from a TX timeout</title><link>https://devzone.nordicsemi.com/thread/451010?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 09:25:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c213a606-806d-42d4-bb6f-ab28dd414317</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Not sure if I can think of a better workaround, do you have any logic analyzer trace of the tx, rx, rdy and req pin when failing and working for comparison? does adding an external pull up on rdy or req make any difference? what is the timeout used here, does increasing it help?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>