<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: Help with Interrupts / Stack error                (MCF5282EVB)</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158299#M4822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks both, but there is still something weird going on.&lt;BR /&gt;&lt;BR /&gt;Now the interrupt routines are executed, at least in the internal SRAM (mcf5282).&amp;nbsp; It rolls fine.&amp;nbsp; But when I flash the code, the same interrupt routine is'nt triggerd at all.&amp;nbsp; Its weird because in the SRAM, it is working, bit in the Internal FLASH,&amp;nbsp; the Interrupt routine are'nt showing.&amp;nbsp; We checked the mask register, the SR, ... everything seems ok.&amp;nbsp; What could be wrong?&lt;BR /&gt;&lt;BR /&gt;/**************************************************************************&lt;BR /&gt;FUNCT: ref_reached_interrupt&lt;BR /&gt;***************************************************************************/&lt;BR /&gt;&lt;BR /&gt;__declspec(interrupt:0)&lt;BR /&gt;void ref_reached_timer_isr(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clears the event flags */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_DTIM_DTER(0) =&amp;nbsp; (0 |MCF_DTIM_DTER_CAP | MCF_DTIM_DTER_REF);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++Seconds[0];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;FB&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 May 2008 05:16:02 GMT</pubDate>
    <dc:creator>francois_boucha</dc:creator>
    <dc:date>2008-05-24T05:16:02Z</dc:date>
    <item>
      <title>Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158295#M4818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I m doing a simple timer project where I need DMA timer 0 to triggers an interrupt.&amp;nbsp; It works but very badly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see in the image I attached, the stack is going crazy as it does some weird routines, and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;does not unstack. &amp;nbsp; The exception I get is CASE 14: Format error StackFramePC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone tell me what could be wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FB&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 00:23:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158295#M4818</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2008-05-23T00:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158296#M4819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi,&lt;BR /&gt;SO I was'nt calling the routine from the right place, and now the problem is fixed.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;By the way, could anyone please tell me &lt;U&gt;why is the 0 needed&lt;/U&gt; (or maybe not ? ) in this:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;B&gt;__declspec(interrupt :0)&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;FB&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 01:46:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158296#M4819</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2008-05-23T01:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158297#M4820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Rather than guess what might be wrong, why don't post the set up code and the interrupt&amp;nbsp; handler code?&lt;BR /&gt;&lt;BR /&gt;You did put the address of the handler in the table?&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 01:51:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158297#M4820</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-05-23T01:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158298#M4821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;For a discussion of __declspec, see this posting.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2016&amp;amp;query.id=17833#M2016" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2016&amp;amp;query.id=17833#M2016&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 16:03:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158298#M4821</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2008-05-23T16:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158299#M4822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks both, but there is still something weird going on.&lt;BR /&gt;&lt;BR /&gt;Now the interrupt routines are executed, at least in the internal SRAM (mcf5282).&amp;nbsp; It rolls fine.&amp;nbsp; But when I flash the code, the same interrupt routine is'nt triggerd at all.&amp;nbsp; Its weird because in the SRAM, it is working, bit in the Internal FLASH,&amp;nbsp; the Interrupt routine are'nt showing.&amp;nbsp; We checked the mask register, the SR, ... everything seems ok.&amp;nbsp; What could be wrong?&lt;BR /&gt;&lt;BR /&gt;/**************************************************************************&lt;BR /&gt;FUNCT: ref_reached_interrupt&lt;BR /&gt;***************************************************************************/&lt;BR /&gt;&lt;BR /&gt;__declspec(interrupt:0)&lt;BR /&gt;void ref_reached_timer_isr(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clears the event flags */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_DTIM_DTER(0) =&amp;nbsp; (0 |MCF_DTIM_DTER_CAP | MCF_DTIM_DTER_REF);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++Seconds[0];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;FB&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2008 05:16:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158299#M4822</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2008-05-24T05:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158300#M4823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;OK, just a guess... but maybe the exception vector table is not set up correctly?&lt;BR /&gt;&lt;BR /&gt;Also, I did notice from the screen snapshot you posted, that you are calling the interrupt service routine in a slightly unusual way. Nothing wrong with it, but it's not the normal way to do things...&lt;BR /&gt;&lt;BR /&gt;You appear to have all interrupts handled initially by a single routine 'asm_exception_handler', which is then checking the exception number and calling your interrupt-specific routine 'ref_reached_timer_isr'.&lt;BR /&gt;&lt;BR /&gt;A more common way to do this would be to plug the appropriate interrupt-specific entry in the exception vector table, so that when the interrupt happens 'ref_reached_timer_isr' is called directly. The table entry should contain a pointer to your ISR. If the exception vector table is in Flash, the pointer will need to be assembled in.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2008 16:47:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158300#M4823</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2008-05-27T16:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Interrupts / Stack error                (MCF5282EVB)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158301#M4824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;Also, I did notice from the screen snapshot you posted, that you are calling the interrupt service routine in a slightly unusual way. Nothing wrong with it, but it's not the normal way to do things...&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;You are right about it, and thanks by the way.&amp;nbsp; The way the interrupt routine is called is'nt very ...efficient.&lt;BR /&gt;&lt;BR /&gt;So that has been corrected.&amp;nbsp; The isr is now located in the vector table of the exception.c file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Simon Marsden wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;...&lt;BR /&gt;&lt;BR /&gt;A more common way to do this would be to plug the appropriate interrupt-specific entry in the exception vector table, so that when the interrupt happens 'ref_reached_timer_isr' is called directly. The table entry should contain a pointer to your ISR. If the exception vector table is in Flash, the pointer will need to be assembled in.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;And finally, maybe in Flash, the isr is'nt called.&amp;nbsp; So what should Ido to be sure that my isr entry in the vector table is good ?&lt;BR /&gt;&lt;BR /&gt;should I use this function?&lt;BR /&gt;&lt;PRE&gt;interrupt_init(uint8 source, uint8 ipl, void (*handler)(void));&lt;/PRE&gt;&lt;BR /&gt;many thanks,&lt;BR /&gt;Francois&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:03:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Help-with-Interrupts-Stack-error-MCF5282EVB/m-p/158301#M4824</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2020-10-29T09:03:12Z</dc:date>
    </item>
  </channel>
</rss>

