<?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 Howto Define a Variable type In Specific Memory Region in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/Howto-Define-a-Variable-type-In-Specific-Memory-Region/m-p/401254#M731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MPC5644A dev kit. I have a problem about memory relocation.&lt;/P&gt;&lt;P&gt; Is there any way to define "volatile const" variables in predefined memory region with LCF?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can solve that issue with below example:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;#pragma explicit_zero_data on #pragma push #pragma section sconst_Type const_type ".__Cal_DataArea" ".__Cal_DataArea"&amp;nbsp;&amp;nbsp;&amp;nbsp; const uint8_T acuc_DC_override_en = 1U;&amp;nbsp;&amp;nbsp; const real32_T acuc_DC_override_val = 0.0F;&amp;nbsp;&amp;nbsp; #pragma pop&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i dont need that.&amp;nbsp; Because with that method , i need to write these pragmas before all variables. I have too many variables in different places. So is there any way to wirite on LCF sth and define all volatile consts to specific area?&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Nov 2015 06:58:30 GMT</pubDate>
    <dc:creator>tunayan</dc:creator>
    <dc:date>2015-11-11T06:58:30Z</dc:date>
    <item>
      <title>Howto Define a Variable type In Specific Memory Region</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Howto-Define-a-Variable-type-In-Specific-Memory-Region/m-p/401254#M731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MPC5644A dev kit. I have a problem about memory relocation.&lt;/P&gt;&lt;P&gt; Is there any way to define "volatile const" variables in predefined memory region with LCF?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can solve that issue with below example:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;#pragma explicit_zero_data on #pragma push #pragma section sconst_Type const_type ".__Cal_DataArea" ".__Cal_DataArea"&amp;nbsp;&amp;nbsp;&amp;nbsp; const uint8_T acuc_DC_override_en = 1U;&amp;nbsp;&amp;nbsp; const real32_T acuc_DC_override_val = 0.0F;&amp;nbsp;&amp;nbsp; #pragma pop&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i dont need that.&amp;nbsp; Because with that method , i need to write these pragmas before all variables. I have too many variables in different places. So is there any way to wirite on LCF sth and define all volatile consts to specific area?&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2015 06:58:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Howto-Define-a-Variable-type-In-Specific-Memory-Region/m-p/401254#M731</guid>
      <dc:creator>tunayan</dc:creator>
      <dc:date>2015-11-11T06:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Howto Define a Variable type In Specific Memory Region</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Howto-Define-a-Variable-type-In-Specific-Memory-Region/m-p/401255#M732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tuna Ayan,&lt;/P&gt;&lt;P&gt;I'm afraid that CW linker cannot distinguish between constant vs. volatile constant.&lt;/P&gt;&lt;P&gt;I'd recommend you to use __declspec(section ... ) instead of #pragma section + push/pop. since it's easier to replace it with macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. you can add the statements below into your prefix .h file or into a custom .h file that is included into each source file :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prefix.h&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#pragma section R "&lt;SPAN class="preprocessor"&gt;.__Cal_DataArea&lt;/SPAN&gt;" "&lt;SPAN class="preprocessor"&gt;.__Cal_DataArea&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#define VOLATILE_CONST __declspec(section "&lt;SPAN class="preprocessor"&gt;.__Cal_DataArea&lt;/SPAN&gt;") volatile const&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in all the source files where you declare a volatile constant just replace keyword "volatile const" with "VOLATILE_CONST"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;VOLATILE_CONST char hello[]= "Hello World!";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and all these constant will be placed into ".__Cal_DataArea" section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: If a constant is not referenced in the code you should instruct the linker to avoid dead-stipping this symbol e.g. in .lcf file, FORCEACTIVE { "hello" }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:24:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Howto-Define-a-Variable-type-In-Specific-Memory-Region/m-p/401255#M732</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2015-11-13T14:24:46Z</dc:date>
    </item>
  </channel>
</rss>

