<?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>Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33593/receiving-for-uart-with-freertos</link><description>Hello, 
 I have implemented a somewhat working RX algorithm for receiving data over UART but I&amp;#39;m looking for a good way to make it more robust. I haven&amp;#39;t found any good answers to this in either the forum or the infocenter and I get a little bit confused</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Dec 2021 08:09:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33593/receiving-for-uart-with-freertos" /><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/342834?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 08:09:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a6e5a7a-5259-4a40-8df1-8d07cbdc8e71</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8321.nrf_5F00_serial.c"&gt;devzone.nordicsemi.com/.../8321.nrf_5F00_serial.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/342830?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 08:03:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dee8bf9-5a3e-4ae9-bbb1-7bd7703ea886</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Since the original issue is still unresolved and if you think your issue matches the exact same description, then we can continue our discussion here.&lt;/p&gt;
&lt;p&gt;There were issues with nrf_serial working with freeRTOS that was mentioned in the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34155/what-are-sdk-15-x-0-known-issues"&gt;known issues list for SDK15.x&amp;nbsp;&lt;/a&gt;(check item 40. in the known issues list)&lt;/p&gt;
&lt;p&gt;I see that this was fixed in later SDKs internally but the module was removed for public in latest.&lt;/p&gt;
&lt;p&gt;The problem was that nrf_serial was trying to create too many timers which was turning out to be problematic with FreeRTOS.&lt;/p&gt;
&lt;p&gt;Can you please try to replace the components\libraries\serial\nrf_serial.c file with the attached one and see if it helps.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry for multiple edits, there is some issue with uploading this file&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7215.nrf_5F00_serial.c"&gt;devzone.nordicsemi.com/.../7215.nrf_5F00_serial.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/342351?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 13:44:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f35962ca-a1cf-44cb-81ad-16f826273dde</guid><dc:creator>vlockhead</dc:creator><description>&lt;p&gt;The description of the problem is exactly what I am experiencing. Why should we duplicate the information? I can copy and paste the original ticket in a new ticket if it is absolute necessary&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/342350?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 13:37:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6be62571-e962-4a12-9a21-8ba7fa044a11</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;This thread is quite old. Please create a new thread with your current issue, and an application engineer will have a look at it from our side.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/342176?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 21:03:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7357bcb-d839-4ab0-bf4b-1fea819fdfe6</guid><dc:creator>golgor</dc:creator><description>&lt;p&gt;No, this issue was never resolved. I did continue with my ugly fixes as it was only a technology demonstrator and something very temporary. I have since long stopped working on this project and I&amp;#39;m currently not working with any Nordic MCUs.&lt;/p&gt;
&lt;p&gt;I have received several messages about this so this seems to be an issue for more people. Maybe &lt;a href="https://devzone.nordicsemi.com/members/tesc"&gt;tesc&lt;/a&gt; can help out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/342170?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 18:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6b91a6d-83e6-4bed-b72a-8e55d7dff42c</guid><dc:creator>vlockhead</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Was this issue ever resolve? I am having the same issue with the SDK-15.2.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/131684?ContentTypeID=1</link><pubDate>Fri, 11 May 2018 09:50:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd97c392-354a-4456-8931-07ae82dfeb3f</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&lt;/p&gt;
&lt;p&gt;One third of the Norwegian public holidays are in May this year, so our capacity is reduced this month. I suggest that you stick to the solution you have right now for the proof of concept, and I will come back to you as soon as everyone is back in office. As these issues involves both FreeRTOS and the new SDK (with the new nrfx wrappers) I am afraid I have to discuss with several others who are not here at the moment in order to give good advice.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/131550?ContentTypeID=1</link><pubDate>Wed, 09 May 2018 13:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba3f7bbf-3adb-45b1-aeff-e8ac06a74546</guid><dc:creator>golgor</dc:creator><description>&lt;p&gt;Hello Terje,&lt;/p&gt;
&lt;p&gt;Yes, as I said in my post I am aware the solution is very ugly, it was more for demonstrating what the problem was rather than proposing a solution.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m mainly looking for a solution of the problem and I&amp;#39;m really confused to what I should use. Is the recommended driver to use for UART the UARTE module in the NRFX-part of the SDK? I.e. &amp;quot;nRF5_SDK_15.0.0\modules\nrfx\drivers\src\nrfx_uarte.c&amp;quot;&lt;/p&gt;
&lt;p&gt;If you are interested in deeper knowledge of the problem I have encountered I can share the code in a private case. But if you can recommend another module/library to use I will look more into that solution instead. My super ugly solutions work for now, and I&amp;#39;m only working with a PoC so I will not spend to much time to find a proper fix.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Robert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/131532?ContentTypeID=1</link><pubDate>Wed, 09 May 2018 13:05:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f0b6590-a298-4423-9b19-d4112cee3aee</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am sorry to see that this has been left unanswered for so long.&lt;/p&gt;
&lt;p&gt;I have tried to look into these issues, but I am afraid I need some help from a colleague who is out-of-office and will be so for the next two weeks. Hopefully I can come back to you before that, but that I cannot guarantee.&lt;/p&gt;
&lt;p&gt;From what I can tell thus far, yes, your proposed workaround in the opening post looks ugly, and I would find it very strange if something like that should be necessary. Are you sure that you have configured the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Flib_serial.html"&gt;serial port library&lt;/a&gt; correctly?&lt;/p&gt;
&lt;p&gt;We might need your full project, at least more code, in order to set up, reproduce and investigate further. You may open a private case in order to do so, if confidential. In that case please refer to this thread.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving for UART with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/129123?ContentTypeID=1</link><pubDate>Fri, 20 Apr 2018 10:49:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f85af501-637f-440c-a456-aa4e38c69f5c</guid><dc:creator>golgor</dc:creator><description>&lt;p&gt;I have also found issues when using the app_timer when I know the exact amount of bytes, i.e. I know that I will recieve 10 bytes and thus I set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;err = nrf_serial_read(&amp;amp;serial_uart, tmp_rx, 10, &amp;amp;received_bytes, 100);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The problem at this stage is that the timer is actually not reset when the correct amount of bytes are recieved. I think an &amp;quot;app_timer_stop(*p_serial-&amp;gt;p_rx_timer);&amp;quot; should be set also when the expected byte count is recieved such as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;do
    {
        size_t rcnt = serial_rx(p_serial, p_buff, left);
        left -= rcnt;
        p_buff += rcnt;
        if (!left)
        {
            (void)app_timer_stop(*p_serial-&amp;gt;p_rx_timer);
            break;
        }

        if (tout_ctx.expired)
        {
            if (p_serial-&amp;gt;p_ctx-&amp;gt;p_config-&amp;gt;mode != NRF_SERIAL_MODE_POLLING)
            {
                nrf_drv_uart_rx_abort(&amp;amp;p_serial-&amp;gt;instance);
            }
            break;
        }

        sleep_handler(p_serial);
    } while (1);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In&amp;nbsp;nrf_serial_read() function approx at line 460 to 479 in nrf_serial.c.&lt;/p&gt;
&lt;p&gt;I guess there should be a check if the timer is active before trying to stop it, or maybe that doesn&amp;#39;t matter...?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>