<?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: Constant declarations @ fixed flash address via template? in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192570#M4909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;The FAQ also presented an ANSI-C specific way to declare a variable at an address, to wit:&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;#define serial_number (*(const unsigned char*)0xC000);&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;That didn't work, either?&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Oct 2008 20:55:29 GMT</pubDate>
    <dc:creator>J2MEJediMaster</dc:creator>
    <dc:date>2008-10-10T20:55:29Z</dc:date>
    <item>
      <title>Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192564#M4903</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 understand from searching older threads that CW for DSP56F8xxx does NOT support declarations of constants @ fixed address - for example, I would like the generated S-Record Code image of my application code to have its revision information stored into fixed location in dataflash, e.g., for application firmware revision "1.2.3":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UInt16 FWMajorRev@0x7B00 = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UInt16 FWMinorRev@0x7B01 = 2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UInt16 FWMaintRev@0x7B02 = 3;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I obviously do not want to have application code write this to flash every time it runs as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;that is time consuming and could contribute to flash wear issues.&amp;nbsp;&amp;nbsp; I know I can define a section in the linker .cmd file for the project to store this info, but if I allow CW to generate new linker file (as future code changes, variable additions cause expansion of .bss sections, etc.) it will overwrite my modified .cmd file with the special section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.x_AppFWRev (R) : ORIGIN=0x7B00, LENGTH=0x0003&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.AppFWRevision :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; #Major Rev&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WRITEH(1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;#Minor Rev&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WRITEH(2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;#Maint Rev&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;WRITEH(3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} &amp;gt; .x_AppFWRev&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;IS there a way to create a "template" with CW that would use my specially coded cmd file as a template or not eliminate my special section, but still allow it to create the .cmd file to accomodate future code changes ?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to avoid having to document procedure for copying older .cmd files, writing code, generating new linker .cmd file, and copying /pasting from older .cmd files into new .cmd file and disabling the automatic linker file generation in PE repeatedly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice/help is appreciated !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2008 04:08:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192564#M4903</guid>
      <dc:creator>FTSolutions</dc:creator>
      <dc:date>2008-10-09T04:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192565#M4904</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;there is a way to specify object to an address.&lt;/DIV&gt;&lt;DIV&gt;See below.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;FONT face="Helvetica-Bold" size="5"&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;P align="left"&gt;&lt;B&gt;&lt;FONT face="Helvetica-Bold" size="5"&gt;Specifying Variable Addresses in C&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;FONT face="Times-Roman" size="1"&gt;&lt;/FONT&gt;&lt;P align="left"&gt;&lt;FONT face="Times-Roman" size="1"&gt;The user can tell the compiler to specify the address of a variable in a C file using the &lt;FONT face="Courier" size="1"&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Times-Roman" size="1"&gt;&lt;/FONT&gt;&lt;P align="left"&gt;&lt;FONT face="Times-Roman" size="1"&gt;operator. The constant value following the &lt;FONT face="Courier" size="1"&gt;:&lt;/FONT&gt; &lt;FONT face="Times-Roman" size="1"&gt;operator is the word address of the global&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Times-Roman" size="1"&gt;variable (i.e., &lt;FONT face="Courier" size="1"&gt;int OneReg : 0xBCD ;&lt;/FONT&gt; &lt;FONT face="Times-Roman" size="1"&gt;specifies that the global variable&lt;/FONT&gt; &lt;FONT face="Courier" size="1"&gt;OneReg&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Times-Roman" size="1"&gt;&lt;/FONT&gt;&lt;P align="left"&gt;&lt;FONT face="Times-Roman" size="1"&gt;resides at word address &lt;FONT face="Courier" size="1"&gt;0xBCD&lt;/FONT&gt;&lt;FONT face="Times-Roman" size="1"&gt;).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;B&gt;&lt;FONT face="Times-Bold" size="1"&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;P align="left"&gt;&lt;B&gt;&lt;FONT face="Times-Bold" size="1"&gt;NOTE&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;FONT face="Times-Roman" size="1"&gt;The Linker does not reserve space for global variables declared with the&lt;/FONT&gt; &lt;FONT face="Courier" size="1"&gt;:&lt;/FONT&gt;&lt;FONT face="Times-Roman" size="1"&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT face="Times-Roman" size="1"&gt;operator.&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;Hopte this will help you.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;Pascal&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2008 14:30:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192565#M4904</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2008-10-09T14:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192566#M4905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello Pascal,&lt;BR /&gt;&lt;BR /&gt;thank you but I already know this, and it is only part of what I want to do.&lt;BR /&gt;I want to compile a constant value into that fixed address location, not just define a pointer/variable at the location, which can be done in other ways in C.&lt;BR /&gt;&lt;BR /&gt;Basically I want to be able to compile in word constants at specific data flash addresses, without having to add in all the dataflash code beans to have the program erase&amp;amp;write the values in dataflash on its own.&lt;BR /&gt;&lt;BR /&gt;The CW compiler does this for itself in that it generates the start address/entry point for a program, that is then loaded at the top long word location in dataflash (Motorola S7 record).&amp;nbsp;&amp;nbsp; I would like to know if there is any way that we can get it to do similar function for the user specified constant.&amp;nbsp; Other compilers do support this, as has been discussed on other threads, and I am hoping that someone has some sort of work-around to the limitation in CW for 56F8xxx.&amp;nbsp;&amp;nbsp; Otherwise one must write more code into their application to check these locations and program them with the values.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2008 21:16:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192566#M4905</guid>
      <dc:creator>FTSolutions</dc:creator>
      <dc:date>2008-10-09T21:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192567#M4906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you don't receive feedbackvia the forum, I recommend you to contact the Freescale&amp;nbsp;support team.&lt;/DIV&gt;&lt;DIV&gt;Please use Freescale on line support web page.&lt;BR /&gt;&amp;nbsp; - Go to following URL: &lt;A href="http://www.freescale.com/TechSupport" rel="nofollow" target="_blank"&gt;http://www.freescale.com/TechSupport&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; - Click on Submit a Service Request. You will come to a login page.&lt;BR /&gt;&amp;nbsp; - You can submit your request through the web from there.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;Pascal&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2008 21:58:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192567#M4906</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2008-10-09T21:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192568#M4907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Try taking a look at &lt;A href="http://www.freescale.com/webapp/sps/utils/SingleFaq.jsp?FAQ-28651.xml" rel="nofollow" target="_blank"&gt;FAQ-28651&lt;/A&gt;. Although the target MCU was a HCS12X, the technique used to facilitate the embedding of a serial number into Flash appears to similar to what you're trying to do. HTH.&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2008 22:12:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192568#M4907</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2008-10-09T22:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192569#M4908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yes, that (as mentioned in FAQ) is what I would like to do, but this compiler for 56F8xxx does NOT support the "@" symbol operator nor does it support "_at_", so it will not compile.&lt;BR /&gt;&lt;BR /&gt;I did not want to have to incorporate the dataflash beans and extra code, but perhaps this is the only way to do it with CW for 56F8xxx.&amp;nbsp;&amp;nbsp; I also can do what I want to do by making explicit section and instructions in the .cmd linker command file for the project as noted in my first post, but the IDE regenerates the linker file and just over-writes the entire file and does not keep the sections that I add to embed the numbers, so I have to do it over again.&lt;BR /&gt;&lt;BR /&gt;If I tell the IDE to not regenerate the linker file, I don't lose my changes, but then if another programmer adds variables or code to the project and requires increase in .bss section or code section, the stack has to move and the project will not run correctly until the .cmd file is regenerated to account for the larger sizes.&amp;nbsp; Once it is regenerated, I go back to have to re-entering my section changes all over again.&lt;BR /&gt;&lt;BR /&gt;So, my original question: Is there a way to save /create a new project template that would use a user-defined .cmd file as the default (and thus, I could make my special sections in the .cmd file, and the IDE would know not to remove it all )? Or when it does regenerate the .cmd file, it would recreate the special section that I added).&amp;nbsp;&amp;nbsp; IT does this same sort of thing when one uses the defined stationery templates - the bootloader .cmd files and the application .cmd files have different sections defined and recreated in the .cmd file. This would be a good feature to have, I think.&amp;nbsp; It would also enable a work around to this very basic problem about constants at defined addresses, which is common enough in embedded systems.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2008 01:00:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192569#M4908</guid>
      <dc:creator>FTSolutions</dc:creator>
      <dc:date>2008-10-10T01:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192570#M4909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;The FAQ also presented an ANSI-C specific way to declare a variable at an address, to wit:&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;#define serial_number (*(const unsigned char*)0xC000);&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;That didn't work, either?&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2008 20:55:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192570#M4909</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2008-10-10T20:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192571#M4910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The #define statement will compile.&amp;nbsp;&lt;BR /&gt;#define serialnumber (*(UInt16 *)0x7FFB)&lt;BR /&gt;&amp;nbsp;If I put an assignment statement such as:&lt;BR /&gt;serialnumber = 0x123;&lt;BR /&gt;inside my program function code, it will compile and link.&amp;nbsp; The compiler will not accept an assignment or initialization of the value outside of function scope (meaning, if I put the assignment outside of the main() function, the compiler rejects it.&amp;nbsp; If I put it inside main(), it is happy.&amp;nbsp;&amp;nbsp; This is not want I want.&lt;BR /&gt;&lt;BR /&gt;I want the compiler to compile into the output file a specific constant value at a specific location.&amp;nbsp;&amp;nbsp; Since the location is in dataflash, if I want the value to be initialized by the program code I must include all the dataflash bean/support code to write the value, which is something that I do not wish to do as I don't need the dataflash bean to just READ the value, and don't want to add the extra code space, etc, for the bean.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2008 22:14:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192571#M4910</guid>
      <dc:creator>FTSolutions</dc:creator>
      <dc:date>2008-10-10T22:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Constant declarations @ fixed flash address via template?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192572#M4911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To answer to your question:&lt;/DIV&gt;&lt;DIV&gt;is it possible to create your own stationnery project ?&lt;/DIV&gt;&lt;DIV&gt;Yes you can.&lt;/DIV&gt;&lt;DIV&gt;To that you must create a project and add your changes like&amp;nbsp;new cmd file and your configuration you need.&lt;/DIV&gt;&lt;DIV&gt;When this project is create you must copy the folder under \stationery.&lt;/DIV&gt;&lt;DIV&gt;Now it will appear in the wizard: File ¦ New.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Hope this will help you.&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;Pascal&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2008 19:33:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Constant-declarations-fixed-flash-address-via-template/m-p/192572#M4911</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2008-10-23T19:33:22Z</dc:date>
    </item>
  </channel>
</rss>

