<?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: malloc() fails on XDP512 (HCS12x) in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/malloc-fails-on-XDP512-HCS12x/m-p/132787#M1761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#333300"&gt;Hi Vignesh,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#333300"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;Please check the Project settings and ensure that you selected ANSI C start up, think you are currently using minimal startup code settings.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;If you are application requires less than 2000 bytes of heap then you can open the Freescale\CW for HC12 V4.5\lib\hc12c\hc12_lib.mcp project and select the type of .lib u need to compile. Open the stdlib.c and from includes open the libdefs.h header file and change the #define LIBDEF_HEAPSIZE 2000 to required size in order to save the RAM.Compile the lib project and include the new .lib file for your porject.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300" face="Trebuchet MS" size="2"&gt;Have a nice time.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;Please feel free to revert for any further clarification in this regard&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;With Best Regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300" face="Trebuchet MS" size="2"&gt;Padmakumar&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Oct 2006 14:13:49 GMT</pubDate>
    <dc:creator>pappan</dc:creator>
    <dc:date>2006-10-12T14:13:49Z</dc:date>
    <item>
      <title>malloc() fails on XDP512 (HCS12x)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/malloc-fails-on-XDP512-HCS12x/m-p/132786#M1760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We're have an issue with the malloc() command on the MC9S12XDP512 controller (SK-S12XDP512-A EVB) with CodeWarrior for HCS12x v5.7.0. malloc() doesn't seem to work. It doesn't produce any complier or linker warnings. BUT the return pointer points to an address in the EEPROM (the returned pointer value was 0x824). Stepping through the code, we see that the heap_end starts at 0xc000 (flash memory). None of this seems right, but we can't find out how to fix the issue -- possibly some variable somewhere needs to get the right initial value of the memory space or something like that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We've tried this out with a dummy program with just a main() and malloc() and it still doesn't work -- that is, its not a stack overflow or something running out of memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vignesh.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2006 17:28:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/malloc-fails-on-XDP512-HCS12x/m-p/132786#M1760</guid>
      <dc:creator>VigneshGanesan</dc:creator>
      <dc:date>2006-10-11T17:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: malloc() fails on XDP512 (HCS12x)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/malloc-fails-on-XDP512-HCS12x/m-p/132787#M1761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#333300"&gt;Hi Vignesh,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#333300"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;Please check the Project settings and ensure that you selected ANSI C start up, think you are currently using minimal startup code settings.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;If you are application requires less than 2000 bytes of heap then you can open the Freescale\CW for HC12 V4.5\lib\hc12c\hc12_lib.mcp project and select the type of .lib u need to compile. Open the stdlib.c and from includes open the libdefs.h header file and change the #define LIBDEF_HEAPSIZE 2000 to required size in order to save the RAM.Compile the lib project and include the new .lib file for your porject.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300" face="Trebuchet MS" size="2"&gt;Have a nice time.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;Please feel free to revert for any further clarification in this regard&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Trebuchet MS"&gt;&lt;FONT color="#333300"&gt;With Best Regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300" face="Trebuchet MS" size="2"&gt;Padmakumar&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2006 14:13:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/malloc-fails-on-XDP512-HCS12x/m-p/132787#M1761</guid>
      <dc:creator>pappan</dc:creator>
      <dc:date>2006-10-12T14:13:49Z</dc:date>
    </item>
  </channel>
</rss>

