<?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>Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100737/zephyr-uart-async-receive-drops-a-single-character</link><description>I&amp;#39;m using the async API for UART and I have noticed that, shortly after initialisation, I receive a single character with the UART_RX_READY event. This character is 0xff - and I suspect that&amp;#39;s just the GPIO lines changing state. This character is easy</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Aug 2024 10:11:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100737/zephyr-uart-async-receive-drops-a-single-character" /><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/500398?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2024 10:11:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e94d763-1f28-4b81-a6b7-e507aa5bc7e3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Yes, I ported my test app from 2.2.0 to 2.6.1 yesterday, and also see that it works correctly now.&lt;/p&gt;
&lt;p&gt;If you were concerned about risks or effort costs, you could first try just porting just your UART functionality to a standalone 2.6.1 project to test the water first, before committing to upgrade the entire project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/500365?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2024 08:07:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bc7ff9e-270f-480e-b09b-669aa474945a</guid><dc:creator>KjellArne Amina</dc:creator><description>&lt;p&gt;Thanks for the quick feedback. I saw Jacobs post about the issue being present in 2.5.1 so wasn&amp;#39;t too optimistic. We&amp;#39;re still on 2.4.1, sorry for not mentioning that.&lt;br /&gt;&lt;br /&gt;I guess this means we have one more reason to upgrade.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/500248?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2024 14:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a2539ed-cd28-4e58-beae-3ab6583ee728</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Thanks, Thilo, for the confirmation.&lt;/p&gt;
&lt;p&gt;@KjellArne Amina could you please share what version of the SDK you are using, and if 2.6.1 works for you?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/500194?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2024 11:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a854f88-5d52-4e98-b967-c655e98ebecd</guid><dc:creator>C.Thilo</dc:creator><description>&lt;p&gt;For us, this problem is fixed with nrf sdk 2.6.1. We upgrade from 2.4.3 to 2.6.1, so might be fixed in a previous version between theses two.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/500193?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2024 11:52:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c109285-7c03-4af3-bd66-7d3d025db9a1</guid><dc:creator>KjellArne Amina</dc:creator><description>&lt;p&gt;We recently ran into this issue ourselves. Has it been fixed in a recent SDK release?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/475432?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2024 14:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab0d6cd5-72bd-4f7b-92fe-4171a006cc4c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi JacobPrestonSynapse,&lt;/p&gt;
&lt;p&gt;Are you able to&amp;nbsp;reproduce the issue on a&amp;nbsp;simple sample, such as the Echo sample, with just some light modifications? That would help us a lot with investigating&amp;nbsp;the issue.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;span&gt;Please be informed that our team is currently short-handed,&amp;nbsp;and there will be delay in processing this request.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;The situation will improve&amp;nbsp;after the Easter holiday.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Our apologies for the inconvenience.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/474425?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2024 16:22:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76a7a223-bd46-4450-90a3-db8ec93a3750</guid><dc:creator>JacobPrestonSynapse</dc:creator><description>&lt;p&gt;Just chiming in here that we&amp;#39;ve been seeing this issue on an nRF52840 with SDK v2.5.1.&amp;nbsp; We are using the ASYNC UART with HW timers enabled.&amp;nbsp; I&amp;#39;m not sure what more information I can provide that would be helpful at this point as other users have already posted, but we don&amp;#39;t appear to get a one byte event when the UART is first enabled.&amp;nbsp; We just receive the first packet with the first byte missing, and then all subsequent packets are missing the first byte.&amp;nbsp; The length is correct, but the last byte just seems to be whatever was sitting on the buffer.&amp;nbsp; We&amp;#39;re able to reproduce this by booting our device on an already busy bus, though it&amp;#39;s sporadic and doesn&amp;#39;t always happen.&amp;nbsp; It never seems to happen on a quiet bus, but that won&amp;#39;t always be the case for us.&amp;nbsp; This is a situation that could happen in our deployment, so a fix would be nice to have.&amp;nbsp; We&amp;#39;ll continue looking as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/469734?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 09:48:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1833fd1f-547d-4496-84d5-d46af2b314d1</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Thilo,&lt;/p&gt;
&lt;p&gt;You are right, the alternative I last mentioned requires&amp;nbsp;the Asynchronous API instead of the Interrupt-driven API.&amp;nbsp;Perhaps it would be less risky if you could run a few tests by modifying a minimal sample first rather than with your main project code base?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/469692?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 07:51:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a62d3d9-3a81-473e-b48b-d9133e6dd341</guid><dc:creator>C.Thilo</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/vthieu"&gt;Hieu&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks for mentioning it!&lt;/p&gt;
&lt;p&gt;But I think this is not a solution for me, as CONFIG_UART_1_NRF_HW_ASYNC depends on UART_1_ASYNC which is not compatible to UART_1_INTERRUPT_DRIVEN ....&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But I&amp;#39;m curious, if this works. Perhaps it is worth to refactor all the code to work with async API.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Thilo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/469645?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 22:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b8ea8ed-7261-4328-adcb-c11442b53a55</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/dan_5f00_opito"&gt;dan_opito&lt;/a&gt;&amp;nbsp;and &lt;a href="https://devzone.nordicsemi.com/members/c.thilo"&gt;C.Thilo&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;I was recently given some pointers on this topic.&lt;/p&gt;
&lt;p&gt;The reason for the miscounted buffer size is because&amp;nbsp;by default RX bytes are counted by handling interrupts on every RX byte. If the interrupt is not handled on time, the counter will miss a byte.&lt;/p&gt;
&lt;p&gt;There is an option to enable HW byte counting using TIMER and PPI and then every byte is counted correctly. This is enabled by setting these Kconfig:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_UART_1_NRF_HW_ASYNC=y //enabling hw counting
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 //picking timer instance used for that&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please let me know if this remedies the issue for you.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/453134?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2023 19:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92fd77f2-5c42-4184-858f-18d34576a4a4</guid><dc:creator>dan_opito</dc:creator><description>&lt;p&gt;Glad I could help! The external device may be sending something to mcuboot before the application starts - I wonder if another possible workaround would be to reset the peripheral somehow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/452994?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2023 11:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21ff077e-8d31-40d7-a263-70b15d73e6cd</guid><dc:creator>C.Thilo</dc:creator><description>&lt;p&gt;Hi Dan&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve exactly the same problem. I can reproduce it when before running our app, I communicate with mcuboot via the same UART. For me it is always a 0x00 byte.&amp;nbsp;&lt;br /&gt;When I do not send anything to mcuboot before, that bug does not occure.&lt;br /&gt;&lt;br /&gt;I will try your workaround. Thanks for sharing it!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/444270?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 09:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52deb24c-5cbd-42a9-8928-ac16c4ba4b9d</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Dan,&lt;/p&gt;
&lt;p&gt;I am sorry to hear that the issue showed up again.&lt;/p&gt;
&lt;p&gt;We have registered it internally, but on DevZone, I cannot comment on the progress or the expected fix date.&lt;/p&gt;
&lt;p&gt;If this is critical, then could&amp;nbsp;you please have a word with your local Nordic Regional Sales Manager?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/444198?ContentTypeID=1</link><pubDate>Sun, 03 Sep 2023 21:35:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac7b6ae0-acd1-4f1c-b0fe-3c3e3474cc95</guid><dc:creator>dan_opito</dc:creator><description>&lt;p&gt;I think I&amp;#39;ve finally seen this issue in the field, even with my fix/hack. we have a hundred or so products in the field that all use this uart method - and I noticed the other day that exactly one of these has stopped working. Upon closer inspection, it is sending the correct number of characters but with an offset of two.&lt;/p&gt;
&lt;p&gt;The code in my initial message is still what I am using today - and until I spotted this device (which died two days ago) things have been working well.&lt;/p&gt;
&lt;p&gt;Can I get an update on where this is at?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/435087?ContentTypeID=1</link><pubDate>Thu, 06 Jul 2023 21:33:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c3f6f5a-5236-4a5a-9410-34cd8cf4a783</guid><dc:creator>dan_opito</dc:creator><description>&lt;p&gt;No problem, Hieu. I appreciate you taking the time to look into this bug for me. In the meantime, my workaround is working great - we&amp;#39;ve got this on a couple of different products and I haven&amp;#39;t noticed any issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/434884?ContentTypeID=1</link><pubDate>Thu, 06 Jul 2023 09:01:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a75325c0-f68e-4364-a1e4-716f929febf2</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi dan_opito,&lt;/p&gt;
&lt;p&gt;It has been a while, so I want to give you an update. I have reported the issue internally. However, as developers are away on summer vacations, there has not been any feedback yet.&lt;/p&gt;
&lt;p&gt;On that note, due to the same reasons, we are currently understaffed, and further response will be delayed. My apology for the inconvenience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/432432?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2023 03:54:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef11192c-ba1b-4395-bf7e-abafb752fc9f</guid><dc:creator>dan_opito</dc:creator><description>&lt;p&gt;No issue with any delays from our side. The work around is working really well and I haven&amp;#39;t noticed any issues. We&amp;#39;re not streaming lots of data - but we do have a few devices reporting every 10 minutes that have remained working consistently.&lt;/p&gt;
&lt;p&gt;WRT the off-by-one on the buffer size - that&amp;#39;s likely left over from me trying to figure out why I was always missing an octet.&lt;/p&gt;
&lt;p&gt;Your description above sounds like you may have reproduced the issue. I&amp;#39;m working on another product which will use the same UART and there will be 50 or so of those deployed over the next couple of months - plenty of test vectors and these ones will have higher bandwidth I believe.&lt;/p&gt;
&lt;p&gt;If you find a better fix, or if you find the underlying issue, I can push updates out to our devices after a bit of testing in our lab. Thanks for your efforts on this bug!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/432145?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 23:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78d4bdb9-5b2f-40f8-9c11-05ad0d94e978</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;P.s: I notice that in handling of UART_RX_BUF_REQUEST, you provide the&amp;nbsp;buffers one byte shorter than their actual length. Is there a particular reason for this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    case UART_RX_BUF_REQUEST:
    {
        if (!rx_buf1.is_in_use) {
            rx_buf1.is_in_use = true;
            uart_rx_buf_rsp(dev, rx_buf1.buffer, sizeof(rx_buf1.buffer) - 1);
        } else if (!rx_buf2.is_in_use) {
            rx_buf2.is_in_use = true;
            uart_rx_buf_rsp(dev, rx_buf2.buffer, sizeof(rx_buf2.buffer) - 1);
        }

        /* If we didn&amp;#39;t manage to hand over a buffer, we&amp;#39;ll get the disabled event. */
        break;
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/432143?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 23:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f20e2151-1737-49c3-b060-ca493d029d11</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi dan_opito,&lt;/p&gt;
&lt;p&gt;Sorry for the wait. I ended up getting sick&amp;nbsp;from last weekend and have been only able to work for 1-3 hours each day since.&lt;/p&gt;
&lt;p&gt;I was able to&amp;nbsp;create a test setup with my 2x nRF52840 DKs.&amp;nbsp;I produced&amp;nbsp;&lt;em&gt;an issue&lt;/em&gt;, however I am not sure if it is the same issue.&amp;nbsp;My issue&amp;nbsp;happens when a buffer is full and the second buffer is switched in. Then I see that the buffer is written &lt;em&gt;correctly&lt;/em&gt;, but the offset and length are 1 short in&amp;nbsp;&lt;em&gt;some situations.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This happen regardless of whether the&amp;nbsp;last or first byte transmitted is 0xFF or not.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7356.pastedimage1687303293610v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Interestingly, no byte is lost... However, it does lead to an issue that&amp;nbsp;one byte is forever detected late by one transmission the entire process, until, for again unclear reasons, the state of the buffer becomes correct again.&lt;/p&gt;
&lt;p&gt;I will have to discuss this issue to our internal team for analysis. However, as I am on sick leave,&amp;nbsp;that will have to be next week. My apology for this inconvenience.&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;the issue I described here is not the same as yours, could you please help me create a minimal setup to reproduce it?&lt;/p&gt;
&lt;p&gt;Here is the project I used to&amp;nbsp;observe the issue above.&amp;nbsp;It is based on your code, but I&amp;nbsp;made some renames as I debug it.&amp;nbsp;You could create your issue reproducing project based on it.&lt;/p&gt;
&lt;p&gt;In this project, the application logs to UART0 and RTT, and the communication&amp;nbsp;that is tested is over UART1.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/c309490_5F00_uart_5F00_char_5F00_230621_5F00_02.zip"&gt;devzone.nordicsemi.com/.../c309490_5F00_uart_5F00_char_5F00_230621_5F00_02.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Edit:&amp;nbsp;Fix corrupted attachment.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/431356?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2023 16:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79603790-2b46-438a-9074-d10e3ca782e0</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Thank&amp;nbsp;you for the information. I too don&amp;#39;t think this issue is exclusive to hardware.&lt;/p&gt;
&lt;p&gt;I couldn&amp;#39;t get to reproducing it as I had planned, so I don&amp;#39;t have anything meaningful to feedback to you yet. My apology. I will continue at it and update you as soon as I find anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/431122?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 21:05:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd399de6-bc10-4da8-9c87-dc8870a148c7</guid><dc:creator>dan_opito</dc:creator><description>&lt;p&gt;Yes, sorry, this is on our nRF9160 board. We also have an nRF91 Thingy - not sure we have the DK but I think this is likely to be hardware independant. In case not, here&amp;#39;s the device tree overlay for it:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart2 {
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt; 4800 &amp;gt;;

	pinctrl-0 = &amp;lt;&amp;amp;tunnel_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;tunnel_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};

