<?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: Failing to return from interrupt (newbi question) - MC9S08QE128 in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187175#M14107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Henrik,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Further to Fabio's insight -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I assume that the variable m_time is global.&amp;nbsp; If so,&amp;nbsp;during the ANSI initialisation process, the variable should have been assigned a default value of zero.&amp;nbsp; However, it is also possible that, when you created the CW project, you elected not to allow ANSI initialisation code, and this may account for your problem.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;If this is the situation, and few variables are affected by the lack of general initialisation, you&amp;nbsp;might explicitly initialise the variable within main() function&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The "uninitialised memory" error message would be applicable to full chip simulation only.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2008 12:23:22 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2008-02-07T12:23:22Z</dc:date>
    <item>
      <title>Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187172#M14104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi Folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Im new to the arcitecure and Ide (CodeWarrior) and find this very confusing... I have a timer interrupt that should fire every 1ms. When I set a break point in TPM_ISR, I get there but when Im about to return from the ISR (at the RTI instruction) I get the error message "Error: At location 0299 -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error: Attempt to use invalid or uninitialized memory". Has anyone a clue about the problem here? Where could the problem be?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ISR (probably not the problem):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void interrupt VectorNumber_Vtpm3ch3 TPM_ISR(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; m_time++;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; TPM3C3SC_CH3F;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Clears timer flag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; TPM3C3SC_CH3F = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, Im not running on the Full Chip simulation, not real hardware.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Henrik&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by hek on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-02-06&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;12:33 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 20:24:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187172#M14104</guid>
      <dc:creator>hek</dc:creator>
      <dc:date>2008-02-06T20:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187173#M14105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;It is possible that you have enabled more interrupts that you have not written any code for.&lt;/DIV&gt;&lt;DIV&gt;So when an interrupt occurs, there is no code to execute there.&lt;/DIV&gt;&lt;P&gt;I also saw that you have no reset interrupt flag in your code. So each time you exit the interrupt, you will immediatly get another one.&lt;/P&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Ake&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 21:13:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187173#M14105</guid>
      <dc:creator>Ake</dc:creator>
      <dc:date>2008-02-06T21:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187174#M14106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Henrik,&lt;BR /&gt;&lt;BR /&gt;It is not clear if you are using Full Chip Simulation (FCS) or In-Circuit Debugging.&lt;BR /&gt;&lt;BR /&gt;According to your description, it looks like you are using FCS. The problem here is that you are probabli trying to increment a non-initialized variable (m_time).&lt;BR /&gt;&lt;BR /&gt;You could try to initialize m_time in the beginning of your code. This will probably solve your problem.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 00:46:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187174#M14106</guid>
      <dc:creator>fabio</dc:creator>
      <dc:date>2008-02-07T00:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187175#M14107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Henrik,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Further to Fabio's insight -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I assume that the variable m_time is global.&amp;nbsp; If so,&amp;nbsp;during the ANSI initialisation process, the variable should have been assigned a default value of zero.&amp;nbsp; However, it is also possible that, when you created the CW project, you elected not to allow ANSI initialisation code, and this may account for your problem.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;If this is the situation, and few variables are affected by the lack of general initialisation, you&amp;nbsp;might explicitly initialise the variable within main() function&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The "uninitialised memory" error message would be applicable to full chip simulation only.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 12:23:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187175#M14107</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-07T12:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187176#M14108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for your replies!&lt;BR /&gt;&lt;BR /&gt;Actually, the problem was that I for some reason had the Timer Interrupt activated... If i cleared the TOIE bit everything worked just fine. &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; m_time is not a global variable (and it is initialized), its a static member...&lt;BR /&gt;&lt;BR /&gt;I was using Full Chip SImulation&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henrik&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 15:25:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187176#M14108</guid>
      <dc:creator>hek</dc:creator>
      <dc:date>2008-02-07T15:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187177#M14109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Henrik,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;This highlights the need to initialize all interrupt vectors, whether the interrupt is in use, or not, just in case a spurious interrupt should occur for whatever reason.&amp;nbsp; As a minimum requirement, all unused vectors should point to an RTI instruction, or an empty ISR in C.&amp;nbsp; Additionally, you might consider the possibility of identifying the interrupt source to assist with identification of the "unused " interrupt event, for debug purposes.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 17:13:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187177#M14109</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-07T17:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187178#M14110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;True true. I tried to identify the interrup in True-Time Simulator, but didnt find the correct panel i suppose...&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 17:44:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187178#M14110</guid>
      <dc:creator>hek</dc:creator>
      <dc:date>2008-02-07T17:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187179#M14111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;I agree with Bigmac regarding spurious interrups, but spurious interrupt in an FCS session ? I don't think so...&lt;BR /&gt;&lt;BR /&gt;Hek, probably there is another thing wrong with your code ...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;DIV&gt;&lt;/DIV&gt;&lt;SPAN class="time_text"&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by fabio on &lt;SPAN class="date_text"&gt;2008-02-07&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:15 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 18:12:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187179#M14111</guid>
      <dc:creator>fabio</dc:creator>
      <dc:date>2008-02-07T18:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to return from interrupt (newbi question) - MC9S08QE128</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187180#M14112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Since the TPM modules are simulated, and can generate interrupts within an FCS session, I guess this can be classified as "spurious", if unintended but&amp;nbsp;caused by&amp;nbsp;a programming error, as seems to be the case in question.&amp;nbsp; This type of error still needs to be weeded out, whether in FCS, or during real operation&amp;nbsp;in a debug session.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;To specifically identify the source of each interrupt event would seem to require a separate ISR for every interrupt vector, at least for the QE128 device.&amp;nbsp; For the unused interrupts, presumably a byte value to represent the interrupt source would need to be dumped in a variable, for later analysis.&amp;nbsp; In many instances, the ISR might need to clear all flags associated with that interrupt, to prevent repeated interrupts occurring for the single spurious event.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 18:49:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Failing-to-return-from-interrupt-newbi-question-MC9S08QE128/m-p/187180#M14112</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-07T18:49:08Z</dc:date>
    </item>
  </channel>
</rss>

