<?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: _task_restart not working in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402444#M13484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;​Hi Hetul,&lt;/P&gt;&lt;P&gt;I wonder if the issue is the task never started to run?&lt;/P&gt;&lt;P&gt;What is the priority of the ALIVE_TASK compared to the Main_task?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2015 16:09:05 GMT</pubDate>
    <dc:creator>DavidS</dc:creator>
    <dc:date>2015-07-31T16:09:05Z</dc:date>
    <item>
      <title>_task_restart not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402443#M13483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use _task_restart function but when called it hangs the application and I can see in task stack that the task I was trying to restart is in "terminating" state. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For test I modified web_hvac_mqx_twrk64f120m demo and I added following code at line 346 in Main_task().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;#if 1&amp;nbsp;&amp;nbsp;&amp;nbsp; //for task_restart test&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;_task_id&amp;nbsp;&amp;nbsp;&amp;nbsp; tempTid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;tempTid = _task_create(0, ALIVE_TASK, 0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;if(tempTid != MQX_NULL_TASK_ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("%s tid:%d\n", __FUNCTION__, tempTid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempTid = _task_restart(tempTid, NULL, 0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tempTid == MQX_OK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Task restarted!\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Task restart error\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;else&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Could not create the task!\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The mqx config files are with default configuration that it comes with.&amp;nbsp; Main_task hangs at _task_restart call and I tried to debug it and i can see it's getting hung in _task_restart_func() at line 2441 where it calls _sched_execute_scheduler_internal().&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did I not enable a particular MQX module and this is why i'm getting this problem? I appreciate any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 15:48:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402443#M13483</guid>
      <dc:creator>hetul</dc:creator>
      <dc:date>2015-07-31T15:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: _task_restart not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402444#M13484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;​Hi Hetul,&lt;/P&gt;&lt;P&gt;I wonder if the issue is the task never started to run?&lt;/P&gt;&lt;P&gt;What is the priority of the ALIVE_TASK compared to the Main_task?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 16:09:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402444#M13484</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2015-07-31T16:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: _task_restart not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402445#M13485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello David,&lt;/P&gt;&lt;P&gt;Main_task has priority of 23 and ALIVE_TASK is 10. I previously said the task i'm restarting shows "terminating" after _task_restart but I just notice that it's not the case, Task Status is still active. Thanks for you help David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 17:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402445#M13485</guid>
      <dc:creator>hetul</dc:creator>
      <dc:date>2015-07-31T17:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: _task_restart not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402446#M13486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hetul,&lt;/P&gt;&lt;P&gt;Attached is my example of being able to restart the HeartBeat_Task should anyone else want to test this.&lt;/P&gt;&lt;P&gt;I use a global variable to notify the HVAC_Task when the HeartBeat_Task has been running for 10 loops.&amp;nbsp; The HVAC_Task will then do a restart of the HeartBeat_Task.&lt;/P&gt;&lt;P&gt;Note this was tested using MQX_4.1.1.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 21:49:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402446#M13486</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2015-07-31T21:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: _task_restart not working</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402447#M13487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you David.&amp;nbsp; I tried your way of waiting for task to start for 10 loops and then restarting.&amp;nbsp; This is working for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 15:36:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/task-restart-not-working/m-p/402447#M13487</guid>
      <dc:creator>hetul</dc:creator>
      <dc:date>2015-08-03T15:36:28Z</dc:date>
    </item>
  </channel>
</rss>

