<?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>Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90203/async-uart-api-in-zephyr-timeout-to-slow</link><description>Hello all, 
 We are working on an nRF52832 and use the UART peripheral in the latests Zephyr release. As we have a lot of data to send from the nRF to the linux host we are using the async uart interface (DMA) and this works flawlessly. Sometimes the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Aug 2022 06:13:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90203/async-uart-api-in-zephyr-timeout-to-slow" /><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/379430?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2022 06:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c7fc568-aeb8-4d32-9ef9-d4f3c51c827b</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>[quote user="Jonas Dptechnics"]This ticket can be closed. Thank you for your input![/quote]
&lt;p&gt;&lt;span&gt;Thanks a lot for your feedback, Jonas! I will close the ticket then &lt;/span&gt;&lt;span&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f60a.svg" title="Blush"&gt;&amp;#x1f60a;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/379165?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 14:56:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:920b7a8c-cddf-49db-a38a-ebc67cb7c76d</guid><dc:creator>Jonas Dptechnics</dc:creator><description>&lt;p&gt;Hi Markus,&lt;br /&gt;&lt;br /&gt;I work for Daan&amp;#39;s company.&lt;br /&gt;&lt;br /&gt;1) unfortunately I do not have any other nRF devices at present&lt;br /&gt;&lt;br /&gt;2) thank you for your help which gave us inspiration to try again in the near future but for now we are using interrupts again and handling the inevitable errors properly so it works quite well on 1mbps now&lt;br /&gt;&lt;br /&gt;This ticket can be closed. Thank you for your input!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/378832?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 07:32:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54719edd-8825-48a1-9378-2d4eb31ee69d</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>[quote user="dpape"]&lt;p&gt;&lt;span&gt;Yes this is the case&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;As already mentioned, if you change the timeout to a different value, how long will the offset be then? I asked this because it would be interesting to know if you can see any pattern.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Anything below 16ms gets unstable and gives timeouts around 16ms. Above 16ms it works as expected.&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;span&gt;Ok thanks, Daan!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you tried the API on other nRF devices and if so, do you see any difference in behaviour?&lt;/span&gt;&lt;span&gt; Do you have the possibility to share a log demonstrating the issue? &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/378741?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 13:50:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d8fa601-9037-4c65-af41-85519b96a83a</guid><dc:creator>dpape</dc:creator><description>&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_rx_enable"&gt;Documentation&lt;/a&gt;&amp;nbsp;states that&amp;nbsp;&lt;em&gt;&amp;ldquo;Inactivity period after receiving at least a byte which triggers&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_event_type"&gt;uart_event_type&lt;/a&gt;::UART_RX_RDY event.&amp;rdquo;&lt;/em&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;em&gt;&amp;ldquo;If some data was received and timeout occurred uart_event_type::UART_RX_RDY event will be generated. It can happen multiples times for the same buffer. RX timeout is counted from last byte received i.e. if no data was received, there won&amp;rsquo;t be any timeout event.&amp;rdquo;&lt;/em&gt;&amp;nbsp;Can you confirm that at least one byte was sent in this particular case?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;Yes this is the case&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;As already mentioned, if you change the timeout to a different value, how long will the offset be then? I asked this because it would be interesting to know if you can see any pattern.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Anything below 16ms gets unstable and gives timeouts around 16ms. Above 16ms it works as expected.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/377997?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 06:49:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55b49ca7-72a4-442b-a382-ff7eaec9103c</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Thanks a lot for your feedback, Daan!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="dpape"]I think we have quite good understanding of how this API works. In our opinion it doesn&amp;#39;t work according to the documentation or the documentation lacks some details about timing. Please elaborate.[/quote]
&lt;p&gt;&lt;span&gt;I have two questions here:&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_rx_enable"&gt;Documentation&lt;/a&gt; states that &lt;em&gt;“Inactivity period after receiving at least a byte which triggers &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_event_type"&gt;uart_event_type&lt;/a&gt;::UART_RX_RDY event.”&lt;/em&gt; &amp;amp; &lt;em&gt;“If some data was received and timeout occurred uart_event_type::UART_RX_RDY event will be generated. It can happen multiples times for the same buffer. RX timeout is counted from last byte received i.e. if no data was received, there won’t be any timeout event.”&lt;/em&gt; Can you confirm that at least one byte was sent in this particular case?&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;As already mentioned, if you change the timeout to a different value, how long will the offset be then? I asked this because it would be interesting to know if you can see any pattern.&lt;/span&gt;&lt;span&gt; &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/377919?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 14:43:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14869292-7126-4ab9-bf32-025733fe5e80</guid><dc:creator>dpape</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I understand that the callback is thus purely software and not caused by a hardware interrupt of the DMA controller, therefore you call it a callback function.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I totally understand that the uart_rx_enable function defines the inactivity period. We expect this to call the callback after x amount of time after the last byte was received. We are therefore convinced that we should receive the callback after a timeout of 1ms when we pass `USEC_PER_MSEC` as the timeout parameter. However we see a minimum timeout of 16ms. You suggest to do some modifications, but please let me know what kind of modifications are possible. In my opinion we can only pass the parameter.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="100109" url="~/f/nordic-q-a/90203/async-uart-api-in-zephyr-timeout-to-slow/377855"]&lt;span&gt;Otherwise, the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_event_type"&gt;uart_event_type&lt;/a&gt; gives quite a decent description of how this API is supposed to work.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;I think we have quite good understanding of how this API works. In our opinion it doesn&amp;#39;t work according to the documentation or the documentation lacks some details about timing. Please elaborate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART API in Zephyr timeout to slow</title><link>https://devzone.nordicsemi.com/thread/377855?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 12:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37fbe116-b0a1-45a0-914f-053372dbfef9</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Daan,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]We would thus expect an interrupt every millisecond, as soon as at least one byte was received by the DMA. [/quote]
&lt;p&gt;&lt;span&gt;First of all, I would like to clarify that when using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#uart-async-api"&gt;Asynchronous API&lt;/a&gt;, there is no interrupt function. The triggered events are handled by a&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_callback_t"&gt;callback&lt;/a&gt; function instead. &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]The problem is that the timeout that we are measuring is much, much longer and we have determined a minimum of about 16ms.&amp;nbsp;[/quote]
&lt;p&gt;&lt;span&gt;That being said, the timeout of the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_rx_enable"&gt;uart_rx_enable()&lt;/a&gt; function defines an inactivity period. I assume that you might want to do some modifications there.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]We suspect it may have something to do with the clock source of the interrupt but we need some pointers on how to fix this.&amp;nbsp;[/quote]
&lt;p&gt;&lt;span&gt;Otherwise, the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/hardware/peripherals/uart.html#c.uart_event_type"&gt;uart_event_type&lt;/a&gt; gives quite a decent description of how this API is supposed to work.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Markus&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>