<?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: WAI Intruction and Debug in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212968#M8893</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Breakpoints, watchpoints and triggers should be working.&amp;nbsp;Breakpoints can be hit only when&amp;nbsp;MCU isn't sleeping and when it hits your breakpoint. I think either your MCU is still sleeping or maybe&amp;nbsp;COP or other reset happens while MCU is in WAIT mode. Reset resets all breakpoints registers and debugger has to&amp;nbsp;reinitialize them.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Regarding halting MCU while in wait mode. I also can't do that and am compiling with some DEBUG macro defined, which suppresses my WAI code. To remind me code is compiled with DEBUG is enabled,&amp;nbsp;I have&amp;nbsp;something like this&amp;nbsp;in my code&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;-----------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;#ifdef DEBUG&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;#warning DEBUG blablabla&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;#endif&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;-------------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Regarding WAIT mode and BDM we have this in S12XD datasheet:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial" size="4"&gt;&lt;FONT face="Arial" size="4"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;15.1.2.3 Low-Power Modes&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;STRONG&gt;.. When CPU is in a low power mode (wait or stop mode) all BDM firmware commands as well as the hardware&lt;/STRONG&gt; &lt;STRONG&gt;BACKGROUND command can not be used&amp;nbsp;respectively are ignored. In this case the CPU can not enter&lt;/STRONG&gt; &lt;STRONG&gt;BDM active mode, and only hardware read and write commands are available...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#000000" size="1"&gt;BACKGROUND command is what is used to halt MCU.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jul 2010 14:05:12 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2010-07-15T14:05:12Z</dc:date>
    <item>
      <title>WAI Intruction and Debug</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212967#M8892</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;&lt;/P&gt;&lt;P&gt;I have several problems during the debugging process in my mc9sxdp512 with indart hcs12 (using CW 5.9 ). I can set breakpoint, watchpoint, or triggers but the program doesn't stop, so I can't debug correctly. Moreover, I can't halt the MCU normally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reading in several forums and technical supports I found the reason! Yes, I found it! The reason is wai instruction in my main procedure. So, if I want to debug properly my software I have to do it commenting this line ( _asm("wai") )... In most cases it isn't a problem, but why have to debug my software in other circumstances than real ones?&lt;/P&gt;&lt;P&gt;Ok! We have focused the problem, is there any possibility to resolve this "problem"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help,&lt;/P&gt;&lt;P&gt;Ruben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 18:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212967#M8892</guid>
      <dc:creator>RubenCG</dc:creator>
      <dc:date>2010-07-14T18:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: WAI Intruction and Debug</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212968#M8893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Breakpoints, watchpoints and triggers should be working.&amp;nbsp;Breakpoints can be hit only when&amp;nbsp;MCU isn't sleeping and when it hits your breakpoint. I think either your MCU is still sleeping or maybe&amp;nbsp;COP or other reset happens while MCU is in WAIT mode. Reset resets all breakpoints registers and debugger has to&amp;nbsp;reinitialize them.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Regarding halting MCU while in wait mode. I also can't do that and am compiling with some DEBUG macro defined, which suppresses my WAI code. To remind me code is compiled with DEBUG is enabled,&amp;nbsp;I have&amp;nbsp;something like this&amp;nbsp;in my code&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;-----------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;#ifdef DEBUG&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;#warning DEBUG blablabla&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;#endif&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;-------------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Regarding WAIT mode and BDM we have this in S12XD datasheet:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial" size="4"&gt;&lt;FONT face="Arial" size="4"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;15.1.2.3 Low-Power Modes&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;STRONG&gt;.. When CPU is in a low power mode (wait or stop mode) all BDM firmware commands as well as the hardware&lt;/STRONG&gt; &lt;STRONG&gt;BACKGROUND command can not be used&amp;nbsp;respectively are ignored. In this case the CPU can not enter&lt;/STRONG&gt; &lt;STRONG&gt;BDM active mode, and only hardware read and write commands are available...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#000000" size="1"&gt;BACKGROUND command is what is used to halt MCU.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 14:05:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212968#M8893</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-07-15T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: WAI Intruction and Debug</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212969#M8894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kef for your answer! I had read this paragraph in my MCU manual but I was looking for a trick (or something magical ... &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; ) to avoid it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro is a good idea. I hope some day I`ll be able to help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Ruben&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 16:48:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/WAI-Intruction-and-Debug/m-p/212969#M8894</guid>
      <dc:creator>RubenCG</dc:creator>
      <dc:date>2010-08-02T16:48:12Z</dc:date>
    </item>
  </channel>
</rss>

