<?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>MQX Software SolutionsのトピックMQX task scheduling</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196090#M4054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written&amp;nbsp; simple code to creat two tasks, one task is to write to UART (interrupt driven) &amp;amp; another task is to read a character from UART (interrupt driven) &amp;amp; echo back to HyperTerminal to display to the user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MCF52233-Rev F demo board for testing purpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the control goes to read_task, I have a while loop over there, I want to switch back to write_task, after the timeslice of 1ms is expired.I want to see continuous switching from one task to another, but I am unable to see so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check the code attached &amp;amp; give a feedback as to where I am going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per my understanding from MQXUG, if the task is declared as follows, MQX_SCHED_RR else MQX_SCHED_FIFO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;const TASK_TEMPLATE_STRUCT  MQX_template_list[] = {     /* Task Index,   Function,   Stack,  Priority, Name,     Attributes,          Param, Time Slice */    { READ_TASK,     read_task, 1000,   4,        "Read",  MQX_AUTO_START_TASK,  0,     0 },    { WRITE_TASK,   write_task, 1000,   5,        "Write",  MQX_TIME_SLICE_TASK,    0,     100 },    { 0 }};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am unable to see task switching.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:51:16 GMT</pubDate>
    <dc:creator>Lakshmi</dc:creator>
    <dc:date>2020-10-29T09:51:16Z</dc:date>
    <item>
      <title>MQX task scheduling</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196090#M4054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written&amp;nbsp; simple code to creat two tasks, one task is to write to UART (interrupt driven) &amp;amp; another task is to read a character from UART (interrupt driven) &amp;amp; echo back to HyperTerminal to display to the user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MCF52233-Rev F demo board for testing purpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the control goes to read_task, I have a while loop over there, I want to switch back to write_task, after the timeslice of 1ms is expired.I want to see continuous switching from one task to another, but I am unable to see so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check the code attached &amp;amp; give a feedback as to where I am going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per my understanding from MQXUG, if the task is declared as follows, MQX_SCHED_RR else MQX_SCHED_FIFO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;const TASK_TEMPLATE_STRUCT  MQX_template_list[] = {     /* Task Index,   Function,   Stack,  Priority, Name,     Attributes,          Param, Time Slice */    { READ_TASK,     read_task, 1000,   4,        "Read",  MQX_AUTO_START_TASK,  0,     0 },    { WRITE_TASK,   write_task, 1000,   5,        "Write",  MQX_TIME_SLICE_TASK,    0,     100 },    { 0 }};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am unable to see task switching.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196090#M4054</guid>
      <dc:creator>Lakshmi</dc:creator>
      <dc:date>2020-10-29T09:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: MQX task scheduling</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196091#M4055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you don't see task switching, because your write task sends out a character and then it finishes. There should be a loop too. The example itself is kind of fuzzy, for start try simple loops with printf("taskABC") inside.&lt;/P&gt;&lt;P&gt;The task template is also wrong&amp;nbsp;(assuming you wanted time slice), so try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;const TASK_TEMPLATE_STRUCT&amp;nbsp; MQX_template_list[] =&lt;BR /&gt;{&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; /* Task Index,&amp;nbsp;&amp;nbsp; Function,&amp;nbsp;&amp;nbsp; Stack,&amp;nbsp; Priority, Name,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attributes,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param, Time Slice */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { READ_TASK,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_task, 1000,&amp;nbsp;&amp;nbsp; 5,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Read",&amp;nbsp; &amp;nbsp;MQX_AUTO_START_TASK | MQX_TIME_SLICE_TASK, 0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { WRITE_TASK,&amp;nbsp;&amp;nbsp; write_task, 1000,&amp;nbsp;&amp;nbsp; 5,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Write",&amp;nbsp; MQX_TIME_SLICE_TASK,&amp;nbsp;0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 0 }&lt;BR /&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;PetrM&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 23:16:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196091#M4055</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2010-04-28T23:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: MQX task scheduling</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196092#M4056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see your task priorities are set to 4 or 5 respectivelly. Priorities less and equal to 7 are running at interrupt levels 0 - 6, priorities above level 7 are running at level 7 (lowest priority, i.re. SR[I] is set to 0). Note that if your task is running at level 4, interrupts with priority 4, 5 and 6 are masked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 16:10:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-task-scheduling/m-p/196092#M4056</guid>
      <dc:creator>JuroV</dc:creator>
      <dc:date>2010-04-29T16:10:01Z</dc:date>
    </item>
  </channel>
</rss>

