<?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: about FreeRTOS heap in S32K</title>
    <link>https://community.nxp.com/t5/S32K/about-FreeRTOS-heap/m-p/1010302#M6103</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;&lt;SPAN style="color: #000080;"&gt;1, when FreeRTOS is used, how to set the address of ucHeap[]?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the FreeRTOS processor expert view, you need to click in the &lt;EM&gt;Application allocated heap&lt;/EM&gt; option if you want to select where the ucHeap will be allocated. And you will need to add a line like the next one to place in some certain section in the linker file, the custom section is already defined in the linker file but you can define a new one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main.c&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;uint8_t __attribute__ &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;section &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;".customSection"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; ucHeap&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;configTOTAL_HEAP_SIZE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flash.ld&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;  &lt;SPAN class="comment token"&gt;/* Custom Section Block that can be used to place data at absolute address. */&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;/* Use __attribute__((section (".customSection"))) to place data here. */&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;customSectionBlock  &lt;SPAN class="token function"&gt;ORIGIN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;m_data_2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AT&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__CUSTOM_ROM&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    __customSection_start__ &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;KEEP&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;customSection&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;/* Keep section even if not referenced. */&lt;/SPAN&gt;
    __customSection_end__ &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; m_data_2
  __CUSTOM_END &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; __CUSTOM_ROM &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__customSection_end__ &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; __customSection_start__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the following image, it shows the total heap size and the map file and where this the ucHeap is allocated:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;IMG alt="pastedImage_2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/101146iE62D423D24DD18CF/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;2, In linker file, m_data_2 is set as heap space, but because freeRTOS does not use the linker file(*.ld), does it means m_data_2 section becomes to leave unused section?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the Application allocated heap option is not used, the ucHeap will be placed in the BSS section that is placed in the m_data_2.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;IMG alt="pastedImage_5.png" src="https://community.nxp.com/t5/image/serverpage/image-id/101047iC385696AEC7D622A/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_5.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;3,HeapSize in FreeRTOS is set as 16KB, but the project cannot run normally for memory is not enough, what may be the reason?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After setting the memory at 16 KB I can configure two tasks with 1000 size and an extra timer, maybe the memory needs it for your program is not enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know your findings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 14:33:57 GMT</pubDate>
    <dc:creator>Alexis_A</dc:creator>
    <dc:date>2020-11-02T14:33:57Z</dc:date>
    <item>
      <title>about FreeRTOS heap</title>
      <link>https://community.nxp.com/t5/S32K/about-FreeRTOS-heap/m-p/1010301#M6102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Dear expert&lt;/SPAN&gt;，&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I develop S32K144 with FreeRTOS V10.1.1&lt;/SPAN&gt;，&lt;SPAN&gt;the SDK version is RTM_3_0_0.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I describe my question in detail with the attachment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you kindly help me again?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2020 08:22:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/about-FreeRTOS-heap/m-p/1010301#M6102</guid>
      <dc:creator>zhaoyanling</dc:creator>
      <dc:date>2020-03-25T08:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: about FreeRTOS heap</title>
      <link>https://community.nxp.com/t5/S32K/about-FreeRTOS-heap/m-p/1010302#M6103</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;&lt;SPAN style="color: #000080;"&gt;1, when FreeRTOS is used, how to set the address of ucHeap[]?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the FreeRTOS processor expert view, you need to click in the &lt;EM&gt;Application allocated heap&lt;/EM&gt; option if you want to select where the ucHeap will be allocated. And you will need to add a line like the next one to place in some certain section in the linker file, the custom section is already defined in the linker file but you can define a new one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main.c&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;uint8_t __attribute__ &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;section &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;".customSection"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; ucHeap&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;configTOTAL_HEAP_SIZE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flash.ld&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;  &lt;SPAN class="comment token"&gt;/* Custom Section Block that can be used to place data at absolute address. */&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;/* Use __attribute__((section (".customSection"))) to place data here. */&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;customSectionBlock  &lt;SPAN class="token function"&gt;ORIGIN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;m_data_2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AT&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__CUSTOM_ROM&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    __customSection_start__ &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;KEEP&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;customSection&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;/* Keep section even if not referenced. */&lt;/SPAN&gt;
    __customSection_end__ &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; m_data_2
  __CUSTOM_END &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; __CUSTOM_ROM &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__customSection_end__ &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; __customSection_start__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the following image, it shows the total heap size and the map file and where this the ucHeap is allocated:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;IMG alt="pastedImage_2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/101146iE62D423D24DD18CF/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;2, In linker file, m_data_2 is set as heap space, but because freeRTOS does not use the linker file(*.ld), does it means m_data_2 section becomes to leave unused section?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the Application allocated heap option is not used, the ucHeap will be placed in the BSS section that is placed in the m_data_2.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;IMG alt="pastedImage_5.png" src="https://community.nxp.com/t5/image/serverpage/image-id/101047iC385696AEC7D622A/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_5.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;3,HeapSize in FreeRTOS is set as 16KB, but the project cannot run normally for memory is not enough, what may be the reason?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After setting the memory at 16 KB I can configure two tasks with 1000 size and an extra timer, maybe the memory needs it for your program is not enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know your findings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:33:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/about-FreeRTOS-heap/m-p/1010302#M6103</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-11-02T14:33:57Z</dc:date>
    </item>
  </channel>
</rss>

