<?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: xgate in ram / x gate in flash in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175690#M6134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got more time...&lt;/P&gt;&lt;P&gt;In hivawe.h, when __XGATE__ is defined, you have&amp;nbsp;this line for XGATE code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG&amp;nbsp;&amp;nbsp; XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the same for both cases, but prm files do differ when you choose RAM and when you choose FLASH.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XGATE_CODE placement may go&amp;nbsp;to RAM segments and may go to flash segments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may control by hand placement of each function and XGATE vectors table.&lt;/P&gt;&lt;P&gt;1) to place function to flash add this line above function definition&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_FLASH&lt;/P&gt;&lt;P&gt;void myfoo(void){...&lt;/P&gt;&lt;P&gt;2) to place function to RAM add this above function&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_RAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please disregard&amp;nbsp;suggestion to use #pragma CODE_SEG DEFAULT. You can't use it with XGATE, else you routine will be placed in wrong part of flash. To return to project default placement add this below the function.&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to force some XGATE function to RAM you put your function between these pragmas&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_RAM&lt;/P&gt;&lt;P&gt;foo()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to force to flash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_FLASH&lt;/P&gt;&lt;P&gt;foo()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may also force&amp;nbsp; XGATE vectors to flash or RAM. Placing it in flash will worse interrupt response times a bit, but you may save some RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG XGATE_CONST_RAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG XGATE_CONST_FLASH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2012 13:55:48 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2012-06-28T13:55:48Z</dc:date>
    <item>
      <title>xgate in ram / x gate in flash</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175688#M6132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem with HCS12x microcontrollers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Xgate code either run from RAM or the FLASH ( RAM is more preferrable as&amp;nbsp; x gate runs only at half the speed of CPU ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i came to know that at the startup.c,&amp;nbsp; x gate code is copied from 'flash' to 'ram'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inorder to trace this two project files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. with xgate in flash&lt;/P&gt;&lt;P&gt;2.with xgate in ram&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compared both the files&amp;nbsp; i.e startup.c and datapage.c for both x gate in ram and x gate in flash&amp;nbsp; . There is no single difference between the two....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm confused!!!.... howz the demarcation done between x gate in flash - &amp;gt; x gate ram in startup.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;help me out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 01:19:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175688#M6132</guid>
      <dc:creator>FIDDO</dc:creator>
      <dc:date>2012-06-28T01:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: xgate in ram / x gate in flash</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175689#M6133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What CW version are you using?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Difference is that some include file has smth like&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG &amp;lt;RAM placement, other than predefined placement like DEFAULT_RAM&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works even for S12 code. Just put your routine between&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG &amp;lt;your RAM placement&amp;gt;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be copied to RAM by startup file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 02:46:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175689#M6133</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-06-28T02:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: xgate in ram / x gate in flash</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175690#M6134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got more time...&lt;/P&gt;&lt;P&gt;In hivawe.h, when __XGATE__ is defined, you have&amp;nbsp;this line for XGATE code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG&amp;nbsp;&amp;nbsp; XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the same for both cases, but prm files do differ when you choose RAM and when you choose FLASH.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XGATE_CODE placement may go&amp;nbsp;to RAM segments and may go to flash segments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may control by hand placement of each function and XGATE vectors table.&lt;/P&gt;&lt;P&gt;1) to place function to flash add this line above function definition&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_FLASH&lt;/P&gt;&lt;P&gt;void myfoo(void){...&lt;/P&gt;&lt;P&gt;2) to place function to RAM add this above function&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_RAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please disregard&amp;nbsp;suggestion to use #pragma CODE_SEG DEFAULT. You can't use it with XGATE, else you routine will be placed in wrong part of flash. To return to project default placement add this below the function.&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to force some XGATE function to RAM you put your function between these pragmas&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_RAM&lt;/P&gt;&lt;P&gt;foo()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to force to flash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE_FLASH&lt;/P&gt;&lt;P&gt;foo()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may also force&amp;nbsp; XGATE vectors to flash or RAM. Placing it in flash will worse interrupt response times a bit, but you may save some RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG XGATE_CONST_RAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG XGATE_CONST_FLASH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 13:55:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/xgate-in-ram-x-gate-in-flash/m-p/175690#M6134</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-06-28T13:55:48Z</dc:date>
    </item>
  </channel>
</rss>

