<?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: default malloc behavior in MCUXpresso SDK example in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1533081#M21897</link>
    <description>&lt;P&gt;Jing,&lt;/P&gt;&lt;P&gt;Yes I noticed HEAP_SIZE in armgcc/MIMXRT1176xxxxx_cm7_ram.ld file:&lt;/P&gt;&lt;PRE&gt;HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;&lt;/PRE&gt;&lt;P&gt;This reads to 1KB size in my test app.elf.&lt;/P&gt;&lt;P&gt;But this seems have no control for the "malloc()" function of&amp;nbsp; armgcc as I can make bigger "malloc()" successfully. This is why I raised this ticket.&lt;/P&gt;&lt;P&gt;Now I guess that the malloc() implementation of ARMGCC may lacks respect to linker descriptor definitions thus I can make larger allocatons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;yf2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 06:09:09 GMT</pubDate>
    <dc:creator>yf2</dc:creator>
    <dc:date>2022-10-12T06:09:09Z</dc:date>
    <item>
      <title>default malloc behavior in MCUXpresso SDK example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1516108#M21438</link>
      <description>&lt;P&gt;Dear support,&lt;/P&gt;&lt;P&gt;I am using MCUXpresso SDK v2.11 and ARMGCC toolchain with a rt1170-evk board.&lt;/P&gt;&lt;P&gt;I noticed the default heap size in my .elf file is only 1KB (learnt by arm-none-eabi-objdump command) , but my app can successfully malloc() 16KB.&lt;/P&gt;&lt;P&gt;So my question is how the malloc library figures out the correct heap size?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;yf2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 08:13:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1516108#M21438</guid>
      <dc:creator>yf2</dc:creator>
      <dc:date>2022-09-02T08:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: default malloc behavior in MCUXpresso SDK example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1516874#M21465</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203381"&gt;@yf2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can set heap size at here, by right click the project and select Properties.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jingpan_0-1662366147108.png" style="width: 727px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/192468i60CAFBA488D81770/image-dimensions/727x692?v=v2" width="727" height="692" role="button" title="jingpan_0-1662366147108.png" alt="jingpan_0-1662366147108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 08:25:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1516874#M21465</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2022-09-05T08:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: default malloc behavior in MCUXpresso SDK example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1523820#M21669</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/61241"&gt;@jingpan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing the screenshot, but I am not using the MCUXpresso IDE.&lt;/P&gt;&lt;P&gt;I simply used $SDK/tools/cmake_tool_chain_files/ to build my program. It seems that the heap/stack sizes in the generated .elf file are very small but at runtime in main() the effective stack and heap sizes are much bigger as I can malloc() 16KB blocks and I can define 12KB stack variables.&lt;/P&gt;&lt;P&gt;I am just wondering where the magic happens?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;yf2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 07:02:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1523820#M21669</guid>
      <dc:creator>yf2</dc:creator>
      <dc:date>2022-09-17T07:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: default malloc behavior in MCUXpresso SDK example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1524150#M21680</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203381"&gt;@yf2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think this is because gcc malloc doesn't check if the operation will overflow. It is not recommend to use malloc in embedded system.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These is *.ld files in armgcc folder. It defines&amp;nbsp;HEAP_SIZE and&amp;nbsp;STACK_SIZE. You can modify them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-RT/Malloc-failed-in-RT1060-EVK-project-CSI-RGB565/m-p/819249" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/Malloc-failed-in-RT1060-EVK-project-CSI-RGB565/m-p/819249&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 08:48:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1524150#M21680</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2022-09-19T08:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: default malloc behavior in MCUXpresso SDK example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1533081#M21897</link>
      <description>&lt;P&gt;Jing,&lt;/P&gt;&lt;P&gt;Yes I noticed HEAP_SIZE in armgcc/MIMXRT1176xxxxx_cm7_ram.ld file:&lt;/P&gt;&lt;PRE&gt;HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;&lt;/PRE&gt;&lt;P&gt;This reads to 1KB size in my test app.elf.&lt;/P&gt;&lt;P&gt;But this seems have no control for the "malloc()" function of&amp;nbsp; armgcc as I can make bigger "malloc()" successfully. This is why I raised this ticket.&lt;/P&gt;&lt;P&gt;Now I guess that the malloc() implementation of ARMGCC may lacks respect to linker descriptor definitions thus I can make larger allocatons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;yf2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 06:09:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/default-malloc-behavior-in-MCUXpresso-SDK-example/m-p/1533081#M21897</guid>
      <dc:creator>yf2</dc:creator>
      <dc:date>2022-10-12T06:09:09Z</dc:date>
    </item>
  </channel>
</rss>

