<?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 _lwevent_set hangs in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181685#M2837</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem in one of my applications. I have a timer interrupt which should trigger every ms an event. The problem is that after some time (20 min - 2h), the _lwevent_set functions hangs up.&lt;/P&gt;&lt;PRE&gt;      while (q_ptr != (QUEUE_ELEMENT_STRUCT_PTR)         ((pointer)&amp;amp;event_ptr-&amp;gt;WAITING_TASKS))      {         td_ptr = (pointer)q_ptr;         _BACKUP_POINTER(td_ptr, TD_STRUCT, AUX_QUEUE);         next_q_ptr = q_ptr-&amp;gt;NEXT;         if (((td_ptr-&amp;gt;FLAGS &amp;amp; TASK_LWEVENT_ALL_BITS_WANTED) &amp;amp;&amp;amp;             ((td_ptr-&amp;gt;LWEVENT_BITS &amp;amp; set_bits) == td_ptr-&amp;gt;LWEVENT_BITS)) ||            ((!(td_ptr-&amp;gt;FLAGS &amp;amp; TASK_LWEVENT_ALL_BITS_WANTED)) &amp;amp;&amp;amp;             (td_ptr-&amp;gt;LWEVENT_BITS &amp;amp; set_bits)))         {  /* Start CR 406 */#if 0            _QUEUE_DEQUEUE(&amp;amp;event_ptr-&amp;gt;WAITING_TASKS, q_ptr);#endif            _QUEUE_REMOVE(&amp;amp;event_ptr-&amp;gt;WAITING_TASKS, q_ptr);/* End CR 406 */            _TIME_DEQUEUE(td_ptr, kernel_data);            td_ptr-&amp;gt;INFO = 0;            _TASK_READY(td_ptr, kernel_data);            /* store information about which bits caused task to be unblocked */            td_ptr-&amp;gt;LWEVENT_BITS &amp;amp;= set_bits;            set_bits &amp;amp;= ~(event_ptr-&amp;gt;AUTO &amp;amp; td_ptr-&amp;gt;LWEVENT_BITS);                     } /* Endif */         q_ptr = next_q_ptr;      } /*&lt;/PRE&gt;&lt;P&gt;next_q_ptr is equal to q_ptr, so the while loop becomes an endless loop. I don't know why this can happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did someone else already have a similar problem? The interrupt is installed by calling _int_install_isr().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The platform is a Kinetis&amp;nbsp;PK60DN512VLL10 with&amp;nbsp;MQX V3.8 compiled on Codwarrior 10.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:32:12 GMT</pubDate>
    <dc:creator>eichest</dc:creator>
    <dc:date>2020-10-29T09:32:12Z</dc:date>
    <item>
      <title>_lwevent_set hangs</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181685#M2837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem in one of my applications. I have a timer interrupt which should trigger every ms an event. The problem is that after some time (20 min - 2h), the _lwevent_set functions hangs up.&lt;/P&gt;&lt;PRE&gt;      while (q_ptr != (QUEUE_ELEMENT_STRUCT_PTR)         ((pointer)&amp;amp;event_ptr-&amp;gt;WAITING_TASKS))      {         td_ptr = (pointer)q_ptr;         _BACKUP_POINTER(td_ptr, TD_STRUCT, AUX_QUEUE);         next_q_ptr = q_ptr-&amp;gt;NEXT;         if (((td_ptr-&amp;gt;FLAGS &amp;amp; TASK_LWEVENT_ALL_BITS_WANTED) &amp;amp;&amp;amp;             ((td_ptr-&amp;gt;LWEVENT_BITS &amp;amp; set_bits) == td_ptr-&amp;gt;LWEVENT_BITS)) ||            ((!(td_ptr-&amp;gt;FLAGS &amp;amp; TASK_LWEVENT_ALL_BITS_WANTED)) &amp;amp;&amp;amp;             (td_ptr-&amp;gt;LWEVENT_BITS &amp;amp; set_bits)))         {  /* Start CR 406 */#if 0            _QUEUE_DEQUEUE(&amp;amp;event_ptr-&amp;gt;WAITING_TASKS, q_ptr);#endif            _QUEUE_REMOVE(&amp;amp;event_ptr-&amp;gt;WAITING_TASKS, q_ptr);/* End CR 406 */            _TIME_DEQUEUE(td_ptr, kernel_data);            td_ptr-&amp;gt;INFO = 0;            _TASK_READY(td_ptr, kernel_data);            /* store information about which bits caused task to be unblocked */            td_ptr-&amp;gt;LWEVENT_BITS &amp;amp;= set_bits;            set_bits &amp;amp;= ~(event_ptr-&amp;gt;AUTO &amp;amp; td_ptr-&amp;gt;LWEVENT_BITS);                     } /* Endif */         q_ptr = next_q_ptr;      } /*&lt;/PRE&gt;&lt;P&gt;next_q_ptr is equal to q_ptr, so the while loop becomes an endless loop. I don't know why this can happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did someone else already have a similar problem? The interrupt is installed by calling _int_install_isr().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The platform is a Kinetis&amp;nbsp;PK60DN512VLL10 with&amp;nbsp;MQX V3.8 compiled on Codwarrior 10.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181685#M2837</guid>
      <dc:creator>eichest</dc:creator>
      <dc:date>2020-10-29T09:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: _lwevent_set hangs</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181686#M2838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi eichest,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find _int_install_kernel_isr in MQX reference manual. It might be a solution for your problem. You are using timer to trigger an even every ms, which could raise some latency problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is copied from User Guide: Note that _int_install_kernel_isr() call is only enabled if the vector table is located in RAM memory (see MQX_ROM_VECTORS configuration option in section 3.14, “Configuring MQX at Compile Time”).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2012 19:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181686#M2838</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-07-22T19:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: _lwevent_set hangs</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181687#M2839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kojto&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer, it seems you are right and I have/had a problem with the interrupt latency. I hope I could solve the problem by changing the priorities (a test is running).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm still a little confused how it can happen that _lwevent_set hangs. I have no explaination for that, do you know what could be the problem there? Because I'm a little afraid that the problem could occur again after 1-2d.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 22:18:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181687#M2839</guid>
      <dc:creator>eichest</dc:creator>
      <dc:date>2012-07-23T22:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: _lwevent_set hangs</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181688#M2840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp; I have the same problem with a 82259-V2 and MQX 3.6.&amp;nbsp;&amp;nbsp; Can you tell me what you think the problem is?&amp;nbsp; What leads you to believe this is an interrupt latency problem?&amp;nbsp; Shouldn't I be able to call as often and as fast as I want to start a thread running that has been blocked pending on an event?&amp;nbsp; The processing time for the lwevent_set is on the order of 8 uS and I am setting calling this function in a serial interrupt service routine, the entire receive interrupt time is less than 15uS.&amp;nbsp; Note that I had done a similar thing on another project that used the SPI at a much higher baud rate.&amp;nbsp; The transmit routine is in the interrupt service for less than 5 uS.&amp;nbsp; These times are my application times and does not include the MQX overhead.&amp;nbsp; What did Stefan find as to the solution to his problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Will Hookway&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 17:29:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181688#M2840</guid>
      <dc:creator>WHookway</dc:creator>
      <dc:date>2012-11-21T17:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: _lwevent_set hangs</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181689#M2841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answer to my problem.&amp;nbsp; Since I had ported a large number of my base file from another application, I had provided alternate functions for interrupt enable and disable for project builds that did not include MQX.&amp;nbsp; These files were still in the build so the&amp;nbsp; function calls that enables / disables interrutps in the lwevent_set was not doing anything.&amp;nbsp; Didn't discover this until I actually stepped into the disable call.&amp;nbsp; Anyhow this was the source of my problem, not an interrupt latency problem.&amp;nbsp; This may help others if they stumble onto this unusual scenario.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Will&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 20:46:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwevent-set-hangs/m-p/181689#M2841</guid>
      <dc:creator>WHookway</dc:creator>
      <dc:date>2012-11-27T20:46:12Z</dc:date>
    </item>
  </channel>
</rss>

