<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Design StudioのトピックRe: OSA FreeRTOS overhead on K22F? (&amp;Bug)</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/OSA-FreeRTOS-overhead-on-K22F-Bug/m-p/352109#M1401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you have to define what you mean by 'overhead'.&amp;nbsp; If you restructure a super loop design, that is spending most of the CPU cycles doing nothing other than polling interfaces and spinning in a loop, into an event driven mutl-threaded design, that only ever uses CPU cycles when there is actually something to do, then the overhead of the tick is negative.&amp;nbsp; That is, it can save you huge amounts of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you might expect, the overhead of the tick interrupt depends on the FreeRTOSConfig.h settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the best performance, but also the least amount of development support, use the following settings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/a00110.html#configUSE_PORT_OPTIMISED_TASK_SELECTION"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION&lt;/A&gt; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will make the selection of the next task use a single CLZ (count leading zeros) instruction, with the limitation that you cannot have more than 32 priorities (0 to 31).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/Stacks-and-stack-overflow-checking.html"&gt;configCHECK_FOR_STACK_OVERFLOW&lt;/A&gt; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will turn off both forms of stack overflow checking, which is actually the thing that takes the longest in the tick interrupt when it is on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/rtos-run-time-stats.html"&gt;configGENERATE_RUN_TIME_STATS&lt;/A&gt; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will turn off data collection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if you want the fastest performance, don't use the &lt;A href="http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_Trace/FreeRTOS_Plus_Trace.shtml"&gt;trace functionality&lt;/A&gt; either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the application you are writing, you can turn the tick off during idle periods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Jan 2015 08:07:58 GMT</pubDate>
    <dc:creator>FreeRTOS_org</dc:creator>
    <dc:date>2015-01-17T08:07:58Z</dc:date>
    <item>
      <title>OSA FreeRTOS overhead on K22F? (&amp;Bug)</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/OSA-FreeRTOS-overhead-on-K22F-Bug/m-p/352108#M1400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the FreeRTOS flavor of OSA running on a K22F FRDM board. The default tick frequency is 100 Hz. I need to do some homework to see if I need to tweak that.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a sense of how much overhead there is associated with the OS tick? It is a 120MHz M4F core, so it should be pretty zippy, but the impact is obviously&amp;nbsp; non-zero. It would be very helpful to understanding the trade offs if I had quantitative data on the overhead.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, I ran into an odd bug when FreeRTOS xTaskGenericCreate() was called by the OSA wrapper. The PRIORITY_OSA_TO_RTOS(priority) macro was clobbering the priority in OSA_TaskCreate() and a configASSERT() was failing. I simply passed a meaningful value direct to FreeRTOS and got it working. Not sure why that didn't work out of the box, but beware of that landmine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 14:36:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/OSA-FreeRTOS-overhead-on-K22F-Bug/m-p/352108#M1400</guid>
      <dc:creator>tharonhall</dc:creator>
      <dc:date>2015-01-16T14:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: OSA FreeRTOS overhead on K22F? (&amp;Bug)</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/OSA-FreeRTOS-overhead-on-K22F-Bug/m-p/352109#M1401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you have to define what you mean by 'overhead'.&amp;nbsp; If you restructure a super loop design, that is spending most of the CPU cycles doing nothing other than polling interfaces and spinning in a loop, into an event driven mutl-threaded design, that only ever uses CPU cycles when there is actually something to do, then the overhead of the tick is negative.&amp;nbsp; That is, it can save you huge amounts of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you might expect, the overhead of the tick interrupt depends on the FreeRTOSConfig.h settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the best performance, but also the least amount of development support, use the following settings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/a00110.html#configUSE_PORT_OPTIMISED_TASK_SELECTION"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION&lt;/A&gt; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will make the selection of the next task use a single CLZ (count leading zeros) instruction, with the limitation that you cannot have more than 32 priorities (0 to 31).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/Stacks-and-stack-overflow-checking.html"&gt;configCHECK_FOR_STACK_OVERFLOW&lt;/A&gt; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will turn off both forms of stack overflow checking, which is actually the thing that takes the longest in the tick interrupt when it is on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/rtos-run-time-stats.html"&gt;configGENERATE_RUN_TIME_STATS&lt;/A&gt; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will turn off data collection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if you want the fastest performance, don't use the &lt;A href="http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_Trace/FreeRTOS_Plus_Trace.shtml"&gt;trace functionality&lt;/A&gt; either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the application you are writing, you can turn the tick off during idle periods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 08:07:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/OSA-FreeRTOS-overhead-on-K22F-Bug/m-p/352109#M1401</guid>
      <dc:creator>FreeRTOS_org</dc:creator>
      <dc:date>2015-01-17T08:07:58Z</dc:date>
    </item>
  </channel>
</rss>

