<?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>FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81197/freertos-with-libuarte-incompatibility-between-app_timer-and-app_timer_freertos</link><description>Hello, I intend to use libuarte under FreeRTOS together with the SoftDevice (SDK 17.1.0). An app_timer is used for the RX timeout. I think there might be an incompatibility problem between app_timer and app_timer_freertos. My application initializes the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Nov 2021 09:41:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81197/freertos-with-libuarte-incompatibility-between-app_timer-and-app_timer_freertos" /><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/341220?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 09:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5edb1860-5223-4114-b0e3-77ab5caa4083</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks for verifying this Norbert.&lt;/p&gt;
&lt;p&gt;This seems to be a feature request to make the macros compatible with external RTOS. To be very transparent, this might not be prioritized as feature requests are frozen on nRF5 based SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your description and conclusion with very good details makes this thread very valuable to others who might encounter this. Thanks again for your contributions and coming back here after so many days to give the final touches to this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/341208?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 09:08:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02d83af8-8212-4492-9df6-d403dca1ba37</guid><dc:creator>Norbert</dc:creator><description>&lt;p&gt;Just a quick update: I got the libuarte running with two instances (one for each physical UART) and FreeRTOS timers. I implemented the work-around mentioned above. So far, I did not come across any other issues.&lt;/p&gt;
&lt;p&gt;Note that the second libuarte instance so far has only been tested in TX which means that the second timer instance didn&amp;#39;t do anything really.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/337099?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 12:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63be8e15-9bf1-4857-b7c4-b169b079525f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks Nobert.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, that macro clearly needs a fix but I am not sure that will be prioritized soon as most of the team is working on nRF Connect SDK. I will in any case create an internal ticket as your use case and request make sense.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/337025?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 09:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2a8a357-730a-4946-901c-85a793ac4eda</guid><dc:creator>Norbert</dc:creator><description>[quote userid="6207" url="~/f/nordic-q-a/81197/freertos-with-libuarte-incompatibility-between-app_timer-and-app_timer_freertos/336833#336833"]I think the main issue here is that the helper macros in the&amp;nbsp;NRF_LIBUARTE_ASYNC_DEFINE has not been designed to work with the freertos.[/quote]
&lt;p&gt;Yes, that seems to be the case. Would be nice if the SDK design team would also consider FreeRTOS as on one hand libuarte is the recommended UARTE API (AFAIK) and FreeRTOS is a supported RTOS.&lt;/p&gt;
&lt;p&gt;For the time being I will continue with the workaround. With my prototype build I cannot yet test RX but the TX seems to work.&lt;/p&gt;
&lt;p&gt;I will continue this thread in a couple of days if there are further incompatibility issues.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Norbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/336833?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 11:11:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4646f50f-b2f2-4b27-9318-6f94a669ddac</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;OK, then i will not try to push you to use other instances of RTC then, in that case let us go to your initial efforts and look at the issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think the main issue here is that the helper macros in the&amp;nbsp;NRF_LIBUARTE_ASYNC_DEFINE has not been designed to work with the freertos.&lt;/p&gt;
&lt;p&gt;so probably you can initialize&amp;nbsp;p_app_timer pointing zero initialized structure of&amp;nbsp;app_timer_info_t instead as a clean workaround.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/336712?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c263bbec-f22b-4ce0-85ad-3804fb806641</guid><dc:creator>Norbert</dc:creator><description>&lt;p&gt;I don&amp;#39;t think that this would work for me. I need two libuarte instances but there is only one RTC instance left.&amp;nbsp;RTC0 is used for the SoftDevice, RTC1 provides the FreeRTOS systick which leaves only RTC2 to work with. Furthermore, I am not sure for which other purposes/peripherals I might need an RTC later so I want to conserve HW resources as much as possible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/336709?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:09:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8adef442-ceb0-4ff1-8cb6-1e04c1dd64b9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Since Freertos is using RTC1 by default, you can give&amp;nbsp;NRF_CLI_LIBUARTE_TIMEOUT_RTC_INSTANCE as 2 inside&amp;nbsp;NRF_LIBUARTE_ASYNC_DEFINE. I haven&amp;#39;t tried the freertos libuarte myself, but if the libuarte has done all this correct with taking this RTC instance as a configurable thing, then it should work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/336688?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 13:09:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a86a604-ca95-4b85-8afa-fc6205926dac</guid><dc:creator>Norbert</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Sorry, I am a bit confused. By telling libuarte to use app_timer, I thought it really uses the FreeRTOS version of it (app_timer_freertos) which is clocked by the FreeRTOS systick.&lt;/p&gt;
&lt;p&gt;At least that is what I am trying to achieve. If it is not correct what I am doing, then how do I configure libuarte to use app_timer_freertos? NRF_LIBUARTE_ASYNC_DEFINE only proposes TIMER (HW), RTC (HW) or app_timer.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS with libuarte: incompatibility between app_timer and app_timer_freertos?</title><link>https://devzone.nordicsemi.com/thread/336684?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 12:47:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae5f8fc2-247d-4cea-b68f-a8a1181b943c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You cannot use app_timer as it is as app_timer uses RTC1 which is the already used by freertos to keep its internal timers uptodate. If you want to use app_timer and app_timer_freertos together,&amp;nbsp;you need to change the freertos to use the different timer. This is easy to achieve if you change the&amp;nbsp;external\freertos\portable\CMSIS\nrf51\portmacro_cmsis.h from&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;portNRF_RTC_REG&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NRF_RTC1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;to&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#define&amp;nbsp;portNRF_RTC_REG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NRF_RTC2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;and also change&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;portNRF_RTC_IRQn&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC1_IRQn&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;to&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;portNRF_RTC_IRQn&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC2_IRQn&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>