<?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>UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79460/uarte-lost-a-byte-after-uarte-disable-and-enable-again</link><description>Hi,all~ 
 
 
 The program runs on nRF52833. At the beginning, MCU sends data to nRF52833 through serial port, and the data can be received correctly(pic one）. When I use THE GPIO control module to disable and enable the serial port again, the MCU is sending</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Aug 2022 15:40:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79460/uarte-lost-a-byte-after-uarte-disable-and-enable-again" /><item><title>RE: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/381233?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 15:40:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d1daa28-e235-4c66-a416-58dbe1564db0</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Relying on a pin transition and assuming it only happens once (even if debouncing is supposedly handled) without checking the state often leads to unexpected behavior. Perhaps try something like this to avoid enabling an enabled uart (even if that&amp;#39;s supposed to be benign):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if( !nrf_gpio_pin_read(PIN_NRF_SLEEP) &amp;amp;&amp;amp; uart_is_disabled() )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Might not help but generally good practice&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/381230?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 15:09:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a414036-0d93-4330-bdfb-1ab2427f7179</guid><dc:creator>Timor</dc:creator><description>&lt;p&gt;I figured out that i also need to start the receiver (NRF_UART0-&amp;gt;TASKS_STARTRX = 1) after enabling the UART. It doesn&amp;#39;t explain the strange behavior of losing the 7th byte but it works.&lt;/p&gt;
&lt;p&gt;Should i have further issues with this i will open a new case as you suggested.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/381117?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 07:57:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a270b339-a708-4794-82e1-3b2f169fe4b2</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This case is almost a year old at this point, and I think it would be best if you create a new case where you can link to this one and share some more information on what you do (and possibly share your project so we can recreate this on our end). For example, do you also only see the one byte missing, do you transmit more than 10 bytes like the original poster or more/less?&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: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/381101?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 07:22:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bea35e34-ed83-4ac1-9957-ea9107e3dcd0</guid><dc:creator>Timor</dc:creator><description>&lt;p&gt;Strangely i see the same problem. When using Init and Unint functions it works well but when using Enable and Disable functions the 7th byte is missing. I need to use enable/disable in order to wake up fast in response to incoming data. Any suggestions?&lt;/p&gt;
&lt;p&gt;p.s. this is with nRF52833, SDK 17.1.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/328955?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 08:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c8e9b5e-66fc-4f59-808a-c94ffca867c0</guid><dc:creator>Jing Luo</dc:creator><description>&lt;p&gt;Hi,Simon&lt;/p&gt;
&lt;p&gt;Thank for your reply.&lt;/p&gt;
&lt;p&gt;When i enable UART driver again,the buffer size is 256 bytes, the same as when enabled initially. But the second enable function is not the same as first.The process is set the register Disabled and Enabled After&amp;nbsp;Initializing.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1631263750812v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then I tried the method you suggested，it worked well.I take this approach, although it&amp;#39;s a little complicated.If you have time, try to reproduce this problem using the nrf_uarte_enable function, which is fun.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards，&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Jing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/328944?ContentTypeID=1</link><pubDate>Fri, 10 Sep 2021 07:53:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79f2ee43-61c0-477f-8de5-c4a1f0b1aabd</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This seems very strange indeed. If you were to lose a byte, I would imagine it was the last one and not one in the middle of your transmission. When you enable the UART driver again, is I.E. the buffer size the same as when enabled initially? Do you use the same enable function for enabling it during startup as well?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When disabling the UART, can you also try uninitializing the UART after disabling it by calling app_uart_close() and reinitializing it when you&amp;#39;re enabling it again?&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: UARTE lost a byte after uarte disable and enable again.</title><link>https://devzone.nordicsemi.com/thread/328718?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 07:35:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bc6d6a0-7422-4cfa-93fe-5a975299f651</guid><dc:creator>Jing Luo</dc:creator><description>&lt;p&gt;Let me make it a little bit clearer about code.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t drv_uart_enable(  )
{
	nrf_uarte_enable( NRF_UARTE0 );
	return NRF_SUCCESS;
}


uint32_t drv_uart_disable(  )
{
	nrf_uarte_disable( NRF_UARTE0 );
	return NRF_SUCCESS;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thank you at all~&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>