<?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>CodeWarrior for MCUのトピックRe: CONST in banked Memory.</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136313#M1827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I claim victory too early! 8-(&lt;BR /&gt;&lt;BR /&gt;I have two problem:&lt;BR /&gt;&lt;BR /&gt;the first :&lt;BR /&gt;&lt;BR /&gt;The array of string are partially in low ROM :&lt;BR /&gt;in .h :&lt;BR /&gt;extern const char *__far MessageDef [];&lt;BR /&gt;&lt;BR /&gt;in .c :&lt;BR /&gt;const char *__far MessageDef [lgMessageDef]=&lt;BR /&gt;{&lt;BR /&gt;"",&lt;BR /&gt;"password",&lt;BR /&gt;...................&lt;BR /&gt;"",&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;and in the .map i fund :&lt;BR /&gt;------- ROM-ADDRESS: 0xEA00 ---- RAM-ADDRESS: 0x1D2A ---- SIZE 300 ---&lt;BR /&gt;Name of initialized Object : MessageDef&lt;BR /&gt;38823F3882 4038824D38 8260388273&lt;BR /&gt;3882863882 8738828838 828938828A&lt;BR /&gt;38828B3882 8C38828D38 828E38828F.........&lt;BR /&gt;&lt;BR /&gt;the string are allready in my banked rom but how to put that in the banked rom too ?&lt;BR /&gt;&lt;BR /&gt;and my second problem look the same it's with arrays like :&lt;BR /&gt;&lt;BR /&gt;in .h :&lt;BR /&gt;extern unsigned int* tSL[];&lt;BR /&gt;&lt;BR /&gt;in .c :&lt;BR /&gt;unsigned int* tSL[32]=&lt;BR /&gt;{&lt;BR /&gt;&amp;amp;C1,&lt;BR /&gt;NULL,&lt;BR /&gt;....&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;------- ROM-ADDRESS: 0xE8C3 ---- RAM-ADDRESS: 0x1BB4 ---- SIZE 2 ---&lt;BR /&gt;Name of initialized Object : tSL&lt;BR /&gt;204E&lt;BR /&gt;&lt;BR /&gt;the needing is the same... I need to have nothing of this part of my program in the ROM (only in the chosen two banked rom).&lt;BR /&gt;&lt;BR /&gt;Someone have an idea or have done the same in the past?&lt;BR /&gt;&lt;BR /&gt;hdan.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2007 21:20:52 GMT</pubDate>
    <dc:creator>hdan</dc:creator>
    <dc:date>2007-06-20T21:20:52Z</dc:date>
    <item>
      <title>CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136306#M1820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I work on a s12DG256 with CW 3.1 and SofTec inDart.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to put my const in banked memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include /* common defines and macros */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include /* derivative information */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma LINK_INFO DERIVATIVE "mc9s12dg256b"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;int nCar=12;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma CONST_SEG __PPAGE_SEG CONST_USER&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;const far int tada0=0x6655;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const far unsigned char Array[10] = {0xB9, 0xED};&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma CONST_SEG DEFAULT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void main(void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (nCar &amp;gt; tada0) nCar = tada0 + Array[0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for(;&lt;/SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;SPAN&gt; {} /* wait forever */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In map file (SofTec.map)I found :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*********************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SECTION-ALLOCATION SECTION&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Section Name Size Type From To Segment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.init 69 R 0xC000 0xC044 ROM_C000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.startData 31 R 0xC045 0xC063 ROM_C000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NON_BANKED 14 R 0xC064 0xC071 ROM_C000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.copy 8 R 0xC072 0xC079 ROM_C000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.text 25 R 0x308000 0x308018 PAGE_30&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CONST_USER 10 R 0x398000 0x398009 PAGE_39&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.data 2 R/W 0x1000 0x1001 RAM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;quite good my array is in the right place but ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NOT USED VARIABLES&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;main.c.o:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tada0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tada0 is not in CONST_SEG !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I look to compiler option&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Cc -CpPPAGE=RUNTIME -D_HCS12 -D__NO_FLOAT__ -Lp=%n.pre -Mb -Onca -OnCstVa&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-OnCstVar is check ( disable const variable by const replacement )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What can i do? where is my mistake? I turn in round on this question for a long time...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 16:56:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136306#M1820</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-08T16:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136307#M1821</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;If you want to link the constant tada0 to your application even though it is not used, you can&lt;/DIV&gt;&lt;DIV&gt;disable smart linking for that variable in the linker .prm file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Just add following line to the .prm file:&lt;/DIV&gt;&lt;DIV&gt;ENTRIES&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; tada0&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 18:16:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136307#M1821</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-06-08T18:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136308#M1822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The subject looks a bit off topic as the problem is the constant replacement and has nothing to do with banked memory.&lt;BR /&gt;Anyway, the second time today that I write this is a known bug, this time its actually a bug fixed quite some time ago, since HC12 V4.0, below the snippet out of the release notes.&lt;BR /&gt;&lt;BR /&gt;If you really must not have the constant folding taking place you could&lt;BR /&gt;- make it volatile&lt;BR /&gt;- update the compiler, (not sure if this is an option)&lt;BR /&gt;- change the code so the compiler only sees an extern declaration of tada0, and not the definition.&lt;BR /&gt;&lt;BR /&gt;In the end, why is the constant folding actually a problem? This is obviously a simplified sample, but I wonder why the folding should not take place.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;List of fixed Bugs since HCS12X V4.0 rc&lt;BR /&gt;..&amp;nbsp;&amp;nbsp;&lt;BR /&gt;- WB1-51395: constants were replaces although option -OnCstVar was specified&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 18:17:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136308#M1822</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-06-08T18:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136309#M1823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;thanks for your quick response.&lt;BR /&gt;&lt;BR /&gt;How to upgrade my compiler ? I'm quite affraid to make a mistake. Is there a document who explain that?&lt;BR /&gt;&lt;BR /&gt;hdan.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 19:14:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136309#M1823</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-08T19:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136310#M1824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;hello,&lt;BR /&gt;&lt;BR /&gt;I really need to put these data in specified Page.&lt;BR /&gt;&lt;BR /&gt;my application is an industrial controler. There is two part of program:&lt;BR /&gt;- first part is the "core program" all the industrial controler have this program.&lt;BR /&gt;- second part is the "user program" specific to the machine.&lt;BR /&gt;&lt;BR /&gt;the second part is recorded in EEPROM and can change with the evolution of the machine.&lt;BR /&gt;&lt;BR /&gt;I have a lot of const, array and some code to put in 2 banked memories.&lt;BR /&gt;&lt;BR /&gt;you say :&lt;BR /&gt;- make it volatile&lt;BR /&gt;- update the compiler, (not sure if this is an option)&lt;BR /&gt;- change the code so the compiler only sees an extern declaration of tada0, and not the definition.&lt;BR /&gt;&lt;BR /&gt;- make it volatile : i can't store a volatile in banked memory (R/W needed)&lt;BR /&gt;- update the compiler (realy update or buy a new one ?)&lt;BR /&gt;- change the code... could you explain me I try to declare with extern but it do the same (i think i haven't understood)&lt;BR /&gt;&lt;BR /&gt;thanks for all...&lt;BR /&gt;hdan&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 21:48:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136310#M1824</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-08T21:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136311#M1825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;- make it volatile : i can't store a volatile in banked memory (R/W needed)&lt;BR /&gt;Why not?&lt;BR /&gt;Volatile means that accessing the variable has side effects, so the compiler has to perform every access and is not allowed to optimize them away. That is completely independent of const. const means it cannot be written. A variable can be const and volatile at once, for example a read only real time counter could be declared naturally as volatile const.&lt;BR /&gt;&lt;BR /&gt;- update the compiler (realy update or buy a new one ?)&lt;BR /&gt;Well, could be buy one. But I don't know the details there.&lt;BR /&gt;&lt;BR /&gt;- change the code... could you explain me I try to declare with extern but it do the same (i think i haven't understood)&lt;BR /&gt;If the compiler does not see the actual initialization value when it compiles the code, it wont do any constant folding.&lt;BR /&gt;e.g.&lt;BR /&gt;a.h:&lt;BR /&gt;#pragma CONST_SEG __PPAGE_SEG CONST_USER&lt;BR /&gt;extern const int tada0;&lt;BR /&gt;#pragma CONST_SEG DEFAULT&lt;BR /&gt;&lt;BR /&gt;a.c:&lt;BR /&gt;#include "a.h"&lt;BR /&gt;#pragma CONST_SEG __PPAGE_SEG CONST_USER&lt;BR /&gt;const int tada0=0x12345;&lt;BR /&gt;#pragma CONST_SEG DEFAULT&lt;BR /&gt;&lt;BR /&gt;b.c:&lt;BR /&gt;#include "a.h"&lt;BR /&gt;int useTada(void) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return tada0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Actually it's sufficient if the compiler definition of the code using the constant is before the definition of the constant (but after a declaration of the constant, of course), it can be in the same file. I did just split the parts up into several files to be even more explicit.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jun 2007 03:51:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136311#M1825</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-06-09T03:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136312#M1826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;hello,&lt;BR /&gt;&lt;BR /&gt;That's solve my problem.&lt;BR /&gt;&lt;BR /&gt;I already use extern definition. I move the link order and be careful with all mu declaration and it 's good now.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;( I never use volatile const before I still to think it's curious but why not :smileyhappy:&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 17:22:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136312#M1826</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-19T17:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136313#M1827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I claim victory too early! 8-(&lt;BR /&gt;&lt;BR /&gt;I have two problem:&lt;BR /&gt;&lt;BR /&gt;the first :&lt;BR /&gt;&lt;BR /&gt;The array of string are partially in low ROM :&lt;BR /&gt;in .h :&lt;BR /&gt;extern const char *__far MessageDef [];&lt;BR /&gt;&lt;BR /&gt;in .c :&lt;BR /&gt;const char *__far MessageDef [lgMessageDef]=&lt;BR /&gt;{&lt;BR /&gt;"",&lt;BR /&gt;"password",&lt;BR /&gt;...................&lt;BR /&gt;"",&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;and in the .map i fund :&lt;BR /&gt;------- ROM-ADDRESS: 0xEA00 ---- RAM-ADDRESS: 0x1D2A ---- SIZE 300 ---&lt;BR /&gt;Name of initialized Object : MessageDef&lt;BR /&gt;38823F3882 4038824D38 8260388273&lt;BR /&gt;3882863882 8738828838 828938828A&lt;BR /&gt;38828B3882 8C38828D38 828E38828F.........&lt;BR /&gt;&lt;BR /&gt;the string are allready in my banked rom but how to put that in the banked rom too ?&lt;BR /&gt;&lt;BR /&gt;and my second problem look the same it's with arrays like :&lt;BR /&gt;&lt;BR /&gt;in .h :&lt;BR /&gt;extern unsigned int* tSL[];&lt;BR /&gt;&lt;BR /&gt;in .c :&lt;BR /&gt;unsigned int* tSL[32]=&lt;BR /&gt;{&lt;BR /&gt;&amp;amp;C1,&lt;BR /&gt;NULL,&lt;BR /&gt;....&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;------- ROM-ADDRESS: 0xE8C3 ---- RAM-ADDRESS: 0x1BB4 ---- SIZE 2 ---&lt;BR /&gt;Name of initialized Object : tSL&lt;BR /&gt;204E&lt;BR /&gt;&lt;BR /&gt;the needing is the same... I need to have nothing of this part of my program in the ROM (only in the chosen two banked rom).&lt;BR /&gt;&lt;BR /&gt;Someone have an idea or have done the same in the past?&lt;BR /&gt;&lt;BR /&gt;hdan.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 21:20:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136313#M1827</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-20T21:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136314#M1828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Note that with&lt;BR /&gt;&amp;gt;extern const char *__far MessageDef [];&lt;BR /&gt;MessageDef is not a constant. It's a variable which can be changed, it only happens to contain pointer pointing to non modifyable characters.&lt;BR /&gt;Use&lt;BR /&gt;extern const char * const __far MessageDef [];&lt;BR /&gt;instead.&lt;BR /&gt;(both declarations and definitions, of course)&lt;BR /&gt;&lt;BR /&gt;Note too that the map file snippet you copied shows how the MessageDef&amp;nbsp; variable gets initialized.&lt;BR /&gt;Just checking the MessageDef&amp;nbsp; entry itself is probably simpler :smileyhappy:&lt;BR /&gt;&lt;BR /&gt;about the tSL, well this is clearly a variable (and not a constant). You want to place it into banked flash? Is it constant?&lt;BR /&gt;If so, use "extern unsigned int* const tSL[];"&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 19:24:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136314#M1828</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-06-21T19:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136315#M1829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I find a solution for the const, i use struct like this:&lt;BR /&gt;struct sStrTab&lt;BR /&gt;{&lt;BR /&gt;const char *__far strDat;&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;extern const struct sStrTab MessageDef [];&lt;BR /&gt;&lt;BR /&gt;it do the same and it's ok.&lt;BR /&gt;&lt;BR /&gt;More difficult with variable, i understand why they appear in ROM, these variables are initialized. Their initializations are in ROM. How to put them in banked rom ?&lt;BR /&gt;&lt;BR /&gt;hdan,&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 20:25:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136315#M1829</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-21T20:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136316#M1830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The problem with&lt;BR /&gt;const char *__far strDat;&lt;BR /&gt;&lt;BR /&gt;is that strDat is NOT const.&lt;BR /&gt;code like&lt;BR /&gt;strDat= 0;&lt;BR /&gt;compiles just fine. This declaration states that strDat is a pointer to a constant string, so&lt;BR /&gt;strDat[2]= 'a';&lt;BR /&gt;for example does not compile, but the pointer itself can be changed to point to other strings instead.&lt;BR /&gt;If you want strDat to be in ROM/Flash, use&lt;BR /&gt;char *__far const strDat;&lt;BR /&gt;or&lt;BR /&gt;const char *__far const strDat;&lt;BR /&gt;&lt;BR /&gt;About your variable question, sorry, I dont understand the question. Variables are changeable, so they don't apear in ROM (hopefully). Values used to initialize them initially may appear in ROM tough, that's what you saw in a previous post.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2007 19:24:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136316#M1830</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-06-22T19:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136317#M1831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;For the variable, of course they are not in ROM, but their initialization yes.&lt;BR /&gt;if you write:&lt;BR /&gt;&lt;BR /&gt;int a= 10;&lt;BR /&gt;&lt;BR /&gt;10 is writed in ROM.&lt;BR /&gt;&lt;BR /&gt;I found a "solution", i write:&lt;BR /&gt;&lt;BR /&gt;const int tmp = 10;&lt;BR /&gt;int a = tmp;&lt;BR /&gt;&lt;BR /&gt;with the const in the right page.&lt;BR /&gt;&lt;BR /&gt;I suppose a better solution exist but that solve my problem.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 21:06:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136317#M1831</guid>
      <dc:creator>hdan</dc:creator>
      <dc:date>2007-06-25T21:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: CONST in banked Memory.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136318#M1832</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;So you are looking for a way to put initialization values ( so called copy down information) in banked memory.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is possible only for HCS12X or HCS12XE and with cw for hcs12 V4.6 (as far as I know).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You need to&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; - edit the file start12.c&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; - In that file you should see:&lt;/DIV&gt;&lt;DIV&gt;/*#define __BANKED_COPY_DOWN : allow to allocate .copy in flash area */&lt;BR /&gt;&amp;nbsp; - remove the comment in front of the line. Change it to&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; #define __BANKED_COPY_DOWN /*: allow to allocate .copy in flash area */&lt;BR /&gt;&amp;nbsp; - rebuild the application.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This should be it.&lt;/DIV&gt;&lt;DIV&gt;But remember this is only working for HCS12X or HCS12XE.&lt;/DIV&gt;&lt;DIV&gt;It will not work for HCS12 or HC12.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2007 21:40:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CONST-in-banked-Memory/m-p/136318#M1832</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-06-25T21:40:58Z</dc:date>
    </item>
  </channel>
</rss>

