<?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: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler... in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141766#M2765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The not init at reset question has been answered by CrazyCat&lt;BR /&gt;in this thread.&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=3045" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=3045&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The prm file syntax is described in the linker manual, for CW HC12 V4.5, I guess that was in its own linker/smartlinker pdf manual (inside CodeWarrior\Help\pdf), for more recent version the content has been combined into the Build_Tools_Utilities.pdf (same folder).&lt;BR /&gt;&lt;BR /&gt;Also I'm not aware of any special semantics of .common, when it comes to initialization.&lt;BR /&gt;Well, actualy we are not using that section name AFAIK, but I can guess what it is supposed to mean.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2007 15:48:12 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2007-08-02T15:48:12Z</dc:date>
    <item>
      <title>CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler and linker.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141759#M2758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Environment: CW4.5, S12XDP512, C.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have a structure&amp;nbsp;declaration as follows:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;&lt;EM&gt;typedef struct w4MsgWindowUDT_t&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; W4PositionUDT curxy;&amp;nbsp;/* the cursor current coordinates*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; W4PositionUDT orgxy;&amp;nbsp;/* the orginal coordinates, when scrolling, it will change*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; W4WindowUDT DispWin;&amp;nbsp;/* the window location and size*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; W4WindowUDT MsgWin;&amp;nbsp;&amp;nbsp;/* the window location and size*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; unsigned char IsActive ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* the tag of Active*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; unsigned char IsVisible ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* the tage of visible*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char UnitLength;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char Refresh;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsAllRowDisplayed;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsAllColDisplayed;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsEditable;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsMsgDataDirty;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsDispDataDirty;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsPhaseData;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char IsKeyEntered;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char PageNo;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char PageID;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; u_int8 (*pt2Get)(void);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; u_int8 (*pt2Put)(void);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; u_int8 (*pt2KeyProc)(void);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; struct w4MsgWindowUDT_t *hw; /* horizontal window*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct w4MsgWindowUDT_t *vw; /* vertical window*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct w4MsgWindowUDT_t *nw; /* next chained display window*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct w4MsgWindowUDT_t *ow; /* overlaped active window*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; struct w4MsgWindowUDT_t *np; /* next chained page window for data display*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char *msg;&lt;BR /&gt;}W4MsgWindowUDT;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Then, I define a variable initialized with default data:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM style=": ; font-size: 2;"&gt;/*&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur , org,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disp win&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Msg Win&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ac, Vi,UL,RF,RD,CD,ED,MD,DD,PD,KE,PN,PI,Get&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Put&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key&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; Hw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ow&amp;nbsp;&amp;nbsp;&amp;nbsp; Np*/&lt;BR /&gt;W4MsgWindowUDT Table6DW = {{1,16},{0,0},{{2,25},{8,40}},{{1,1},{31,16}},1, 1, 16, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0,&amp;amp;GetDataT6,&amp;amp;SaveDataT6,TableDataKeyProc,&amp;amp;Table6HW,&amp;amp;Table6VW,&amp;amp;Table6VW,NULL, NULL,NULL};&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;The problem is that one of the members "np" should be pointed to NULL according to declaration. However, it is pointed to a non-null data after having a check in Debug mode. It will have it right value unitl I explicitly re-assign it as NULL in my iniitial routine like this:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Table6DW.np = NULL;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I guess this CW compiler or linker cause me a lot of trouble. Since I have the samiliar code running on the Operating System OS-9 without any problem, in which I am using Radisys Hawk.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any inputs will be appreciated greately.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Pang&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 23:20:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141759#M2758</guid>
      <dc:creator>Pang</dc:creator>
      <dc:date>2007-07-31T23:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141760#M2759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Without having some real reproducible sample, I guess this issue is hard to diagnose. So let me ask for some more details.&lt;BR /&gt;What is your memory setup (memory model), prm file?&lt;BR /&gt;At which address is &lt;FONT size="2"&gt;&lt;EM&gt;W4MsgWindowUDT allocated? (check the map file)&lt;BR /&gt;Which compiler options do you use?&lt;BR /&gt;&lt;BR /&gt;Does it work when you just do a&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;W4MsgWindowUDT Table6DW = {0};&lt;BR /&gt;instead?&lt;BR /&gt;Do you use the default startup code?&lt;BR /&gt;&lt;BR /&gt;Does the initialization of some fields work?&lt;BR /&gt;&lt;BR /&gt;Is&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW a global or a local variable?&lt;BR /&gt;&lt;BR /&gt;I cannot count (no types for a lot of fields (and don't want to too)), but when I guess that&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;TableDataKeyProc matches to&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;pt2KeyProc, then there is no value for&lt;/EM&gt;&lt;/FONT&gt; &lt;FONT size="2"&gt;&lt;EM&gt;np &amp;amp; msg. Does it help when you add two additional NULL's at the end for those?&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;/DIV&gt;Anyway, the only real way to see what is wrong would be to have a complete compilable sample.&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 00:24:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141760#M2759</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-08-01T00:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141761#M2760</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;Please see my answers below. since the .map .prm is sizeable, I could not attach them here.&amp;nbsp; Could I forward them to you by email? (I need your email address) Thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Without having some real reproducible sample, I guess this issue is hard to diagnose. So let me ask for some more details. ( &lt;FONT color="#0000CC"&gt;I totally agree with you on this point&lt;/FONT&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;What is your memory setup (memory model), prm file? (Far)&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;At which address is &lt;FONT size="2"&gt;&lt;EM&gt;W4MsgWindowUDT allocated? (check the map file)&lt;BR /&gt;(&lt;FONT color="#0000ff"&gt;no memory assigned for this structure definition&lt;/FONT&gt;)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/EM&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;Which compiler options do you use?&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;-&lt;FONT color="#0000ff"&gt;CpDPAGE=0x34 -CpEPAGE=0x36 -CpGPAGE=0x10 -CpPPAGE=0x35 -CpRPAGE=0x16 -CPUHCS12X -D__FAR_DATA -Ml -OnB=b -PSegNonDef -TuC -WmsgSd1420 -WmsgSd12056&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;Does it work when you just do a&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;W4MsgWindowUDT Table6DW = {0};&lt;BR /&gt;instead? (&lt;FONT color="#0000ff"&gt;I never try this, since I am going to assign the other member in the global variable definition&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;Do you use the default startup code? &lt;FONT color="#0000ff"&gt;Yes.&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;Does the initialization of some fields work? &lt;FONT color="#0000CC"&gt;NO.&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;Is&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW a global or a local variable?&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT color="#000099"&gt;Global.&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&lt;BR /&gt;I cannot count (no types for a lot of fields (and don't want to too)), but when I guess that&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;TableDataKeyProc matches to&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;pt2KeyProc, then there is no value for&lt;/EM&gt;&lt;/FONT&gt; &lt;FONT size="2"&gt;&lt;EM&gt;np &amp;amp; msg. Does it help when you add two additional NULL's at the end for those? &lt;FONT color="#000066"&gt;&lt;FONT color="#0000ff"&gt;Yes, You're correct. However, if I do not assign "np" to NULL in a statement instead of declaration, It will not be NULL in the memory which is pointed to the wrong place and cause my problem crash. After I assign it in a statement, I will get rid of the problem.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Anyway, the only real way to see what is wrong would be to have a complete compilable sample.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 01:12:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141761#M2760</guid>
      <dc:creator>Pang</dc:creator>
      <dc:date>2007-08-01T01:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141762#M2761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;gt;Please see my answers below. since the .map .prm is sizeable, I could not attach them here.&amp;nbsp; Could I &amp;gt;forward them to you by email? (I need your email address) Thanks.&lt;BR /&gt;Well can you not just add it to this thread?&lt;BR /&gt;If the size is too big, add it in a zip file. I guess there is a lot of air in the prm/map file.&lt;BR /&gt;Also at least the prm file is hopefully not that big :smileywink:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;At which address is &lt;FONT size="2"&gt;&lt;EM&gt;W4MsgWindowUDT allocated? (check the map file)&lt;BR /&gt;&amp;gt;(&lt;FONT color="#0000ff"&gt;no memory assigned for this structure definition&lt;/FONT&gt;)&lt;BR /&gt;Ups. I did not intend to ask for the address of the type. I wanted to ask for the address of the&lt;/EM&gt;&lt;/FONT&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;variable :smileywink:.&lt;BR /&gt;So what's the address (and size) of&lt;/EM&gt;&lt;/FONT&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW?&lt;BR /&gt;&lt;BR /&gt;I would check that the variable is not allocated across a global page, well as there is just one for RAM, that's probably not the case, but something is odd. Also check in the prm file that the _COPY is not allocated banked too.&lt;BR /&gt;Also check in the prm file into what kind of section&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW is allocated, there is a segment type NO_INIT (or PAGED) for variables which are intentionally not initialized.&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;gt;Which compiler options do you use?&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;gt;-&lt;FONT color="#0000ff"&gt;CpDPAGE=0x34 -CpEPAGE=0x36 -CpGPAGE=0x10 -CpPPAGE=0x35 -CpRPAGE=0x16 -CPUHCS12X &amp;gt;-D__FAR_DATA -Ml -OnB=b -PSegNonDef -TuC -WmsgSd1420 -WmsgSd12056&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;So it's large memory model for a HCS12X. Not sure if you need all those options, but none of them should hurt.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;gt;Does it work when you just do a&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&amp;gt;W4MsgWindowUDT Table6DW = {0};&lt;BR /&gt;&amp;gt;instead? (&lt;FONT color="#0000ff"&gt;I never try this, since I am going to assign the other member in the global variable definition&lt;/FONT&gt;)&lt;BR /&gt;&lt;BR /&gt;Not sure I can follow. I just meant to check if the&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;variable is zero initialized that way. So if it is a problem with what kind of values are initialized versus if the problem is if the variable is initialized at all. Can you try?&lt;BR /&gt;Just check at the start of main if the complete&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&amp;nbsp; is 0. Don't run your app this way :smileywink:.&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Does the initialization of some fields work? &lt;FONT color="#0000CC"&gt;NO.&lt;BR /&gt;So not a single field of your variable is initialized?&lt;BR /&gt;Suspicious.&amp;nbsp; Are other global variables initialized?&lt;BR /&gt;Is any global variable initialized?&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&amp;gt;I cannot count (no types for a lot of fields (and don't want to too)), but when I guess that&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;TableDataKeyProc matches &amp;gt;to&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;pt2KeyProc, then there is no value for&lt;/EM&gt;&lt;/FONT&gt; &lt;FONT size="2"&gt;&lt;EM&gt;np &amp;amp; msg. Does it help when you add two additional NULL's at the end for &amp;gt;those? &lt;FONT color="#000066"&gt;&lt;FONT color="#0000ff"&gt;Yes, You're correct. However, if I do not assign "np" to NULL in a statement instead of declaration, It will not &amp;gt;be NULL in the memory which is pointed to the wrong place and cause my problem crash. After I assign it in a &amp;gt;statement, I will get rid of the problem.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;I got that, but assigning NULL in main does not mean not to assign NULL in the definition too.&lt;BR /&gt;Actually you are assigning NULL in the definition too, just not explicitly. Given your explanation I assume that explicitly adding NULL in the initialization list does not change anything. Well it should not change anything, it should be zero initialized either way.&lt;BR /&gt;&lt;BR /&gt;What I would check is how _COPY is allocated in your prm and how the segment you place &lt;EM&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&amp;nbsp; in is defined.&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Same as before, in the end a reproducible sample would be the best way to understand this. Second best, I guess would be the map and prm file, maybe there is something problematic in there too.&lt;BR /&gt;&lt;BR /&gt;Also do you get any warnings from the linker or compiler? (the two you did disable in the compiler options &lt;FONT size="2"&gt;&lt;EM&gt;&lt;FONT color="#0000ff"&gt;-WmsgSd1420 -WmsgSd12056&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt; are not problematic)&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 02:03:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141762#M2761</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-08-01T02:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141763#M2762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;Please check the attachements and my&amp;nbsp;answers in &lt;FONT color="#ff0000"&gt;RED&lt;/FONT&gt;. Thanks a lot.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;Please see my answers below. since the .map .prm is sizeable, I could not attach them here.&amp;nbsp; Could I &amp;gt;forward them to you by email? (I need your email address) Thanks.&lt;BR /&gt;Well can you not just add it to this thread?&lt;BR /&gt;If the size is too big, add it in a zip file. I guess there is a lot of air in the prm/map file.&lt;BR /&gt;Also at least the prm file is hopefully not that big :smileywink: (&lt;FONT color="#ff0000"&gt;Got it, &lt;IMG alt=":smileyembarrassed:" class="emoticon emoticon-smileyembarrassed" id="smileyembarrassed" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-embarrassed.gif" title="Smiley Embarassed" /&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;At which address is &lt;FONT size="2"&gt;&lt;EM&gt;W4MsgWindowUDT allocated? (check the map file)&lt;BR /&gt;&amp;gt;(&lt;FONT color="#0000ff"&gt;no memory assigned for this structure definition&lt;/FONT&gt;)&lt;BR /&gt;Ups. I did not intend to ask for the address of the type. I wanted to ask for the address of the&lt;/EM&gt;&lt;/FONT&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;variable :smileywink:.&lt;BR /&gt;So what's the address (and size) of&lt;/EM&gt;&lt;/FONT&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW?&amp;nbsp; (&lt;FONT color="#ff0000"&gt;102D3A'G&lt;/FONT&gt;)&lt;BR /&gt;&lt;BR /&gt;I would check that the variable is not allocated across a global page, well as there is just one for RAM, that's probably not the case, but something is odd. Also check in the prm file that the _COPY is not allocated banked too.&lt;BR /&gt;Also check in the prm file into what kind of section&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW is allocated, there is a segment type NO_INIT (or PAGED) for variables which are intentionally not initialized. &lt;FONT color="#ff0000"&gt;(Please check this for me, I am not clear about this part)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;gt;Which compiler options do you use?&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;gt;-&lt;FONT color="#0000ff"&gt;CpDPAGE=0x34 -CpEPAGE=0x36 -CpGPAGE=0x10 -CpPPAGE=0x35 -CpRPAGE=0x16 -CPUHCS12X &amp;gt;-D__FAR_DATA -Ml -OnB=b -PSegNonDef -TuC -WmsgSd1420 -WmsgSd12056&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;So it's large memory model for a HCS12X. Not sure if you need all those options, but none of them should hurt.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;gt;Does it work when you just do a&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&amp;gt;W4MsgWindowUDT Table6DW = {0};&lt;BR /&gt;&amp;gt;instead? (&lt;FONT color="#0000ff"&gt;I never try this, since I am going to assign the other member in the global variable definition&lt;/FONT&gt;)&lt;BR /&gt;&lt;BR /&gt;Not sure I can follow. I just meant to check if the&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;variable is zero initialized that way. So if it is a problem with what kind of values are initialized versus if the problem is if the variable is initialized at all. Can you try?&lt;BR /&gt;Just check at the start of main if the complete&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&amp;nbsp; is 0. Don't run your app this way :smileywink:. &lt;FONT color="#ff0000"&gt;(not all zeros,)&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Does the initialization of some fields work? &lt;FONT color="#0000CC"&gt;NO.&lt;BR /&gt;So not a single field of your variable is initialized?&lt;BR /&gt;Suspicious.&amp;nbsp; Are other global variables initialized?&lt;BR /&gt;Is any global variable initialized?&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT size="2"&gt;&amp;gt;I cannot count (no types for a lot of fields (and don't want to too)), but when I guess that&lt;/FONT&gt;&lt;/EM&gt; &lt;EM&gt;&lt;FONT size="2"&gt;TableDataKeyProc matches &amp;gt;to&lt;/FONT&gt;&lt;/EM&gt; &lt;FONT size="2"&gt;&lt;EM&gt;pt2KeyProc, then there is no value for&lt;/EM&gt;&lt;/FONT&gt; &lt;FONT size="2"&gt;&lt;EM&gt;np &amp;amp; msg. Does it help when you add two additional NULL's at the end for &amp;gt;those? &lt;FONT color="#000066"&gt;&lt;FONT color="#0000ff"&gt;Yes, You're correct. However, if I do not assign "np" to NULL in a statement instead of declaration, It will not &amp;gt;be NULL in the memory which is pointed to the wrong place and cause my problem crash. After I assign it in a &amp;gt;statement, I will get rid of the problem.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;I got that, but assigning NULL in main does not mean not to assign NULL in the definition too.&lt;BR /&gt;Actually you are assigning NULL in the definition too, just not explicitly. Given your explanation I assume that explicitly adding NULL in the initialization list does not change anything. Well it should not change anything, it should be zero initialized either way.&lt;BR /&gt;&lt;BR /&gt;What I would check is how _COPY is allocated in your prm and how the segment you place &lt;EM&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Table6DW&amp;nbsp; in is defined.&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Same as before, in the end a reproducible sample would be the best way to understand this. Second best, I guess would be the map and prm file, maybe there is something problematic in there too.&lt;BR /&gt;&lt;BR /&gt;Also do you get any warnings from the linker or compiler? (the two you did disable in the compiler options &lt;FONT size="2"&gt;&lt;EM&gt;&lt;FONT color="#0000ff"&gt;-WmsgSd1420 -WmsgSd12056&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt; are not problematic)&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 03:39:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141763#M2762</guid>
      <dc:creator>Pang</dc:creator>
      <dc:date>2007-08-01T03:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141764#M2763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Looks like the attached map file was generated with the ={0} value in the code,&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Table6DW got allocated in .bss (which means its value is just 0 init).&lt;BR /&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;I think here's the problem (out of the prm):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GLOBAL_CS2&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x100000'G TO 0x1FFFFF'G;&lt;BR /&gt;&lt;BR /&gt;That is not working as with this, global areas are crossing GPAGE page boundaries.&lt;BR /&gt;Split that up into 64k chunks, each with its own distinct and fixed GPAGE value.&lt;BR /&gt;E.g.:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GLOBAL_CS2_0 &amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x100000'G TO 0x10FFFF'G;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GLOBAL_CS2_1 &amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x110000'G TO 0x11FFFF'G;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GLOBAL_CS2_2 &amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x120000'G TO 0x12FFFF'G;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GLOBAL_CS2_3 &amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x130000'G TO 0x13FFFF'G;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;DEFAULT_RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp; GLOBAL_CS2_0,GLOBAL_CS2_1,GLOBAL_CS2_2,GLOBAL_CS2_3...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The actual problem why the initialization does not work in your particular case is&amp;nbsp; because the linker is defining one zero out area of 205836 bytes (out of the map file):&lt;BR /&gt;&lt;BR /&gt;extern struct _tagStartup {&lt;BR /&gt;&amp;nbsp; unsigned nofZeroOut&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;&amp;nbsp; _Range&amp;nbsp;&amp;nbsp; pZeroOut&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x100000'G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 205836&lt;BR /&gt;&amp;nbsp; _Copy&amp;nbsp;&amp;nbsp;&amp;nbsp; *toCopyDownBeg 0xCC7F&lt;BR /&gt;} _startupData;&lt;BR /&gt;&lt;BR /&gt;That size is cutted to 16 bits when it is written into the startup information. I would expect the linker to issue a warning for that cut operation, id you get any?&lt;BR /&gt;&lt;BR /&gt;Here's BTW also the variable crossing the page boundary. This LCDRxdBuffer buffer does not work this way.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCDRxdBuffer&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10FFC4'G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 64&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&amp;nbsp;&amp;nbsp; .common&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCDRxdBufferPtr&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 110028'G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14&amp;nbsp;&amp;nbsp; .common&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;See also &lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=2565" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=2565&lt;/A&gt;&lt;BR /&gt;about why there is this 64k limitation.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 05:53:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141764#M2763</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-08-01T05:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141765#M2764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;After&amp;nbsp;I changed it to smalll chuncks, there is no cutting value warning issued. All the initializations works fine. Thanks a lot for your help.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;One question, If I want to allocate these&amp;nbsp;three variables into .common.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;unsigned short rtcSecondOld; // last second record when power surge occurs&lt;/DIV&gt;&lt;DIV&gt;unsigned short ResumeTimer; // Flag to identify power surge&lt;/DIV&gt;&lt;DIV&gt;unsigned short ResumeTimeC; // as one's compliment of ResumeTimer.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I use these two variables to monitor what time power surge happens and how it lasts.&amp;nbsp; I deal with these values in one XIRQ, then when RESET signal&amp;nbsp; restart my appplication, it will check if the flag is set and it lasts more than 2 seconds, it will return to where it was. Therefore, I want to keep them intact when startup. How&amp;nbsp; can I declare them in .common?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;By the way, where to get documentation about .prm for details?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks a lot again&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Pang&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 03:36:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141765#M2764</guid>
      <dc:creator>Pang</dc:creator>
      <dc:date>2007-08-02T03:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141766#M2765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The not init at reset question has been answered by CrazyCat&lt;BR /&gt;in this thread.&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=3045" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=3045&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The prm file syntax is described in the linker manual, for CW HC12 V4.5, I guess that was in its own linker/smartlinker pdf manual (inside CodeWarrior\Help\pdf), for more recent version the content has been combined into the Build_Tools_Utilities.pdf (same folder).&lt;BR /&gt;&lt;BR /&gt;Also I'm not aware of any special semantics of .common, when it comes to initialization.&lt;BR /&gt;Well, actualy we are not using that section name AFAIK, but I can guess what it is supposed to mean.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 15:48:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141766#M2765</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-08-02T15:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: CW4.5 Compiler or Linker Trouble? The same code without any problem in other OS compiler...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141767#M2766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To close the loop here, according to my understanding here is how the HC08/HC12 compiler allocates the data in default segments.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &lt;DIV class="O" shape="_x0000_s1026"&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;.data&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;: &lt;SPAN style="WIDTH: 0.26%; mso-tab-count: 1"&gt;&lt;/SPAN&gt;&amp;nbsp; Contains the initialized global variables.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;SPAN style="WIDTH: 19.36%; mso-tab-count: 2"&gt;&lt;/SPAN&gt;e.g. int&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;U&gt;a&lt;/U&gt;&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;= 1,&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;U&gt;b&lt;/U&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;= 2;&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288; mso-line-spacing: '100 50 0'; mso-char-wrap: 1; mso-kinsoku-overflow: 1"&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;.bss&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;: &lt;SPAN style="WIDTH: 1.96%; mso-tab-count: 1"&gt;&lt;/SPAN&gt;Contains the static un-initialized global variables.&lt;/SPAN&gt; &lt;DIV class="O" shape="_x0000_s1026"&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;SPAN style="WIDTH: 18.28%; mso-tab-count: 2"&gt;&lt;/SPAN&gt;e.g. static int&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;U&gt;c, d&lt;/U&gt;&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;;&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288; mso-line-spacing: '100 50 0'; mso-char-wrap: 1; mso-kinsoku-overflow: 1"&gt;&lt;DIV class="O" shape="_x0000_s1026"&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;.common&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;: Contains the un-initialized global variables (not static).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;SPAN style="WIDTH: 17.26%; mso-tab-count: 2"&gt;&lt;/SPAN&gt;e.g. int&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;U&gt;e, f&lt;/U&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288; mso-line-spacing: '100 50 0'; mso-char-wrap: 1; mso-kinsoku-overflow: 1"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;.rodata&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;: Contains the constant variables .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class="O" shape="_x0000_s1026"&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;DIV class="O" shape="_x0000_s1026"&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN&gt;&lt;SPAN style="WIDTH: 20.14%; mso-tab-count: 2"&gt;&lt;/SPAN&gt;e.g. const int &lt;U&gt;c1=2, c2=4&lt;/U&gt;&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288; mso-line-spacing: '100 50 0'; mso-char-wrap: 1; mso-kinsoku-overflow: 1"&gt;&lt;/DIV&gt;&lt;/DIV&gt;.rodata1&lt;/DIV&gt;&lt;/DIV&gt; &lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;: Contains all the string constants.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;/SPAN&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="WIDTH: 19.03%; mso-tab-count: 2"&gt;&lt;/SPAN&gt;e.g. #define mystr = “&lt;/DIV&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;U&gt;Hello world&lt;/U&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;”&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;I hope it clarifies things a bit.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="mso-margin-left-alt: 288; mso-line-spacing: '100 50 0'; mso-char-wrap: 1; mso-kinsoku-overflow: 1"&gt;&lt;DIV class="O" shape="_x0000_s1026"&gt;CrasyCat&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 16:06:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CW4-5-Compiler-or-Linker-Trouble-The-same-code-without-any/m-p/141767#M2766</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-08-02T16:06:14Z</dc:date>
    </item>
  </channel>
</rss>

