<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: Placing variables into specific memory locations on the MCF52233</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173214#M6576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear CrazyCat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand your comment about the service request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example I gave is for the codewarrior CFV2,3,4 compiler so obviously it supports it already &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;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The compilers for other targets support this notation as well - They better since they use it in the supplied target header files.&amp;nbsp; However, I note that the header files for the CFV2,3,4 use the pointer casting method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by pgo on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-04-21&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;01:22 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2009 10:19:40 GMT</pubDate>
    <dc:creator>pgo</dc:creator>
    <dc:date>2009-04-21T10:19:40Z</dc:date>
    <item>
      <title>Placing variables into specific memoery locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173207#M6569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the PIC series of Microcontollers I can do the following:&lt;/P&gt;&lt;P&gt;#pragma udata myData=0x2000&lt;/P&gt;&lt;P&gt;unsigned char value;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;&amp;nbsp;any other variables I wish to declare&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;#pragma udata&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will place the variable 'value' at memory location 0x2000 in RAM with any other variables following consecutively after that until the subsequent pragma.&amp;nbsp; I'd like to know how to do this same process on the MCF52233.&amp;nbsp; I found a pragma that looked very similar to what I wanted, but it didn't use any numbers so I wasn't clear on how I could tell exactly where in memory that section would go.&amp;nbsp; The pragma I found appeared to allow me to name a section of memory but that section could still be placed in an arbitrary memory location.&amp;nbsp; How do I place data exactly where I want it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 14:01:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173207#M6569</guid>
      <dc:creator>Eqqman</dc:creator>
      <dc:date>2009-04-18T14:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memoery locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173208#M6570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You typically have 2 ways. The first way is C with no specific tricks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define UDATA_BASE ((unsigned char*) 0x2000)&lt;/P&gt;&lt;P&gt;#define value *(UDATA_DATA + 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If you have a few variables at this address place them in a structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second way is to use the linker command file and that depends on your compiler. The manual should contain examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 06:19:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173208#M6570</guid>
      <dc:creator>ChrisJohns</dc:creator>
      <dc:date>2009-04-19T06:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memoery locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173209#M6571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Since in your example 'value' is an untyped symbol that represents a literal value and not an L-value I'm not not sure how I could successfully get a structure to be stored at the address represented by 'value'.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 06:54:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173209#M6571</guid>
      <dc:creator>Eqqman</dc:creator>
      <dc:date>2009-04-19T06:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memoery locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173210#M6572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear eqqman,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example given by Chris is correct.&amp;nbsp; value is an lvalue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another alternative that is codewarrior specific is to use the '@' notation as shown in the examples below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;int example1@0x1000; // Codewarrior specific method&lt;BR /&gt;#define EXAMPLE2 (*(volatile unsigned int *) 0x1000)&amp;nbsp; // Standard C&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; example1 = 0x12345678;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; EXAMPLE2 = 0x12345678;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both assignments produce similar code.&amp;nbsp; The second is more portable but since accesssing a specific location is almost certainly target specific I can't really see much argument about this being an advantage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The advantage of the 1st is that example1 will appear as a variable in the debugger - EXAMPLE2 is invisible since while an lvalue it's not actually a named variable, just pointer magic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by pgo on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-04-19&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:58 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 09:54:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173210#M6572</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2009-04-19T09:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memoery locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173211#M6573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if I have&amp;nbsp;&lt;/P&gt;&lt;P&gt;struct globals{&lt;/P&gt;&lt;P&gt;/* dat atype 1 */ value1;&lt;/P&gt;&lt;P&gt;/* datatype 2, etc. */ value2;&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;#define MEMORY (*(volatile globals *) 0x1000)&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;MEMORY.value1 = whatever&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;without any of the structure members being named in the debugger?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 11:43:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173211#M6573</guid>
      <dc:creator>Eqqman</dc:creator>
      <dc:date>2009-04-19T11:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memoery locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173212#M6574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Eqqman,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That looks about right but I would prefer the @notation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A more complete example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;int example1@0x1000;&lt;BR /&gt;#define EXAMPLE2 (*(volatile unsigned int *) 0x1000)&lt;BR /&gt;&lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; int&amp;nbsp; m1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; char m2;&lt;BR /&gt;} aStruct;&lt;BR /&gt;&lt;BR /&gt;#define EXAMPLE3 (*(volatile aStruct *) 0x1000) // A structure @ 0x1000&lt;BR /&gt;#define EXAMPLE4 ((volatile aStruct *) 0x1000)&amp;nbsp; // A ptr to a struct @ 0x1000&lt;BR /&gt;&lt;BR /&gt;aStruct example5 @0x1000; // A structure @ 0x1000&lt;BR /&gt;aStruct volatile&amp;nbsp; *const example6 = ((volatile aStruct *) 0x1000); // A ptr to a struct @ 0x1000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="1"&gt;&lt;FONT size="2"&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; example1 = 0x12345678;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; EXAMPLE2 = 0x12345678;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; EXAMPLE3.m1 = 1234;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; EXAMPLE4-&amp;gt;m2 = 'a';&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; example5.m1 = 1234;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; example6-&amp;gt;m2 = 'b';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's informative to try dissassembling these in codewarrior to check the code produced.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 13:56:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173212#M6574</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2009-04-19T13:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memory locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173213#M6575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notation @ is not standard ANSI C.&lt;/P&gt;&lt;P&gt;So an ANSI C compiler might not support it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can submit a Feature request for support of that notation in the compiler through our on-line support web site if you want to see that extension in CodeWarrior some day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would recommend you to submit a service request for that.&lt;BR /&gt;&lt;BR /&gt;Click &lt;A href="https://www.freescale.com/webapp/servicerequest.create_SR.framework?regFlag=fromOpenSR" rel="nofollow" target="_blank"&gt;here&lt;/A&gt; to submit a service request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 20:48:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173213#M6575</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2009-04-20T20:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Placing variables into specific memory locations on the MCF52233</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173214#M6576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear CrazyCat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand your comment about the service request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example I gave is for the codewarrior CFV2,3,4 compiler so obviously it supports it already &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;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The compilers for other targets support this notation as well - They better since they use it in the supplied target header files.&amp;nbsp; However, I note that the header files for the CFV2,3,4 use the pointer casting method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by pgo on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-04-21&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;01:22 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 10:19:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Placing-variables-into-specific-memoery-locations-on-the/m-p/173214#M6576</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2009-04-21T10:19:40Z</dc:date>
    </item>
  </channel>
</rss>

