<?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>Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94359/getting-started-with-freertos-on-nrf52</link><description>Hi, I&amp;#39;m trying to use FreeRTOS on a custom board featuring a nRF52832. I&amp;#39;ve started adapting the blinky_freertos example in the SDK 17.1.0 and replacing the code in led_toggle_task_function with the following snippet: 
 
 
 I&amp;#39;m using IAR (with low optimization</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Dec 2022 13:06:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94359/getting-started-with-freertos-on-nrf52" /><item><title>RE: Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/thread/399932?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2022 13:06:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ba75a48-9c89-48ed-89c3-349896b1436e</guid><dc:creator>matteob</dc:creator><description>&lt;p&gt;The clock driver is in the project. In the sdk_config.h, I&amp;#39;ve changed only some RTT-related stuff (NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED, NRF_LOG_BACKEND_RTT_ENABLED, NRF_LOG_BACKEND_UART_ENABLED,&amp;nbsp;NRF_LOG_DEFAULT_LEVEL and&amp;nbsp;NRF_LOG_DEFERRED).&lt;/p&gt;
&lt;p&gt;I&amp;#39;m just wondering if the example would work as-is on the development board (which I haven&amp;#39;t tried), or if it is necessary to add the lines above in the main. Anyway for my part the issue is solved, thanks for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/thread/399905?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2022 12:08:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57a1acfd-ca23-4dfd-997d-bef0f055f17b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I thought the nrf_clock driver starts the lfclk if you have selected&amp;nbsp;NRFX_CLOCK_CONFIG_LF_SRC to be XTAL.&lt;/p&gt;
&lt;p&gt;Do you have the clock driver in your project? with same sdk_config.h settings for the clocks?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/thread/399886?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2022 10:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ff7fd47-dc24-4575-b54c-34b4e58b3c86</guid><dc:creator>matteob</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, I was referring to the blinky freertos example, which does not start the lfclk in the main but apparently relies on that (at least on my board, but I guess also on the nRF52 DK)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/thread/399883?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2022 10:23:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac9fe08a-e4f1-460a-b73e-3bd13b4ae95b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The normal blinky example (not the freertos one) is not using LFCLK as it is not using any RTC timers. The blinky example uses busy wait which relies on CPU time and hence HFCLK.&lt;/p&gt;
&lt;p&gt;It is always good to start the lfclk in the main if you know that you are going to use some peripherals that need this clock.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/thread/399471?ContentTypeID=1</link><pubDate>Wed, 07 Dec 2022 14:28:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddf4151c-d55c-48cc-874f-afbf32de7d9b</guid><dc:creator>matteob</dc:creator><description>&lt;p&gt;Hi Susheel, thanks for your answer. You were right, in fact I solved the issue adding before the task creation these lines, which I took from the radio transmitter example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART    = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0)
{
    // Do nothing.
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now the theoretical question arises: how is it possible that the blinky example works on the nRF52 DK? I had look at the nrf_drv_clock source code in SDK 17.1 and it seems to me that the LFCLKSTART is not triggered, even though the data sheet states it is necessary to do that in order for the RTC to start.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with FreeRTOS on nrf52</title><link>https://devzone.nordicsemi.com/thread/398298?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 11:19:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63f63f96-44dd-4b65-9b52-ff8b77df75f1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The FreeRTOS example we have relies on the RTC to handle the kernel tick required for housekeeping of the kernel. IF the RTC is not ticking correctly then there are no interrupts generated. You can put a breakpoint in the&amp;nbsp;nRF5_SDK_17.1.0_ddde560\external\freertos\portable\CMSIS\nrf52\port_cmsis_systick.c:: Line 117 and see if this interrupt is being triggered at all. My guess is that this interrupt might not be triggered at all (or enough) propbably due to issues in your external LFCLK needed by the RTC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>