<?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: CW50 Linker Error: in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141229#M2650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello David,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The &lt;U&gt;default&lt;/U&gt; PRM file for the QB8 specifies DEFAULT_RAM&amp;nbsp;INTO RAM.&amp;nbsp; The RAM segment occupies 0x0100 TO 0x013F, a total of 64 bytes only, for both stack and global variables.&amp;nbsp; The default STACKSIZE is 0x30 (48 bytes), leaving only 16 bytes total for global variables.&amp;nbsp; I think this may be your present problem, especially if the buffer size exceeds 16 bytes.&amp;nbsp; The global buffer inbuff[] would need to be allocated to the Z_RAM segment to avoid this, possibly by the modified placement of DEFAULT_RAM INTO Z_RAM.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;It is also problematic&amp;nbsp;if the stack size should need to exceed 64 bytes.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;This means that, for the majority of projects, the default PRM settings provided by CW new&amp;nbsp;project wizard are quite inappropriate when using the QB8 device.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Dec 2006 01:52:13 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2006-12-29T01:52:13Z</dc:date>
    <item>
      <title>CW50 Linker Error:</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141227#M2648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am working with the&amp;nbsp;MC908QB8&amp;nbsp;Demo Board and CW50. I am getting the linker error "L1102: Out of allocation space in segment RAM at address 0x117" when the following line of code is added:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inbuff[index] = RChar; //save received char&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This code takes the SCI received byte and saves it to an input buffer. (the variable "index" is set to 0)&lt;/DIV&gt;&lt;DIV&gt;Both "RChar" and "inbuff" variables are declard as type "byte". The line of code is not adding any new variables, so&amp;nbsp;I am stick on this error.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any thoughts?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TIA,&lt;/DIV&gt;&lt;DIV&gt;David Evennou&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2006 03:20:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141227#M2648</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2006-12-28T03:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: CW50 Linker Error:</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141228#M2649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am not sure why you are receiving this error.&amp;nbsp; Maybe someone with more expertise will answer that for you.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Usually&amp;nbsp;I suggest the following to fix the&amp;nbsp;"L1102" error:&lt;/DIV&gt;&lt;DIV&gt;Increase the segment in your prm file or try to add compiler options to reduce the size of your datas/ram.&lt;/DIV&gt;&lt;DIV&gt;For more details and examples, check the smartlinker manual.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Nina&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2006 07:13:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141228#M2649</guid>
      <dc:creator>NLFSJ</dc:creator>
      <dc:date>2006-12-28T07:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: CW50 Linker Error:</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141229#M2650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello David,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The &lt;U&gt;default&lt;/U&gt; PRM file for the QB8 specifies DEFAULT_RAM&amp;nbsp;INTO RAM.&amp;nbsp; The RAM segment occupies 0x0100 TO 0x013F, a total of 64 bytes only, for both stack and global variables.&amp;nbsp; The default STACKSIZE is 0x30 (48 bytes), leaving only 16 bytes total for global variables.&amp;nbsp; I think this may be your present problem, especially if the buffer size exceeds 16 bytes.&amp;nbsp; The global buffer inbuff[] would need to be allocated to the Z_RAM segment to avoid this, possibly by the modified placement of DEFAULT_RAM INTO Z_RAM.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;It is also problematic&amp;nbsp;if the stack size should need to exceed 64 bytes.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;This means that, for the majority of projects, the default PRM settings provided by CW new&amp;nbsp;project wizard are quite inappropriate when using the QB8 device.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 01:52:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141229#M2650</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-12-29T01:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: CW50 Linker Error:</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141230#M2651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi Mac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You are correct&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; That is exactly what is happening. I suspect that the&amp;nbsp;line of code&amp;nbsp;I posted will "make use of the stack" for the array variable assignment and therfore caused the linker error even though no new variables were allocated. I changed the stack size to 32 bytes and the linker error has been removed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your help!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;David&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 21:26:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141230#M2651</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2006-12-29T21:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: CW50 Linker Error:</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141231#M2652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello David,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I think I need to make a couple of additional&amp;nbsp;comments -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The &lt;FONT face="Courier New"&gt;inbuf[]&lt;/FONT&gt; array variable will likely need to be allocated as a global variable, rather than a local variable on the stack.&amp;nbsp; This is required so that&amp;nbsp;writing&amp;nbsp;to the buffer, and the reading of the buffer contents can be handled by two separate functions, with both having access to the buffer.&amp;nbsp; Ultimately, the buffer write process could be handled by an ISR.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;If you are programming in C, reducing the allocated stack size ia probably not a good idea.&amp;nbsp; While your program may compile and link without error, during normal operation of&amp;nbsp; the&amp;nbsp;program, the stack may attempt to over-write the global variables anyway.&amp;nbsp; This type of bug may be very&amp;nbsp;difficult to diagnose.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;So it is a very good idea to keep the global variables, including the buffer, well separated from the stack.&amp;nbsp; With the default PRM settings, Z_RAM segment does not get used for anything, but this would seem&amp;nbsp;the obvious place to locate the globals.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Dec 2006 01:22:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW50-Linker-Error/m-p/141231#M2652</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-12-31T01:22:07Z</dc:date>
    </item>
  </channel>
</rss>

