<?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>MQX Software SolutionsのトピックRe: Unhandled Interrupt</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242185#M6822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was having a similar issue with a task that was aborting due to "unhandeld interrupt". I put a counter into the while(1) loop and waited for the exception to occur. The counter was always stopped at 4. So I cycled through 4 times and single stepped until it crashed. I kept my eye on any changes to file handles and discovered that an essential file handle was being changed .&lt;/P&gt;&lt;P&gt;I then used the watchpoint feature to see when the memory location was being changed. It ended up being another task that was writing the bad data. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2013 14:01:04 GMT</pubDate>
    <dc:creator>drummer</dc:creator>
    <dc:date>2013-03-28T14:01:04Z</dc:date>
    <item>
      <title>Unhandled Interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242184#M6821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to write a code so, that i can know in run time which task is having unhand led interrupt . so,that i can restart that task again.&lt;/P&gt;&lt;P&gt;I am using MQX 3.5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;netra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2013 05:04:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242184#M6821</guid>
      <dc:creator>netra</dc:creator>
      <dc:date>2013-03-27T05:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242185#M6822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was having a similar issue with a task that was aborting due to "unhandeld interrupt". I put a counter into the while(1) loop and waited for the exception to occur. The counter was always stopped at 4. So I cycled through 4 times and single stepped until it crashed. I kept my eye on any changes to file handles and discovered that an essential file handle was being changed .&lt;/P&gt;&lt;P&gt;I then used the watchpoint feature to see when the memory location was being changed. It ended up being another task that was writing the bad data. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 14:01:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242185#M6822</guid>
      <dc:creator>drummer</dc:creator>
      <dc:date>2013-03-28T14:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242186#M6823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MQX has a way to figure that issue out.&amp;nbsp; You can use _task_set_exception_handler to install a exception handler to capture what you want.Please refer the demo code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13648106903851416" jivemacro_uid="_13648106903851416"&gt;
&lt;P&gt;static void expt_frm_dump(pointer ext_frm_ptr)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; static char *expt_name[] = {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "None",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Reset",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "NMI",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "HardFault",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MemManage",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "BusFault",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "UsageFault",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Rsvd",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Rsvd",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Rsvd",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "SVCall",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Debug Monitor",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Rsvd",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "PendSV",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "SysTick"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint_32 excpt_num = __get_PSR() &amp;amp; 0x1F;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; printf("Opps, bad thing happened.\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(excpt_num &amp;lt; 16){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("The exception [%s] throw by TASK 0x%x\n",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expt_name[excpt_num] , _task_get_id());&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Dump the exception frame as :\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("R0:\t0x%08x\n", *((uint_32 *)ext_frm_ptr));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("R1:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 1));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("R2:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 2));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("R3:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 3));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("R12:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 4));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("LR:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 5));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("PC:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 6));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("PSR:\t0x%08x\n", *((uint_32 *)ext_frm_ptr + 7));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }else{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("The external interrupt %d occured while no handler to serve it.\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void&amp;nbsp; task_exception_handler(_mqx_uint para, pointer stack_ptr)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;#if 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; __asm (&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; "push {lr}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&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; "mrs r0, psp&amp;nbsp;&amp;nbsp; \n"&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; "bl&amp;nbsp;&amp;nbsp;&amp;nbsp; expt_frm_dump&amp;nbsp;&amp;nbsp; \n"&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; "pop {pc}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \n"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;#endif&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointer expt_frm_ptr = (pointer)__get_PSP();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; expt_frm_dump(expt_frm_ptr);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void hello_task(unsigned long para)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; unsigned int *p_bad = (unsigned int *)0;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; printf("Hello, MQX\n");&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; printf("Install the _int_exception_isr to replace the _int_default_isr\n");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; _int_install_exception_isr();&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set the exception handler of the task */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; _task_set_exception_handler(_task_get_id(), task_exception_handler);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; *p = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This will issue a HardFault exception&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; _task_block();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;BTW, unhandeld interrupt should be definely avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:
Use C++ code highlight in the Advanced editor. Thanks!

Message was edited by: Martin Kojtal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 02:33:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242186#M6823</guid>
      <dc:creator>JerryFan</dc:creator>
      <dc:date>2013-04-01T02:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242187#M6824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello netra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering about your intention. Could you please explain us why would you restart the task which causes an unhandled interrupt?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;0xc0170&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 10:27:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Interrupt/m-p/242187#M6824</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2013-04-01T10:27:41Z</dc:date>
    </item>
  </channel>
</rss>

