<?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: storage variable in the specific location in memory</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126350#M304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Vero&lt;BR /&gt;&lt;BR /&gt;You can use the Linker Control File (LCF) to do this. Have a look at the following thread, where a similar question was discussed:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=1578#M1578" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=1578#M1578&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In particular, the second and third posts in this thread gives some details which might be helpful.&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2007 15:56:46 GMT</pubDate>
    <dc:creator>SimonMarsden_de</dc:creator>
    <dc:date>2007-03-15T15:56:46Z</dc:date>
    <item>
      <title>storage variable in the specific location in memory</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126349#M303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000;"&gt;Hello,&lt;BR /&gt;how I can storage variable in the specific location in memory?&lt;BR /&gt;For example I have&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000;"&gt;char variable; &lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;//I want have variable on address 0x2000 1500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000;"&gt;but how it say to compiler?&lt;BR /&gt;I'm using Code warrior 6.3 and m52233demo&lt;BR /&gt;please help.&lt;BR /&gt;Regards&lt;BR /&gt;&lt;SPAN&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;&lt;/SPAN&gt;Vero&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 15:09:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126349#M303</guid>
      <dc:creator>VeronicaFNX</dc:creator>
      <dc:date>2007-03-15T15:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: storage variable in the specific location in memory</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126350#M304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Vero&lt;BR /&gt;&lt;BR /&gt;You can use the Linker Control File (LCF) to do this. Have a look at the following thread, where a similar question was discussed:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=1578#M1578" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=1578#M1578&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In particular, the second and third posts in this thread gives some details which might be helpful.&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 15:56:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126350#M304</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2007-03-15T15:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: storage variable in the specific location in memory</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126351#M305</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;&lt;DIV&gt;&lt;BR /&gt;Hi Vero,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you declare an automatic variable in a function it will be created somewhere on the heap, if it is a static variable, it will be in the bss section of your linked binary. In both cases there is no way in C to make the compiler create a variable at a specific location.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What you can do is create a pointer variable and set that to point to the location you wish to use:&lt;BR /&gt;&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;char *p_variable;p_variable = 0x20001500;// Now you just dereference the pointer to access your char// e.g. to set the variable to *:*p_variable = '*';&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It is a good idea to declare this type of variable in your linker command file, along with your other memory map declarations in the way that Simon has pointed out.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Paul.&lt;/DIV&gt;&lt;P&gt;Message Edited by mccp on &lt;SPAN class="date_text"&gt;2007-03-15&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:02 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by mccp on &lt;SPAN class="date_text"&gt;2007-03-15&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:03 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 15:59:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/storage-variable-in-the-specific-location-in-memory/m-p/126351#M305</guid>
      <dc:creator>mccPaul</dc:creator>
      <dc:date>2007-03-15T15:59:42Z</dc:date>
    </item>
  </channel>
</rss>

