<?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: Accessing variables from X- Gate in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156269#M4717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kef ... It worked ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Oct 2010 13:46:25 GMT</pubDate>
    <dc:creator>Nycil</dc:creator>
    <dc:date>2010-10-20T13:46:25Z</dc:date>
    <item>
      <title>Accessing variables from X- Gate</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156265#M4713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;Am using an S12Xep100 processor. I&amp;nbsp; want to do a certain functionality on the Xgate processor to relieve the main CPU off its load. I have declared a structure which has two members one an unsigned char and another an unsigned long int(declared in the Xgate.h file). In one of the ISRs in the Xgate(written in the .cxgate file) I want to update the values of the members in the structure. The value of the unsigned char is updated ok, but the value of the unsigned int is not updated and thus an illegal breakpoint comes when debugging the true time simulator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Help.&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;struct mystruct{&lt;/P&gt;&lt;P&gt;unsigned char var1;&lt;/P&gt;&lt;P&gt;unsigned long int var2;&lt;/P&gt;&lt;P&gt;}; this is my&amp;nbsp; structure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 22:16:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156265#M4713</guid>
      <dc:creator>Nycil</dc:creator>
      <dc:date>2010-10-19T22:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing variables from X- Gate</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156266#M4714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;XGATE physically can't access misaligned word. Thus XGATE compiler inserts padding bytes to align struct fields. HC12 compiler by default doesn't align&amp;nbsp;struct fields.&amp;nbsp;You should either swap struct fields, so that even sized field comes first. Or in HC12 part use align pragma&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma align on&lt;/P&gt;&lt;P&gt;.. shared variables and typedef's&lt;/P&gt;&lt;P&gt;#pragma align off&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 23:50:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156266#M4714</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-10-19T23:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing variables from X- Gate</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156267#M4715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kef.&lt;/P&gt;&lt;P&gt;This is my structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;struct mystruct{&lt;/P&gt;&lt;P&gt;unsigned char var1;&lt;/P&gt;&lt;P&gt;unsigned char var2;&lt;/P&gt;&lt;P&gt;unsigned int var3;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;In this case is the alignment problem solved. If not, How do I solve it , so as to access the members of the structure in an ISR in the X-Gate. I would have problem accessing the var3. Is it anyway related to the prm file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 11:31:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156267#M4715</guid>
      <dc:creator>Nycil</dc:creator>
      <dc:date>2010-10-20T11:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing variables from X- Gate</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156268#M4716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this struct should be fine without #pragma align on.&lt;/P&gt;&lt;P&gt;Of course all shared variables should be placed in segments with ALIGN 2[1:1] in prm file. Like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM_FC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0xFC1900 TO 0xFC1FFF ALIGN 2[1:1]; /* is also mapped to XGATE:&amp;nbsp; 0xC900..0xCFFF */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 13:38:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156268#M4716</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-10-20T13:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing variables from X- Gate</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156269#M4717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kef ... It worked ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Oct 2010 13:46:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-variables-from-X-Gate/m-p/156269#M4717</guid>
      <dc:creator>Nycil</dc:creator>
      <dc:date>2010-10-20T13:46:25Z</dc:date>
    </item>
  </channel>
</rss>

