<?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 MicrocontrollersのトピックRe: FreeRTOS: bumping into vApplicationMallocFailedHook() ?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364989#M18754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not familiar with the Processor Expert component but would guess you just need to allocate a larger heap.&amp;nbsp; Maybe you can do that through the PE component, but if not see the &lt;A href="http://www.freertos.org/a00111.html"&gt;memory management pages&lt;/A&gt; on the FreeRTOS.org website.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 14 Sep 2014 07:43:10 GMT</pubDate>
    <dc:creator>FreeRTOS_org</dc:creator>
    <dc:date>2014-09-14T07:43:10Z</dc:date>
    <item>
      <title>FreeRTOS: bumping into vApplicationMallocFailedHook() ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364988#M18753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've followed all the steps on [&lt;A href="http://mcuoneclipse.com/2013/01/31/tutorial-iar-freertos-freedom-board/" title="http://mcuoneclipse.com/2013/01/31/tutorial-iar-freertos-freedom-board/"&gt;Tutorial: IAR + FreeRTOS + Freedom Board | MCU on Eclipse&lt;/A&gt;] to setup FreeRTOS on FRDM-KL25Z. Processor Expert Driver Suite was used to generate the code. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Everything was going perfect (no warnings, no errors, task running ok) until I try to create my second task:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;int main(void)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;PE_low_level_init();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FRTOS1_xTaskCreate(ToggleRedLed, (signed portCHAR *)"Task1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FRTOS1_xTaskCreate(ToggleGreenLed, (signed portCHAR *)"Task2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;#ifdef PEX_RTOS_START&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp; PEX_RTOS_START();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;for(;;){}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;/* END main */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm in trouble. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;From debugging I've noticed the execution reaches &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt; PEX_RTOS_START();&lt;SPAN style="color: #000000;"&gt; and then goes to &lt;SPAN style="color: #0000ff;"&gt;FRTOS1_vApplicationMallocFailedHook(void)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone knows what is happening with this simple code or maybe know where do I need to start investigating, help please!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 03:27:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364988#M18753</guid>
      <dc:creator>victorleite</dc:creator>
      <dc:date>2014-09-14T03:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS: bumping into vApplicationMallocFailedHook() ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364989#M18754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not familiar with the Processor Expert component but would guess you just need to allocate a larger heap.&amp;nbsp; Maybe you can do that through the PE component, but if not see the &lt;A href="http://www.freertos.org/a00111.html"&gt;memory management pages&lt;/A&gt; on the FreeRTOS.org website.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 07:43:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364989#M18754</guid>
      <dc:creator>FreeRTOS_org</dc:creator>
      <dc:date>2014-09-14T07:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS: bumping into vApplicationMallocFailedHook() ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364990#M18755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Victor&lt;/P&gt;&lt;P&gt;You need to increase the heap size to a higher value in the FreeRTOS component:&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/45941iE698B51467BABFCF/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;&lt;/P&gt;&lt;P&gt;So you know why this happens:&lt;/P&gt;&lt;P&gt;Each of your task is using space in the heap.&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/45945i43EDF6E34B635C48/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;This is the value you are using in your call to create the task (&lt;SPAN style="color: #0000ff;"&gt;configMINIMAL_STACK_SIZE).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This size is in 'stack addressable memory uints', so 4 bytes for each. So if you have a minimal stack size of 200, this means 800 bytes per task (plus some bytes for the header information, etc). Additionally to the two task you create, there is as well the IDLE task created at scheduler start. So if you have 2 KByte of heap size, this will get you that out of heap error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 08:08:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364990#M18755</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-09-14T08:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS: bumping into vApplicationMallocFailedHook() ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364991#M18756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys! That was exactly my problem!&lt;/P&gt;&lt;P&gt;Erich, you're awesome! Thank you for this simple and powerful explanation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2014 14:38:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailedHook/m-p/364991#M18756</guid>
      <dc:creator>victorleite</dc:creator>
      <dc:date>2014-09-15T14:38:17Z</dc:date>
    </item>
  </channel>
</rss>

