<?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>S12 / MagniV MicrocontrollersのトピックRe: Xgate - not processing interrupts</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416699#M11218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding L1827. Is XGATE vector table declared in *.h file like you wrote, with unknown array size []? If so, then main.c.o shouldn't know its size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try creating new multicore project using project wizard? It should give you some hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is wrong to put XGATE_DATA in ROM segment. CONST_SEG and XGATE_CONST should be placed to ROM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2015 07:46:06 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2015-09-29T07:46:06Z</dc:date>
    <item>
      <title>Xgate - not processing interrupts</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416698#M11217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done a fair bit of reading through past posts and the 9S12 manual but can't seem to get the Xgate to receive interrupts. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running an HC9S12XET256 and am running low on resources (RAM and CPU loading). I would like to start porting some interrupts to the Xgate module to free resources.&lt;/P&gt;&lt;P&gt;To start with, something as simple as PWMing an LED.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've used AN3225 as a template.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am planning on running the Xgate program from flash. I realize this is slower but am not worried about that at this point.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I've done:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Added placement to prm for xgate code, data, and stack&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;RAM_XGATE_STK = READ_WRITE&amp;nbsp; 0xFC1F00 TO 0xFC1FFF; // The stack is set by the XGATE compiler option -Cstv=D000&lt;/P&gt;&lt;P&gt;ROM_XGATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xE18000 TO 0xE1BFFF ALIGN 2[1:1]; /* is also mapped to XGATE:&amp;nbsp; 0x4000..0x7FFF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;XGATE_CODE, XGATE_DATA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="line-height: 1.5;"&gt;INTO&amp;nbsp;&amp;nbsp; ROM_XGATE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Also added pragmas to tell linker to put all code and data from the Xgate vector files and PWM module into these segments:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG XGATE_CODE&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG XGATE_DATA&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set up vector table and mapped an ISR to PIT0 vector.&lt;/LI&gt;&lt;LI&gt;At startup:&lt;UL&gt;&lt;LI&gt;Copy Xgate vector base address to register&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE class="c++" name="code"&gt;XGVBR_XGVBR= (int)((void*__far)XGATEVectorTable);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Enable Xgate module and interrupts&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;PRE class="c++" name="code"&gt;XGMCTL = 0xFFE1;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Routed PIT0 interrupt to Xgate. PIT0 is channel 0x3D, vector 7A.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;PRE class="c++" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INT_CFADDR_INT_CFADDR = 0x7;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set interrupt confiuration address &amp;nbsp;&amp;nbsp;&amp;nbsp; INT_CFDATA5_PRIOLVL = 0x7;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set priority to 7 &amp;nbsp;&amp;nbsp;&amp;nbsp; INT_CFDATA5_RQST = TRUE;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set to XGate&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Set up PIT0 timer&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;PRE class="c++" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PITCE_PCE0 = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable PIT channel 0 &amp;nbsp;&amp;nbsp;&amp;nbsp; PITMTLD1 = 0;&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; // Divide by 1 - no pre-scalar needed &amp;nbsp;&amp;nbsp;&amp;nbsp; PITMUX_PMUX0 = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Assign PIT channel 0 to microtimer 1 &amp;nbsp;&amp;nbsp;&amp;nbsp; PITLD0 = 2400 - 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 100Hz @ 0.5% -&amp;gt; 50us/20.83ns = 2400 &amp;nbsp;&amp;nbsp;&amp;nbsp; PITCFLMT_PITE = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable PIT0 &amp;nbsp;&amp;nbsp;&amp;nbsp; PITCFLMT_PITFRZ = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable in freeze mode &amp;nbsp;&amp;nbsp;&amp;nbsp; PITCFLMT_PFLMT1 = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Force reload of timer &amp;nbsp;&amp;nbsp;&amp;nbsp; PITFLT_PFLT0 = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Force reload of counter 0 &amp;nbsp;&amp;nbsp;&amp;nbsp; PITINTE_PINTE0 = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable interrupts from channel 0&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Enabled interrupts&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using a debugger to read from the registers I can confirm that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The timer is counting properly and setting flag PITTF_PTF0 when it times out.&lt;/LI&gt;&lt;LI&gt;The RQST flag and priority have been set for PIT0 interrupt.&lt;/LI&gt;&lt;LI&gt;The XGMCTL register is set correctly (XGE, XGFRZ, XGIE).&lt;/LI&gt;&lt;LI&gt;The value at the Xgate vector address for PIT0 points to the flash location of the ISR (0xE18004 in map file and 0x4004 at vector address)&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing here? &lt;/P&gt;&lt;P&gt;Everything seems to be mapped correctly when I cross check the map file to what I see using the debugger.&lt;/P&gt;&lt;P&gt;The interrupt seems to fire and the vector is there pointing to the correct function - why is it not running?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas would be great - I feel like I've been thorough here but can't seem to put my finger on the issue.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A few things I noticed that I'm not sure are causing the problem:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The XGIF register corresponding to PIT0 is not being set. From the manual it seems like this is only set by the Xgate and not when the interrupt is set so I think this is ok, but maybe I am misunderstanding its purpose.&lt;/LI&gt;&lt;LI&gt;The only other thing that seems a bit off is that if I leave my vector array size undefined, it shows up in the map file as 512 bytes (good). However if I define its size as 128, I get a linker error:&lt;/LI&gt;&lt;/UL&gt;&lt;H1 id="toc-hId-1899461277"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;A class="anchor" name="pageL1827" target="_blank"&gt;&lt;/A&gt;L1827: Symbol XGATEVectorTable has different size in xgatevectors.cxgate.o (512 bytes) and main.c.o (640&amp;nbsp; bytes) &lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;Is there an alignment issue I've missed? The size difference is 128 bytes which can't be a coincidence. The only place its used in main.c is where the address is copied to the XGVBR register.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for all input,&lt;/P&gt;&lt;P&gt;const xgate_vector XGATEVectorTable[];&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;/* XGATE vector table */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 04:36:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416698#M11217</guid>
      <dc:creator>jimmymitt</dc:creator>
      <dc:date>2015-09-29T04:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Xgate - not processing interrupts</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416699#M11218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding L1827. Is XGATE vector table declared in *.h file like you wrote, with unknown array size []? If so, then main.c.o shouldn't know its size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try creating new multicore project using project wizard? It should give you some hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is wrong to put XGATE_DATA in ROM segment. CONST_SEG and XGATE_CONST should be placed to ROM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 07:46:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416699#M11218</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2015-09-29T07:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Xgate - not processing interrupts</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416700#M11219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The XGATE vecor is declared in the *.h file as I wrote previously:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;extern const xgate_vector XGATEVectorTable[];&lt;/TD&gt;&lt;TD&gt;/* XGATE vector table */&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The *.c file defines it as&lt;/P&gt;&lt;P&gt;const xgate_vector XGATEVectorTable[] = {&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14435457684532444 jive_macro_code jive_text_macro" data-renderedposition="101_8_1232_80" jivemacro_uid="_14435457684532444"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Channel # = Vector address / 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; {ErrorHandler, U_XDP},&amp;nbsp; // Channel 00 - Reserved&lt;/P&gt;&lt;P&gt;&amp;nbsp; {ErrorHandler, U_XDP},&amp;nbsp; // Channel 01 - Reserved&lt;/P&gt;&lt;P&gt;&amp;nbsp; {ErrorHandler, U_XDP},&amp;nbsp; // Channel 02 - Reserved&lt;/P&gt;&lt;P&gt;etc. etc.&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that main.c.o should not know or be concerned about the size of the XGate vector table. I'm a bit puzzled by this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not created a new project with the wizard - I'll give this a try and use what is generated as a reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I fixed the mistake of putting the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;XGATE_DATA in ROM. The only thing my handler does at this point is turn on a digital output so there is no Xgate data at this point, but will be once this is up and running. I adjusted the the pragma to be as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;#pragma CONST_SEG XGATE_CONST&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;and placed this in ROM in the linker file. In the map file I confirmed that the linker put the Xgate vector table in this section. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;If it helps, here are the key registers at runtime:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;IMG alt="pastedImage_3.png" src="https://community.nxp.com/t5/image/serverpage/image-id/58088i11F3D12CFAECD988/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_3.png" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;IMG alt="pastedImage_4.png" src="https://community.nxp.com/t5/image/serverpage/image-id/58121i240771B6B0A46CE2/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_4.png" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;IMG alt="pastedImage_2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/58043i69EC3E7C39AF0CBA/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;IMG alt="pastedImage_6.png" src="https://community.nxp.com/t5/image/serverpage/image-id/58122i59D3894CC4A78664/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_6.png" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;IMG alt="pastedImage_7.png" src="https://community.nxp.com/t5/image/serverpage/image-id/58176iC20C5860C1127391/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_7.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As far as I can tell, the interrupt is firing, the Xgate is on and should be accepting interrupts, the Xgate vector register is pointing to the vector address, and the vector corresponding to PIT0 is pointing to the handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:18:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416700#M11219</guid>
      <dc:creator>jimmymitt</dc:creator>
      <dc:date>2020-11-02T13:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Xgate - not processing interrupts</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416701#M11220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="replyToName"&gt;jimmymitt,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Just detail, command XGMCTL = 0xFFE1; will set XGDBG bit and this way Enter into Debug Mode. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In debug mode the RISC core will be halted&lt;/STRONG&gt; (and the debug features will be enabled).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please use command XGMCTL= 0xFBC1; /* XGE | XGFRZ | XGIE */ for enabling XGATE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to also recommend enable XGATE after setting interrupt routing and priorities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to recommend also initialize stacks (valid for S12XE, missing on S12XD). For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGISPSEL= 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGISP31= (unsigned int)(void*__far)(XGATE_STACK_L + 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGISPSEL= 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGISP74= (unsigned int)(void*__far)(XGATE_STACK_H + 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGISPSEL= 0;&lt;/P&gt;&lt;P&gt;In prm file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM_XGATE_STK_L_ = NO_INIT DATA_FAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xF81000 TO 0xF8107D;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM_XGATE_STK_L = NO_INIT DATA_FAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xF8107E TO 0xF8107F;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM_XGATE_STK_H_ = NO_INIT DATA_FAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xF81080 TO 0xF810FD;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM_XGATE_STK_H = NO_INIT DATA_FAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xF810FE TO 0xF810FF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XGATE_STK_L&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO RAM_XGATE_STK_L;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XGATE_STK_H&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO RAM_XGATE_STK_H;&lt;/P&gt;&lt;P&gt;This default initialization is missing in older CW versions. It doesn’t problem until we want use interrupt nesting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 15:17:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416701#M11220</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-09-30T15:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Xgate - not processing interrupts</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416702#M11221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, its now working. Thanks to both of you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up adding setting up a new project using the project wizard and porting some of the content to my existing project. Mostly better management of the memory segments. Also initializing the stacks which was also suggested by Radek.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also made all other changes recommended by Radek. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% sure but suspect that changing to &lt;STRONG style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;XGMCTL= 0xFBC1 &lt;/STRONG&gt;made the difference. I made a number of changes at once. I made a number of changes at once and am in a bit of a rush now so did not go back and confirm the exact change that fixed it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple follow up questions on the linker file:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I could not find a detailed description of syntax for the prm. Is there a manual that describes keywords etc...&lt;/LI&gt;&lt;LI&gt;In particular, I am not sure what the IBCC_FAR of this line does:&lt;BR /&gt;ROM_XGATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; DATA_FAR IBCC_FAR&amp;nbsp; 0xE18000 TO 0xE1BFFF ALIGN 2[1:1];&lt;/LI&gt;&lt;LI&gt;I noticed in some examples that the RELOCATE action was used - I'd like to know what exactly this does. I may end up needing to run this from RAM in the end and I think I'll need to know more about the prm file.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 23:25:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416702#M11221</guid>
      <dc:creator>jimmymitt</dc:creator>
      <dc:date>2015-09-30T23:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Xgate - not processing interrupts</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416703#M11222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="replyToName"&gt;jimmymitt,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Some details about prm file and linker could be found here:&lt;/P&gt;&lt;P&gt;"c:\Program Files (x86)\Freescale\CWS12v5.1\Help\PDF\Build_Tools_Utilities.pdf"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IBCC_FAR keyword is related mainly to MemoryBanker feature. Please look at TN262 for more details about this tool:&lt;/P&gt;&lt;P&gt;"c:\Program Files (x86)\Freescale\CWS12v5.1\Help\PDF\TN262.pdf"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RELOCATE_TO to keyword is described in Build_Tools_Utilities.pdf. This feature is used for example in AN4258 Serial Bootloader for S12(X) Microcontrollers Based on 180 nm Technology&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN4258.pdf"&gt;http://www.freescale.com/files/microcontrollers/doc/app_note/AN4258.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN4258SW.zip"&gt;http://www.freescale.com/files/microcontrollers/doc/app_note/AN4258SW.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for copy flash routines into RAM, that we could load application code into the same flash block where bootloader code is placed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 08:56:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Xgate-not-processing-interrupts/m-p/416703#M11222</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-10-01T08:56:04Z</dc:date>
    </item>
  </channel>
</rss>

