<?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 Issue related to vTaskDelete of freeRTOS in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331639#M15544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In our appliction i have created a task taskResponseToMaster() that has to be executed only at certain event in the code. So at that event I have created the task (as it is not a periodic task, i have not used for loop). so at the end of the task i am deleting the task using vTaskDelete(NULL). At that instance it's not yielding the processor and going into PE_DEBUGHAULT(); &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching the code to this post, the task I have said is at line number 545 of ./lib/slave.c and the task create statement is at line number 97 of ./lib/slave.c. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Durgesh&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337430"&gt;Gateway_New.rar&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2014 05:30:00 GMT</pubDate>
    <dc:creator>durgeshtanuku</dc:creator>
    <dc:date>2014-10-17T05:30:00Z</dc:date>
    <item>
      <title>Issue related to vTaskDelete of freeRTOS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331639#M15544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In our appliction i have created a task taskResponseToMaster() that has to be executed only at certain event in the code. So at that event I have created the task (as it is not a periodic task, i have not used for loop). so at the end of the task i am deleting the task using vTaskDelete(NULL). At that instance it's not yielding the processor and going into PE_DEBUGHAULT(); &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching the code to this post, the task I have said is at line number 545 of ./lib/slave.c and the task create statement is at line number 97 of ./lib/slave.c. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Durgesh&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337430"&gt;Gateway_New.rar&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 05:30:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331639#M15544</guid>
      <dc:creator>durgeshtanuku</dc:creator>
      <dc:date>2014-10-17T05:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to vTaskDelete of freeRTOS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331640#M15545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Durgesh Tanuku:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are using Processor Expert, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The execution can enter in the PE_DEBUGHALT() because of many different reasons. The next tutorials by colleague Erich Styger can help you to analyze your code and find what is causing this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/02/20/oh-my-an-interrupt/" title="http://mcuoneclipse.com/2012/02/20/oh-my-an-interrupt/"&gt;Oh my! An Interrupt… | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/" title="http://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/"&gt;Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/12/28/a-processor-expert-component-to-help-with-hard-faults/" title="http://mcuoneclipse.com/2012/12/28/a-processor-expert-component-to-help-with-hard-faults/"&gt;A Processor Expert Component to Help with Hard Faults | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 03:05:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331640#M15545</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2014-10-22T03:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue related to vTaskDelete of freeRTOS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331641#M15546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Durgesh,&lt;/P&gt;&lt;P&gt;As your project is not complete, I cannot run it. But I see that you are using NULL as parameter to vTaskDelete(), so this does not match what you are saying in report above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46977iABFCCA236F6E2006/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You are creating tasks in slave.c in several places using a *local* variable names taskHandle, which is very problematic.&lt;/P&gt;&lt;P&gt;Can you set a breakpoint on above line of vTaskDelete() in the debugger and check if taskHandle is indeed NULL?&lt;/P&gt;&lt;P&gt;And I would use NULL just to make sure that you are not accidentially deleting a different task, as you are using a global task handle variable:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46978i212DF6B6FA5D2512/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And actually this is your problem (I think), because on line 319 (function readInputStatusHandler()) you are setting that handle for Task3:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46979i8729261DFE04144B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So in essence, in taskResponseToMaster() you are not deleting yourself, you are deleting Task3.&lt;/P&gt;&lt;P&gt;And no wonder that taskResponseToMaster() will crash as it has not been deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 07:22:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Issue-related-to-vTaskDelete-of-freeRTOS/m-p/331641#M15546</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-10-22T07:22:48Z</dc:date>
    </item>
  </channel>
</rss>

