<?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: what is GPAGE_SEG? in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176179#M6186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless there are special requirements, like the need to allocate ISR functions in nonbanked flash, it is more convenient to allocate code in default memory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Project wizard (in case you don't use Processor Expert) creates single placement record for all paged flash and calls it DEFAULT_ROM.&amp;nbsp;Unless you have big &amp;gt;16k arrays of data, it makes sense to use this DEFAULT_ROM to allocate your constants. This&amp;nbsp;may free you from the task of allocating data in specific flash pages.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Oct 2011 16:20:26 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2011-10-25T16:20:26Z</dc:date>
    <item>
      <title>what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176174#M6181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My MCU type:MC9S12X.&lt;/P&gt;&lt;P&gt;I don't know what GPAGE_SEG?&lt;/P&gt;&lt;P&gt;If I write&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG _GPAGE_SEG myseg&lt;/P&gt;&lt;P&gt;const int16 myVar[2] = {0x01,0x02}&lt;/P&gt;&lt;P&gt;in Code,&lt;/P&gt;&lt;P&gt;I will find GPAGE_SEG in map file:myVar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D881&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp; _GPAGE_SEG&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GPAGE_SEG is compiler known symbol,&amp;nbsp; But I don't find the defination and what is the exact meaning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 13:43:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176174#M6181</guid>
      <dc:creator>100asong</dc:creator>
      <dc:date>2011-10-24T13:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176175#M6182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It tells compiler that global addressing (GPAGE register + gstaa/gldd etc CPU instructions) are should be used to access data, wich is allocated in memory segment you specify (myseg in your case).&lt;/P&gt;&lt;P&gt;Similarly __RPAGE_SEG is used to access paged RAM switching RPAGE register. __EPAGE_SEG for EPAGE paged EEPROM etc.&lt;/P&gt;&lt;P&gt;It shouldn't affect your map file. PRM file defines addresses of memory segments. Since compiler doesn't know at compile time where will be specific segments allocated, compiler need more information, and you help compiler specifying segment attributes like __GPAGE_SEG. This means that if some variables are accessed from different files, all source units should see not only extern variable declarations, but all those shared externs should be also declared in H-files between the same DATA_SEG pragmas&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG xxxxx&lt;/P&gt;&lt;P&gt;put you vars here&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 14:57:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176175#M6182</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-10-24T14:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176176#M6183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,Dear kef.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I implement these work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In prm file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MySeg INTO PAGE_FE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyCode INTO PAGE_FC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In my.c file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma CONST_SEG __GPAGE_SEG MySeg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const int sa[4] = {0x11, 0x12, 0x13, 0x14};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma CONST_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; And then I want to access&amp;nbsp; sa in PAGE_FE flash area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int * __far g_psa;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int x = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma CODE_SEG MyCode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void ReadSa()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_psa =&amp;nbsp;(int* __far)sa&amp;nbsp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = *(int * __far)g_psa++;//x = 0&lt;FONT color="#ff0000"&gt;,not 0x11&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = *(int * __far)g_psa++;//x = 0, &lt;FONT color="#ff0000"&gt;not 0x12&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = *(int * __far)g_psa++;//x = 0, &lt;FONT color="#ff0000"&gt;not 0x13&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = *(int * __far)g_psa;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;How to get&amp;nbsp;the right data:0x11,0x12,0x13?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How to access access 0xFE from page 0xFC?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 20:08:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176176#M6183</guid>
      <dc:creator>100asong</dc:creator>
      <dc:date>2011-10-24T20:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176177#M6184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But last write to x is working, right?&amp;nbsp;If so, then compiler has optimized away unused&amp;nbsp;stores to&amp;nbsp;x. Try making x volatile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder what is purpose of storing your function in specific page of flash?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 21:17:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176177#M6184</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-10-24T21:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176178#M6185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try volatile is okay.&lt;/P&gt;&lt;P&gt;I want to store some constant data in one page of flash, and then I can access it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 07:58:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176178#M6185</guid>
      <dc:creator>100asong</dc:creator>
      <dc:date>2011-10-25T07:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176179#M6186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless there are special requirements, like the need to allocate ISR functions in nonbanked flash, it is more convenient to allocate code in default memory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Project wizard (in case you don't use Processor Expert) creates single placement record for all paged flash and calls it DEFAULT_ROM.&amp;nbsp;Unless you have big &amp;gt;16k arrays of data, it makes sense to use this DEFAULT_ROM to allocate your constants. This&amp;nbsp;may free you from the task of allocating data in specific flash pages.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 16:20:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176179#M6186</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-10-25T16:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: what is GPAGE_SEG?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176180#M6187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So good.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 12:49:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/what-is-GPAGE-SEG/m-p/176180#M6187</guid>
      <dc:creator>100asong</dc:creator>
      <dc:date>2011-10-27T12:49:26Z</dc:date>
    </item>
  </channel>
</rss>

