<?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: Trigger an machine exception interrupt but nothing push in stack in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950082#M16640</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/reference-manual/S12ZCPU_RM_V1.pdf" title="https://www.nxp.com/docs/en/reference-manual/S12ZCPU_RM_V1.pdf"&gt;https://www.nxp.com/docs/en/reference-manual/S12ZCPU_RM_V1.pdf&lt;/A&gt;&amp;nbsp; says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;7.3.3 Machine Exception&lt;/STRONG&gt;&lt;BR /&gt;Machine exceptions are caused by the Memory Map Control module (MMC).&lt;BR /&gt;A Machine Exception causes the S12Z CPU to jump to the address in the Machine Exception vector as&lt;BR /&gt;soon as the current instruction finishes execution.&lt;BR /&gt;When execution of a Machine Exception begins, both the X- and I-bits are set and the U-bit is cleared.&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;A Machine Exception is considered a severe system error, so nothing is written on the stack.&lt;/STRONG&gt;&lt;/SPAN&gt; The MMC&lt;BR /&gt;module saves information about the S12Z CPU state which otherwise would be lost due to exception&lt;BR /&gt;processing (e.g. the Program Counter register and X-, I- and U-bits from the Condition Code Register).&lt;BR /&gt;This information can then be used to identify the source of the Machine Exception.&lt;BR /&gt;Please refer to the MCU reference manual for more information about possible sources of machine&lt;BR /&gt;exceptions present on a specific MCU.&lt;BR /&gt;NOTE&lt;BR /&gt;Machine exceptions are meant to signal severe system problems. Software&lt;BR /&gt;is expected to re-initialize the system when a machine exception occurs.&lt;BR /&gt;Unlike interrupts or software exceptions, a machine exception causes the&lt;BR /&gt;CPU to not perform any stack operations, so it is not possible to return to&lt;BR /&gt;application code by simply using an RTI (or an RTS) instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jul 2019 06:36:41 GMT</pubDate>
    <dc:creator>lama</dc:creator>
    <dc:date>2019-07-22T06:36:41Z</dc:date>
    <item>
      <title>Trigger an machine exception interrupt but nothing push in stack</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950081#M16639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I get a strange problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I try to&amp;nbsp;trigger an machine exception interrupt by ECC generation module but nothing push in stack and which causes S12ZCPU illegal access memory after return form interrupt（wrong address return to PC (0x10529E)）.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Anyone has met case like this before?&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 for helping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;&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;&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;&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Yadong Wang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 05:06:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950081#M16639</guid>
      <dc:creator>wangyadong</dc:creator>
      <dc:date>2019-07-22T05:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger an machine exception interrupt but nothing push in stack</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950082#M16640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/reference-manual/S12ZCPU_RM_V1.pdf" title="https://www.nxp.com/docs/en/reference-manual/S12ZCPU_RM_V1.pdf"&gt;https://www.nxp.com/docs/en/reference-manual/S12ZCPU_RM_V1.pdf&lt;/A&gt;&amp;nbsp; says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;7.3.3 Machine Exception&lt;/STRONG&gt;&lt;BR /&gt;Machine exceptions are caused by the Memory Map Control module (MMC).&lt;BR /&gt;A Machine Exception causes the S12Z CPU to jump to the address in the Machine Exception vector as&lt;BR /&gt;soon as the current instruction finishes execution.&lt;BR /&gt;When execution of a Machine Exception begins, both the X- and I-bits are set and the U-bit is cleared.&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;A Machine Exception is considered a severe system error, so nothing is written on the stack.&lt;/STRONG&gt;&lt;/SPAN&gt; The MMC&lt;BR /&gt;module saves information about the S12Z CPU state which otherwise would be lost due to exception&lt;BR /&gt;processing (e.g. the Program Counter register and X-, I- and U-bits from the Condition Code Register).&lt;BR /&gt;This information can then be used to identify the source of the Machine Exception.&lt;BR /&gt;Please refer to the MCU reference manual for more information about possible sources of machine&lt;BR /&gt;exceptions present on a specific MCU.&lt;BR /&gt;NOTE&lt;BR /&gt;Machine exceptions are meant to signal severe system problems. Software&lt;BR /&gt;is expected to re-initialize the system when a machine exception occurs.&lt;BR /&gt;Unlike interrupts or software exceptions, a machine exception causes the&lt;BR /&gt;CPU to not perform any stack operations, so it is not possible to return to&lt;BR /&gt;application code by simply using an RTI (or an RTS) instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:36:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950082#M16640</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2019-07-22T06:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger an machine exception interrupt but nothing push in stack</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950083#M16641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi lama,&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;Thank you for answering my question.&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;Does it mean that when machine exception occurs the only way to exit is to&amp;nbsp;&amp;nbsp;re-initialize the system even if the system problem is solved.&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;I am now working on memory test and ensure that double bit ECC error detection mechanism&amp;nbsp;is good during initialization.So I hope software triggers&amp;nbsp;double bit ECC&amp;nbsp;error and then return from where it happens.&lt;/P&gt;&lt;P&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;&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;&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;&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Yadong&amp;nbsp;&amp;nbsp;&amp;nbsp;Wang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:58:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950083#M16641</guid>
      <dc:creator>wangyadong</dc:creator>
      <dc:date>2019-07-22T06:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger an machine exception interrupt but nothing push in stack</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950084#M16642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We recommend to generate reset ()S12Z safety manual.&lt;/P&gt;&lt;P&gt;However, this is application problem, you can do anything you want.&lt;/P&gt;&lt;P&gt;Theoretically as common solution, keeping in mind that some registers can be write once, stack has some value I can:&lt;/P&gt;&lt;P&gt;1) Go to the start of the code _Startup();&lt;/P&gt;&lt;P&gt;see file Start12.c in the project:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__EXTERN_C void _Startup(void) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;__asm {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LD S, #__SEG_END_SSTACK-1&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* initialize SP */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do not forget to define the function in the module where you call it from.&lt;/P&gt;&lt;P&gt;void _Startup(void);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Go to any function I want to continue. (good to think about stack.... asm LD S, #your value or re-initialization to the beginning value ,&amp;nbsp; asm &amp;nbsp; LD S, #__SEG_END_SSTACK-1&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* initialize SP */)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Go to anywhere you want to continue asm JMP .....&amp;nbsp; still you have to think about consequences to previous process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 09:17:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950084#M16642</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2019-07-22T09:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger an machine exception interrupt but nothing push in stack</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950085#M16643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 09:47:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Trigger-an-machine-exception-interrupt-but-nothing-push-in-stack/m-p/950085#M16643</guid>
      <dc:creator>wangyadong</dc:creator>
      <dc:date>2019-07-22T09:47:31Z</dc:date>
    </item>
  </channel>
</rss>