&amp;amp;pinctrl {
	tunnel_default: tunnel_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 15)&amp;gt;,
				    &amp;lt;NRF_PSEL(UART_RX, 0, 13)&amp;gt;;
			bias-pull-up;
			// psels = &amp;lt;NRF_PSEL(UART_TX, 0, 24)&amp;gt;,
			// 	    &amp;lt;NRF_PSEL(UART_RX, 0, 23)&amp;gt;;
		};
	};

	tunnel_sleep: tunnel_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 15)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_RX, 0, 13)&amp;gt;;
			// psels = &amp;lt;NRF_PSEL(UART_TX, 0, 24)&amp;gt;,
			// 	    &amp;lt;NRF_PSEL(UART_RX, 0, 23)&amp;gt;;
			bias-pull-up;
			low-power-enable;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ve figured out the RX buffer structure - here&amp;#39;s my definition for completeness:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* Receive buffer structure to manage our data from the device. */
/* NOTE: CONFIG_OPITO_SERIAL_TUNNEL_RECEIVE_BUFFER_LENGTH is set to 256 */

struct rx_buf {
    /* Holds the received data. */
    uint8_t buffer[CONFIG_OPITO_SERIAL_TUNNEL_RECEIVE_BUFFER_LENGTH];
    /* True when the UART driver is using the buffer. */
    bool is_in_use;
};

