<?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>topic Re: MQX - CPU Utilization Performance Test in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327694#M10435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;Thanks for the quick reply and pointing out my rather dumb mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I entered 120,000 over and over again never recognizing the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;-Ken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Apr 2015 15:27:46 GMT</pubDate>
    <dc:creator>keno</dc:creator>
    <dc:date>2015-04-17T15:27:46Z</dc:date>
    <item>
      <title>MQX - CPU Utilization Performance Test</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327691#M10432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am providing this cpu utilization technique to the community courtesy of a brilliant and kind engineer in Texas, Jimmie Curry.&amp;nbsp; Thanks Jimmie!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the MQX idle task (idletask.c) we find:&lt;/P&gt;&lt;P&gt;The idle task is of the lowest priority and is preempted by any active task and ISRs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/P&gt;&lt;P&gt;#if !defined(MQX_ENABLE_IDLE_LOOP) || MQX_ENABLE_IDLE_LOOP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: yellow;"&gt;if (++kernel_data-&amp;gt;IDLE_LOOP.IDLE_LOOP1 == 0) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; if (++kernel_data-&amp;gt;IDLE_LOOP.IDLE_LOOP2 == 0) {&lt;/P&gt;&lt;P&gt; if (++kernel_data-&amp;gt;IDLE_LOOP.IDLE_LOOP3 == 0) {&lt;/P&gt;&lt;P&gt; ++kernel_data-&amp;gt;IDLE_LOOP.IDLE_LOOP4;&lt;/P&gt;&lt;P&gt; } /* Endif */&lt;/P&gt;&lt;P&gt; } /* Endif */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The highlighted code consist of 5 assembly language instructions, each of which requires one core clock cycle. (ARM Cortex M4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each IDLE_LOOP counter is a 32 bits, which together becomes a 128 bit counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case, the core clock is 120 MHz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count_Time = 1/120e6 * 5 (the time to complete one count)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count_Time * 2^32 is required to roll over, in my case approximately 3 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus if I set a break point on the second if statement and only the idle task were running, three minutes would elapse between breaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That means that if we measure 6 minutes of operation between breaks, we have 50% CPU utilization by the OS/Application code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10 minutes between breaks, indicates 70% OS/Application utilization.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 12:30:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327691#M10432</guid>
      <dc:creator>mlamp</dc:creator>
      <dc:date>2014-09-18T12:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: MQX - CPU Utilization Performance Test</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327692#M10433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mlamp"&gt;mlamp&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I found your post as I'm interested in evaluating CPU load in our system.&amp;nbsp; I'm trying to adapt what you did for our situation.&amp;nbsp; I've gone through the math several times but I can't seem to come up with 3 minutes as the time between counter roll overs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a 120 MHz clock one clock cycle is 8.33 us.&amp;nbsp; 5 clock cycles are required to increment the counter which equates to 41.66 us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Multiplying 41.66 us by 2^32 (4,294,967,296) I get 178,569 seconds for the counter to roll over.&amp;nbsp; That comes out to a much larger time than 3 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've stared at it for some time trying to figure out where I went wrong with the calculation.&amp;nbsp; What am I missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 14:55:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327692#M10433</guid>
      <dc:creator>keno</dc:creator>
      <dc:date>2015-04-17T14:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: MQX - CPU Utilization Performance Test</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327693#M10434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ken,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;120Mhz is 8.33nS.&amp;nbsp; The counter takes 178 seconds to roll over.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:23:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327693#M10434</guid>
      <dc:creator>mlamp</dc:creator>
      <dc:date>2015-04-17T15:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: MQX - CPU Utilization Performance Test</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327694#M10435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;Thanks for the quick reply and pointing out my rather dumb mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I entered 120,000 over and over again never recognizing the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;-Ken&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:27:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327694#M10435</guid>
      <dc:creator>keno</dc:creator>
      <dc:date>2015-04-17T15:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: MQX - CPU Utilization Performance Test</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327695#M10436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know it's been a few years since you've posted this and who knows if you even have the same email address... I just want to let you know this is AWESOME! &amp;nbsp;It's sooooo simple it's stupid... :smileyhappy:&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 22:50:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-CPU-Utilization-Performance-Test/m-p/327695#M10436</guid>
      <dc:creator>netstv73</dc:creator>
      <dc:date>2017-08-03T22:50:55Z</dc:date>
    </item>
  </channel>
</rss>

