<?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: Occasionally_lwmsgq_receive Never Returns in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381599#M12710</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Leif Zars,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing the solution to this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Feb 2015 21:52:22 GMT</pubDate>
    <dc:creator>soledad</dc:creator>
    <dc:date>2015-02-20T21:52:22Z</dc:date>
    <item>
      <title>Occasionally_lwmsgq_receive Never Returns</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381595#M12706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am testing my application and all is well for the first hour or so. But it seems that something fowls up the scheduler so that on of my tasks never executes again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am stuck and would really appreciate some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line that never returns is: if (_lwmsgq_receive(SL_Q_PTR, (void*) &amp;amp;msg, LWMSGQ_RECEIVE_BLOCK_ON_EMPTY, 100, 0) == MQX_OK) {&lt;/P&gt;&lt;P&gt;It functions fine for a few hundred if not thousand calls.&lt;/P&gt;&lt;P&gt;I found some odd details in the MQX debugging tools. All of my other tasks that should be blocking on as similar &lt;SPAN style="font-size: 13.3333330154419px;"&gt;_lwmsgq_receive call show a State of 'LW MSg RX Blocked, timeout' the offending task shows a State of 'Time delay blocked'. I also show 16 messages in the offending tasks blocking lwm queue, so it should be executing. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Another oddity is that the kernel time is 59902 seconds, functioning tasks have a 'Task Status'&amp;nbsp; 'Timeout' of around 59595, while the problem task has a timeout of 31341, not sure if that knowledge is worth anything. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;All elements of the MQX appear to be valid, I ran the MQX 'Check for Errors utility', no problems found.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the Kernel data structure but am not sure how to inspect it for the error. How do you think I should proceed debugging this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Leif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 16:07:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381595#M12706</guid>
      <dc:creator>leifzars</dc:creator>
      <dc:date>2015-02-17T16:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Occasionally_lwmsgq_receive Never Returns</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381596#M12707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking in the _mqx_kernel_data struct and at the TIMEOUT_QUEUE member. It shows a size of 1 but the queue contains 4 unique elements. So it seems that this queue might be corrupted ?&lt;/P&gt;&lt;P&gt;All but the dead task are referenced in this Q, even though its size == 1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="MQX_TimeOutQ Mem.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50578iC75B15765C022521/image-size/large?v=v2&amp;amp;px=999" role="button" title="MQX_TimeOutQ Mem.jpg" alt="MQX_TimeOutQ Mem.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 16:31:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381596#M12707</guid>
      <dc:creator>leifzars</dc:creator>
      <dc:date>2015-02-17T16:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Occasionally_lwmsgq_receive Never Returns</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381597#M12708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added some QA code to inspect the TIMEOUT_QUEUE at a few key points in the MQX library. I was hoping that I would be able to determine the exact point at which the structure was being corrupted. I wasn't so lucky, but I thought I would share the info I got.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the call stack for the last thread, my 'testQStruct' function found the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;TIMEOUT_QUEUE struct corrupted in the `&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_time_notify_kernel` function&lt;/SPAN&gt;. I&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt; included a pic of the block of code (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_time_notify_kernel)&lt;/SPAN&gt; that I first notice the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;I don't &lt;/SPAN&gt;believe&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt; the error is &lt;/SPAN&gt;occurring&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt; in the `_time_notify_kernel`.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="TQ_Failed_Stack.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50602i64D1FEB560A25105/image-size/large?v=v2&amp;amp;px=999" role="button" title="TQ_Failed_Stack.jpg" alt="TQ_Failed_Stack.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="time_notify_kernel.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50603i925ABA6F34336591/image-size/large?v=v2&amp;amp;px=999" role="button" title="time_notify_kernel.jpg" alt="time_notify_kernel.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't get why when I review the memory the struct looks fine. ie My algorithm shows that the struct's actual size does not match its reported size, yet when I manually view it it is fine.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="trace.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/50608i50D9D5CFB6DEDEB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="trace.jpg" alt="trace.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void testQStruct(QUEUE_STRUCT* q){&lt;/P&gt;&lt;P&gt;&amp;nbsp; QUEUE_ELEMENT_STRUCT_PTR elementPtr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; int ctN = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; int ctP = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; elementPtr = q-&amp;gt;NEXT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while((void*)elementPtr != (void*)q){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctN++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementPtr = elementPtr-&amp;gt;NEXT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(q-&amp;gt;SIZE != ctN)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("BKPT #0\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; elementPtr = q-&amp;gt;PREV;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while((void*)elementPtr != (void*)q){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctP++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementPtr = elementPtr-&amp;gt;PREV;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(q-&amp;gt;SIZE != ctP)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("BKPT #0\n");&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 15:38:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381597#M12708</guid>
      <dc:creator>leifzars</dc:creator>
      <dc:date>2015-02-18T15:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Occasionally_lwmsgq_receive Never Returns</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381598#M12709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe I found the problem, I mistakenly had an interrupt set to a higher priority then appropriate compared to MQX recommended setting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 20:26:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381598#M12709</guid>
      <dc:creator>leifzars</dc:creator>
      <dc:date>2015-02-18T20:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Occasionally_lwmsgq_receive Never Returns</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381599#M12710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Leif Zars,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing the solution to this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 21:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381599#M12710</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2015-02-20T21:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Occasionally_lwmsgq_receive Never Returns</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381600#M12711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Leif!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This post has saved my week!&lt;/P&gt;&lt;P&gt;I was having the same problem and feared to spend the whole week looking for the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 07:46:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Occasionally-lwmsgq-receive-Never-Returns/m-p/381600#M12711</guid>
      <dc:creator>justanotheruser</dc:creator>
      <dc:date>2015-07-13T07:46:52Z</dc:date>
    </item>
  </channel>
</rss>

