<?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: fixed ROM addressing in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762927#M14577</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;To allocate unused global variable to memory, we need add the object in ENTRIES section in prm file&lt;/P&gt;&lt;P&gt;Example:&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/2619i05D9FF6595F7A798/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;P&gt;&lt;/P&gt;&lt;P&gt;thus "global_val" will not being optimized out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Dec 2017 02:13:36 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2017-12-08T02:13:36Z</dc:date>
    <item>
      <title>fixed ROM addressing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762924#M14574</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;I am trying to store several calibration values/tables into ROM at fixed addresses. I am using CodeWarrior on a 9S12P MCU. Right now, I am capable of defined addressing for individual constants as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#pragma CONST_SEG PAGE_0C&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterA @ 0xC9000 = 1458;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works just as I intend. However, with a bunch of constants, I want to add another definition where the location is sequentially located right behind the previous declaration. Some definition like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#pragma CONST_SEG PAGE_0C&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterA @ 0xC9000 = 1458;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterB = 6533;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterC = 12;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Where the addressing would be:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;CalParameterA &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xC9000&lt;/P&gt;&lt;P&gt;CalParameterB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0xC9002&lt;/P&gt;&lt;P&gt;CalParameterC &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xC9004&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;How can I best achieve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 00:07:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762924#M14574</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2017-12-06T00:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: fixed ROM addressing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762925#M14575</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;You tried to allocate three variables to 0xC9000-0xC9004 .&lt;/P&gt;&lt;P&gt;However with your code, I don’t think this can work.&lt;/P&gt;&lt;P&gt;There are two solutions:&lt;/P&gt;&lt;P&gt;Solution 1:&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterA @ 0xC9000 = 1458;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterB @ 0xC9002 = 6533;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterC @ 0xC9004 = 12;&lt;/P&gt;&lt;P&gt;You don’t need put above code under #pragma CONST_SEG PAGE_0C. Because you already use @ defining variables to specific address, there is no sense to put it under PAGE_0C segment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution 2:&lt;/P&gt;&lt;P&gt;In prm, define&amp;nbsp; a section from 0xC9000&lt;/P&gt;&lt;P&gt;PAGE_0C_9000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0x0C9000 TO 0x0C93FF;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;USER_CONST_C9000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp; PAGE_ PAGE_0C_9000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In C code,&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG USER_CONST_C9000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterA &amp;nbsp;= 1458;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterB = 6533;&lt;/P&gt;&lt;P&gt;volatile const UINT16 CalParameterC = 12;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 03:09:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762925#M14575</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2017-12-06T03:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: fixed ROM addressing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762926#M14576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. That was very helpful. As a follow up question: how do I keep space allocated in ROM if it is defined, but not used in an application? The order of each constant is critical.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 14:40:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762926#M14576</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2017-12-06T14:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: fixed ROM addressing</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762927#M14577</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;To allocate unused global variable to memory, we need add the object in ENTRIES section in prm file&lt;/P&gt;&lt;P&gt;Example:&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/2619i05D9FF6595F7A798/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;P&gt;&lt;/P&gt;&lt;P&gt;thus "global_val" will not being optimized out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 02:13:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/fixed-ROM-addressing/m-p/762927#M14577</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2017-12-08T02:13:36Z</dc:date>
    </item>
  </channel>
</rss>

