<?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のトピックStack top overwritten while single-stepping</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Stack-top-overwritten-while-single-stepping/m-p/168269#M5539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As the title suggests I'm having trouble with the stack seemingly getting trashed by the debugger. This happens with the built-in SofTec debugger of my DEMO9S12XSFAME board and a freshly installed Code Warrior 5.1.&lt;/P&gt;&lt;P&gt;More specifically it only happens with interrupts globally enabled in the MCU and the debugger set to ignore maskable interrupts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a repro case. Install it as the main file of a default 9S12XS128 C project, select the SofTec debugger, configure it to disable maskable ISR's, and try stepping through the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include "hidef.h"void failure(void *__far ptr, char stay) { volatile int dummy = (unsigned long) ptr &amp;gt;&amp;gt; 16; do&amp;nbsp; ++dummy; while(stay); // Generated code: /* STAB 3,-SP &amp;lt;- Stores the argument at $20F4 LDX&amp;nbsp; 7,SP LDAB 6,SP CLRA STD&amp;nbsp; 1,SPloop: INCW 1,SP &amp;lt;- Trashes $20F4 w. $C4 LDAB 0,SP BNE&amp;nbsp; loop LEAS 3,SP RTC */}void main(void) { EnableInterrupts; failure(NULL, 0);}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:15:54 GMT</pubDate>
    <dc:creator>implicit</dc:creator>
    <dc:date>2020-10-29T09:15:54Z</dc:date>
    <item>
      <title>Stack top overwritten while single-stepping</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Stack-top-overwritten-while-single-stepping/m-p/168269#M5539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As the title suggests I'm having trouble with the stack seemingly getting trashed by the debugger. This happens with the built-in SofTec debugger of my DEMO9S12XSFAME board and a freshly installed Code Warrior 5.1.&lt;/P&gt;&lt;P&gt;More specifically it only happens with interrupts globally enabled in the MCU and the debugger set to ignore maskable interrupts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a repro case. Install it as the main file of a default 9S12XS128 C project, select the SofTec debugger, configure it to disable maskable ISR's, and try stepping through the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include "hidef.h"void failure(void *__far ptr, char stay) { volatile int dummy = (unsigned long) ptr &amp;gt;&amp;gt; 16; do&amp;nbsp; ++dummy; while(stay); // Generated code: /* STAB 3,-SP &amp;lt;- Stores the argument at $20F4 LDX&amp;nbsp; 7,SP LDAB 6,SP CLRA STD&amp;nbsp; 1,SPloop: INCW 1,SP &amp;lt;- Trashes $20F4 w. $C4 LDAB 0,SP BNE&amp;nbsp; loop LEAS 3,SP RTC */}void main(void) { EnableInterrupts; failure(NULL, 0);}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:15:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Stack-top-overwritten-while-single-stepping/m-p/168269#M5539</guid>
      <dc:creator>implicit</dc:creator>
      <dc:date>2020-10-29T09:15:54Z</dc:date>
    </item>
  </channel>
</rss>

