<?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: Storing variable in flash in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621166#M13583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hacked a solution. I defined constant1 in D-flash as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const unsigned char constant1 @ 0x0400;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I can write to D-flash at this location, and all is well...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Nov 2016 04:24:57 GMT</pubDate>
    <dc:creator>rmaier</dc:creator>
    <dc:date>2016-11-02T04:24:57Z</dc:date>
    <item>
      <title>Storing variable in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621163#M13580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using an MC9S12P128 MCU, and I'd like to store some constants in D-flash. I have the D-flash segment defined as&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DFLASH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0x010400 TO 0x0113FF;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, when I go to write the constant, I use the following:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG CAL_VAL&lt;BR /&gt;volatile const unsigned char __near constant1=0x7F;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I look at where this is in the memory, it shows up as 0xC015. To me, that's nowhere in the range define above. What am I missing here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 02:31:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621163#M13580</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2016-11-02T02:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Storing variable in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621164#M13581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just made a quick test but I didn't reproduce your problem.&lt;/P&gt;&lt;P&gt;see attached demo code and video.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;Have a great day,&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;Jennie Zhang&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 03:30:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621164#M13581</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-11-02T03:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Storing variable in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621165#M13582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not see any attachments. Can you please post?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 03:46:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621165#M13582</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2016-11-02T03:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Storing variable in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621166#M13583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hacked a solution. I defined constant1 in D-flash as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const unsigned char constant1 @ 0x0400;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I can write to D-flash at this location, and all is well...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 04:24:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621166#M13583</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2016-11-02T04:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Storing variable in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621167#M13584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't you see it?&lt;/P&gt;&lt;P&gt;here is the screenshot of it&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6247iA30F712B2FF0047E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 05:31:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621167#M13584</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-11-02T05:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Storing variable in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621168#M13585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Jennie. The video was very helpful. I missed some items in the prm file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how I missed the video. My appologies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:44:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Storing-variable-in-flash/m-p/621168#M13585</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2016-11-02T15:44:46Z</dc:date>
    </item>
  </channel>
</rss>

