<?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>Kinetis MicrocontrollersのトピックSpecify static variable location</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196878#M2709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please tell me how to specify the flash location of a const variable for a Kinetis MCU using CW 10.2?&amp;nbsp; I wan't to load a specific 32-bit value at a specific flash location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Dec 2012 22:49:28 GMT</pubDate>
    <dc:creator>Mike_d</dc:creator>
    <dc:date>2012-12-03T22:49:28Z</dc:date>
    <item>
      <title>Specify static variable location</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196878#M2709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please tell me how to specify the flash location of a const variable for a Kinetis MCU using CW 10.2?&amp;nbsp; I wan't to load a specific 32-bit value at a specific flash location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 22:49:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196878#M2709</guid>
      <dc:creator>Mike_d</dc:creator>
      <dc:date>2012-12-03T22:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Specify static variable location</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196879#M2710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare your variable in the source code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;#pragma &lt;SPAN style="font-size: 10pt;"&gt;define_section constdata &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: 10pt;"&gt;".&lt;SPAN style="text-decoration: underline;"&gt;constdata&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; R&lt;/SPAN&gt;&lt;STRONG&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;#pragma &lt;SPAN style="font-size: 10pt;"&gt;section constdata begin&lt;/SPAN&gt;&lt;STRONG&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;int My_variable&lt;SPAN style="font-size: 10pt;"&gt; = 0x55AA;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#pragma &lt;SPAN style="font-size: 10pt;"&gt; section constdata begin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Then you have to edit your linker file, something like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;.constdata :&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.constdata)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .= ALIGN(0x4) ;&lt;/P&gt;&lt;P&gt;} &amp;gt; my_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And define my_data section on memory, it depends on the device and memory location you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MEMORY {&lt;/P&gt;&lt;P&gt;m_interrupts&amp;nbsp; (RX) : ORIGIN = 0x00000000, LENGTH = 0x000001E0&lt;/P&gt;&lt;P&gt;my_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00000800, LENGTH = 0x00000100&lt;/P&gt;&lt;P&gt;m_text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00000900, LENGTH = 0x00040000-0x00000800&lt;/P&gt;&lt;P&gt;m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00010000&lt;/P&gt;&lt;P&gt;m_cfmprotrom&amp;nbsp; (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 23:29:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196879#M2710</guid>
      <dc:creator>LuisCasado</dc:creator>
      <dc:date>2012-12-03T23:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Specify static variable location</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196880#M2711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So nothing as simple as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;volatile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt; uint32 my_const @0x4A0 = 0x00C00FAB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that I used with a ColdFire?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 23:40:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196880#M2711</guid>
      <dc:creator>Mike_d</dc:creator>
      <dc:date>2012-12-03T23:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Specify static variable location</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196881#M2712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a very similar example like the one Luis provided can be found on this post: &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/301596"&gt;Linking an array to a fixed address&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "@" method is not supported on the ARM compiler on CW.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 21:45:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196881#M2712</guid>
      <dc:creator>carlos_neri</dc:creator>
      <dc:date>2012-12-06T21:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Specify static variable location</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196882#M2713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike, how is it going?&lt;/P&gt;&lt;P&gt;Were your doubts clarified?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards! :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 00:41:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Specify-static-variable-location/m-p/196882#M2713</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2012-12-12T00:41:05Z</dc:date>
    </item>
  </channel>
</rss>

