<?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 S12ZVM prm address mapping in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1167600#M17536</link>
    <description>&lt;P&gt;I want to put the const variable in the designated ram section, and the initial value in the designated ROM section,It will be stored in COPYDOWN SECTION by default，&lt;/P&gt;&lt;P&gt;like this:&lt;/P&gt;&lt;P&gt;RAM_MyRam&amp;nbsp;@ 0x001000&lt;/P&gt;&lt;P&gt;ROM_MyRom&amp;nbsp;@ 0xFC0000&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG RAM_MyRam&lt;/P&gt;&lt;P&gt;const uint16 MyRamtestvar = 7000;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG DEFAULT&lt;/P&gt;&lt;P&gt;I want to store the initial value 7000 of MyRamtestvar in ROM_MyRom segment .&lt;/P&gt;&lt;P&gt;How to map the initial value of RAM_MyRam segment to ROM_MyRom？&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2020 17:04:32 GMT</pubDate>
    <dc:creator>keanchen</dc:creator>
    <dc:date>2020-10-14T17:04:32Z</dc:date>
    <item>
      <title>S12ZVM prm address mapping</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1167600#M17536</link>
      <description>&lt;P&gt;I want to put the const variable in the designated ram section, and the initial value in the designated ROM section,It will be stored in COPYDOWN SECTION by default，&lt;/P&gt;&lt;P&gt;like this:&lt;/P&gt;&lt;P&gt;RAM_MyRam&amp;nbsp;@ 0x001000&lt;/P&gt;&lt;P&gt;ROM_MyRom&amp;nbsp;@ 0xFC0000&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG RAM_MyRam&lt;/P&gt;&lt;P&gt;const uint16 MyRamtestvar = 7000;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG DEFAULT&lt;/P&gt;&lt;P&gt;I want to store the initial value 7000 of MyRamtestvar in ROM_MyRom segment .&lt;/P&gt;&lt;P&gt;How to map the initial value of RAM_MyRam segment to ROM_MyRom？&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 17:04:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1167600#M17536</guid>
      <dc:creator>keanchen</dc:creator>
      <dc:date>2020-10-14T17:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVM prm address mapping</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1168183#M17537</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;This is possible but it changes placement of all other constants used in DopyDown function because in the prm file is :&lt;/P&gt;
&lt;P&gt;COPY INTO ROM;&lt;/P&gt;
&lt;P&gt;The COPY is keyword for project processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case I would split flash and create my own Segment/Placement. Then I would use a new part of flash for my constants. Finally, I would use own routine to initialize RAM variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moreover, there are two ways of data placement into flash.&lt;/P&gt;
&lt;P&gt;1) The new space is created into the prm file and then variables are placed into this space&lt;/P&gt;
&lt;P&gt;//original&amp;nbsp; ROM = READ_ONLY 0xFE0000 TO 0xFFFDFF;&lt;/P&gt;
&lt;P&gt;// adjusted&lt;/P&gt;
&lt;P&gt;ROM = READ_ONLY 0xFE1000 TO 0xFFFDFF;&lt;/P&gt;
&lt;P&gt;MY_DATA_ROM = READ_ONLY 0xFE0000 TO 0xFF0FFF;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;MY_DATA_ROM INTO MY_DATA_ROM ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#pragma CONST_SEG MY_DATA_ROM&amp;nbsp;&amp;nbsp; // MY_DATA_ROM is "MY" extra segment created in the prm file&lt;/P&gt;
&lt;P&gt;&amp;nbsp; const unsigned int xxx;&lt;/P&gt;
&lt;P&gt;#pragma CONST_SEG DEFAULT&lt;/P&gt;
&lt;P&gt;The variables are placed into this segment by compiler.(Usually from lowest address of crated space)&lt;/P&gt;
&lt;P&gt;#pragma CONST_SEG MY_DATA_ROM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) A part of flash is removed from compiler visibility. For example:&lt;/P&gt;
&lt;P&gt;//original&amp;nbsp; ROM = READ_ONLY 0xFE0000 TO 0xFFFDFF;&lt;/P&gt;
&lt;P&gt;// adjusted&lt;/P&gt;
&lt;P&gt;ROM = READ_ONLY 0xFE1000 TO 0xFFFDFF;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;Then in the code you can initialize variable:&lt;/P&gt;
&lt;P&gt;const __far xxx[] @ 0xFE0000 = { 1,2,3,4,};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope I have not made a mistake.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Ladislav&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 10:42:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1168183#M17537</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2020-10-15T10:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVM prm address mapping</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1168225#M17538</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Ladislav：&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer, but I want to put the variable in RAM because I need to calibrate it online. I want to put the initial value in the designated ROM. Copy to RAM during initialization. My current practice is like this&lt;BR /&gt;#pragma DATA_SEG MY_RAM_SEC&lt;BR /&gt;uint16 MyRamTest0;&lt;BR /&gt;uint16 MyRamTest1;&lt;BR /&gt;uint16 MyRamTest2;&lt;BR /&gt;#pragma DATA_SEG DEFAULT&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG MY_ROM_SEC&lt;BR /&gt;const uint16 MyRomTest0 = 7000;&lt;BR /&gt;const uint16 MyRomTest1 = 7000;&lt;BR /&gt;const uint16 MyRomTest2 = 7000;&lt;BR /&gt;#pragma CONST_SEG DEFAULT&lt;/P&gt;&lt;P&gt;When initializing, I copy all the values of MY_ROM_SEC segment to MY_RAM_SEC，&lt;BR /&gt;Do you have a better suggestion？&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 12:14:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-prm-address-mapping/m-p/1168225#M17538</guid>
      <dc:creator>keanchen</dc:creator>
      <dc:date>2020-10-15T12:14:44Z</dc:date>
    </item>
  </channel>
</rss>

