<?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のトピックUnhandled Exception for vector I have installed a handler for!?</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-for-vector-I-have-installed-a-handler-for/m-p/263342#M7867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a K60&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do not understand why I am getting an Unhandled Exception for a vector I have installed a handler for!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a pin on PortE and initialize as follows:&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_13657136175783913" jivemacro_uid="_13657136175783913"&gt;
&lt;P&gt;#ifdef __MQX__
 if (!lwgpio_init(&amp;amp;fpga_irq, BSP_FPGA_IRQ, LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; sprintf(zarr, "Error opening FPGA IRQ %d\r\n", _task_errno);
&amp;nbsp;&amp;nbsp;&amp;nbsp; MON_PRINTF(zarr);
&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();
 }
 lwgpio_set_functionality(&amp;amp;fpga_irq, 1); // MUX=1 is GPIO
 lwgpio_set_attribute(&amp;amp;fpga_irq, LWGPIO_ATTR_PULL_UP, LWGPIO_AVAL_ENABLE);
 if (!lwgpio_int_init(&amp;amp;fpga_irq, LWGPIO_INT_MODE_FALLING)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MON_PRINTF("Initializing button GPIO for interrupt failed.\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt; /* install gpio interrupt service routine */
 _int_install_isr(lwgpio_int_get_vector(&amp;amp;fpga_irq), FPGA_lisr, (void *) &amp;amp;fpga_irq);
 /* set the interrupt level, and unmask the interrupt in interrupt controller*/
 _bsp_int_init(lwgpio_int_get_vector(&amp;amp;fpga_irq), 3, 0, TRUE);
 /* enable interrupt on GPIO peripheral module*/
 lwgpio_int_enable(&amp;amp;fpga_irq, TRUE);
#endif&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;And my ISR looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1365713822668549" jivemacro_uid="_1365713822668549"&gt;
&lt;P&gt;VOID FPGA_lisr(void *pin) {
&amp;nbsp;&amp;nbsp; FPGA_QUEUE_MSG msg;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR)pin);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; /* do stuff and send message (maybe) and return */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; msg.type = FPGA_IRQ;
&amp;nbsp;&amp;nbsp; msg.arg[0] = HS_Flags;
&amp;nbsp;&amp;nbsp; msg.arg[1] = IDLE_Flags;
&amp;nbsp;&amp;nbsp; msg.arg[2] = pm_last_lisr;
&amp;nbsp;&amp;nbsp; msg.arg[3] = pm_last_lisr;
&amp;nbsp;&amp;nbsp; _lwmsgq_send(fpga_queue, (uint32 *)&amp;amp;msg, 0);
}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;The interrupt does work but in short order I find myself getting a task exception set in _int_default_irs&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;I have a breakpoint set there and the vector is the same as the one I installed the handler for.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;What could cause that?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;Tom&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2013 21:01:23 GMT</pubDate>
    <dc:creator>w2vy</dc:creator>
    <dc:date>2013-04-11T21:01:23Z</dc:date>
    <item>
      <title>Unhandled Exception for vector I have installed a handler for!?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-for-vector-I-have-installed-a-handler-for/m-p/263342#M7867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a K60&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do not understand why I am getting an Unhandled Exception for a vector I have installed a handler for!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a pin on PortE and initialize as follows:&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_13657136175783913" jivemacro_uid="_13657136175783913"&gt;
&lt;P&gt;#ifdef __MQX__
 if (!lwgpio_init(&amp;amp;fpga_irq, BSP_FPGA_IRQ, LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; sprintf(zarr, "Error opening FPGA IRQ %d\r\n", _task_errno);
&amp;nbsp;&amp;nbsp;&amp;nbsp; MON_PRINTF(zarr);
&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();
 }
 lwgpio_set_functionality(&amp;amp;fpga_irq, 1); // MUX=1 is GPIO
 lwgpio_set_attribute(&amp;amp;fpga_irq, LWGPIO_ATTR_PULL_UP, LWGPIO_AVAL_ENABLE);
 if (!lwgpio_int_init(&amp;amp;fpga_irq, LWGPIO_INT_MODE_FALLING)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MON_PRINTF("Initializing button GPIO for interrupt failed.\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt; /* install gpio interrupt service routine */
 _int_install_isr(lwgpio_int_get_vector(&amp;amp;fpga_irq), FPGA_lisr, (void *) &amp;amp;fpga_irq);
 /* set the interrupt level, and unmask the interrupt in interrupt controller*/
 _bsp_int_init(lwgpio_int_get_vector(&amp;amp;fpga_irq), 3, 0, TRUE);
 /* enable interrupt on GPIO peripheral module*/
 lwgpio_int_enable(&amp;amp;fpga_irq, TRUE);
#endif&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;And my ISR looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1365713822668549" jivemacro_uid="_1365713822668549"&gt;
&lt;P&gt;VOID FPGA_lisr(void *pin) {
&amp;nbsp;&amp;nbsp; FPGA_QUEUE_MSG msg;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR)pin);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; /* do stuff and send message (maybe) and return */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; msg.type = FPGA_IRQ;
&amp;nbsp;&amp;nbsp; msg.arg[0] = HS_Flags;
&amp;nbsp;&amp;nbsp; msg.arg[1] = IDLE_Flags;
&amp;nbsp;&amp;nbsp; msg.arg[2] = pm_last_lisr;
&amp;nbsp;&amp;nbsp; msg.arg[3] = pm_last_lisr;
&amp;nbsp;&amp;nbsp; _lwmsgq_send(fpga_queue, (uint32 *)&amp;amp;msg, 0);
}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;The interrupt does work but in short order I find myself getting a task exception set in _int_default_irs&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;I have a breakpoint set there and the vector is the same as the one I installed the handler for.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;What could cause that?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;SPAN class="mce_paste_marker"&gt;Tom&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 21:01:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-for-vector-I-have-installed-a-handler-for/m-p/263342#M7867</guid>
      <dc:creator>w2vy</dc:creator>
      <dc:date>2013-04-11T21:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Exception for vector I have installed a handler for!?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-for-vector-I-have-installed-a-handler-for/m-p/263343#M7868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&amp;nbsp; Please be very careful when &lt;SPAN style="color: #000000; font-family: helvetica, arial; font-size: 12px; background-color: #f8f8f8;"&gt;_lwmsgq_send&lt;/SPAN&gt; used in the ISR. &lt;/P&gt;&lt;P&gt;1, If LWMSGQ_SEND_BLOCK_ON_FULL set, then _task_block maybe called.&lt;/P&gt;&lt;P&gt;2. If LWMSGQ_SEND_BLOCK_ON_FULL not set but the MSGQ is full, the function will fail with LWMSGQ_FULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like suggest that&lt;/P&gt;&lt;P&gt;1. Just sent a event to a task in the ISR.&lt;/P&gt;&lt;P&gt;2. Send the msg in the task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 02:31:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-for-vector-I-have-installed-a-handler-for/m-p/263343#M7868</guid>
      <dc:creator>JerryFan</dc:creator>
      <dc:date>2013-04-12T02:31:53Z</dc:date>
    </item>
  </channel>
</rss>