/* Our ping-pong buffers for receiving data from the device. */
static struct rx_buf rx_buf1;
static struct rx_buf rx_buf2;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The Bluetooth example appears to be disabling once it receives a full packet - but that very well could mask the issue. When reproducing, I&amp;#39;d suggest treating the data as a never-ending stream (rather than packetised transport) - in which case you would never disable the buffer.&lt;/p&gt;
&lt;p&gt;It may well be that I&amp;#39;ve misunderstood how it&amp;#39;s supposed to work - but I feel like disabling UART RX is opening ourselves to dropped characters?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr UART Async receive drops a single character</title><link>https://devzone.nordicsemi.com/thread/430834?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 18:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fadc1a8-c679-4087-b772-d84a8849b2f2</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;dan_opito,&lt;/p&gt;
&lt;p&gt;I cannot see anything obviously&amp;nbsp;standing out in your code just by reading, so I guess I will need to try to reproduce it. Do you observe this issue on a nRF9160?&lt;/p&gt;
&lt;p&gt;Meanwhile,&amp;nbsp;t&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.4.0/samples/bluetooth/peripheral_uart/src/main.c"&gt;he&amp;nbsp;Bluetooth: Peripheral UART sample&lt;/a&gt; handles UART event somewhat like your workaround, so I wonder if it is how it is supposed to work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have a nRF9160 DK ready and also ran out of time today, but I will continue to look into this tomorrow.&lt;/p&gt;
&lt;p&gt;By the way,&amp;nbsp;are your RX Buffers something like this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;struct rx_buf
{
	bool is_in_use;
	uint8_t buffer[TEST_BUFFER_SIZE];
};

struct rx_buf rx_buf1 = {0};
struct rx_buf rx_buf2 = {0};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>