<?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: Msg send blocked in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187194#M3355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's fixed. If somoene gets the same behavior with RTCS, he/she may look at the interrupt levels. I had barebone code which installed interrupts (_int_install_isr ...) with very high priority (low value). This seems to break the scheduler. This could explain why the TCP/IP task refused to release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this post (&lt;A href="https://community.freescale.com/message/96384#96384" title="https://community.freescale.com/message/96384#96384"&gt;https://community.freescale.com/message/96384#96384&lt;/A&gt;) says that it's fixed in mqx 3.8.&lt;/P&gt;&lt;P&gt;Anyway I put higher interrupt values (lower priority) for my user-defined interrupts, and it works now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;nbsp;&lt;/P&gt;&lt;P&gt;Emilien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2012 17:26:26 GMT</pubDate>
    <dc:creator>emilien</dc:creator>
    <dc:date>2012-08-14T17:26:26Z</dc:date>
    <item>
      <title>Msg send blocked</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187192#M3353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have&amp;nbsp;a&amp;nbsp;task&amp;nbsp;which&amp;nbsp;sends&amp;nbsp;1460Bytes&amp;nbsp;UDP&amp;nbsp;datagrams&amp;nbsp;every&amp;nbsp;0.1&amp;nbsp;seconds.&amp;nbsp;I'm&amp;nbsp;using&amp;nbsp;IAR+k60n512(rev d)+rtcs&amp;nbsp;onwindows&amp;nbsp;and&amp;nbsp;I'm&amp;nbsp;watching&amp;nbsp;packets&amp;nbsp;with&amp;nbsp;wireshark.&amp;nbsp;I&amp;nbsp;have&amp;nbsp;two&amp;nbsp;problems&amp;nbsp;there:&lt;/P&gt;&lt;P&gt;-&amp;nbsp;First,&amp;nbsp;I&amp;nbsp;have&amp;nbsp;a&amp;nbsp;very&amp;nbsp;high&amp;nbsp;rate&amp;nbsp;of&amp;nbsp;lost&amp;nbsp;packets&amp;nbsp;(ok&amp;nbsp;it's&amp;nbsp;UDP&amp;nbsp;so&amp;nbsp;it&amp;nbsp;should&amp;nbsp;happen&amp;nbsp;sometimes,&amp;nbsp;but&amp;nbsp;I&amp;nbsp;would&amp;nbsp;expect&amp;nbsp;it&amp;nbsp;to&amp;nbsp;be&amp;nbsp;lowerthan&amp;nbsp;20% :s)&lt;/P&gt;&lt;P&gt;-&amp;nbsp;Second,&amp;nbsp;my&amp;nbsp;network&amp;nbsp;task&amp;nbsp;sometimes&amp;nbsp;stops,&amp;nbsp;with&amp;nbsp;status&amp;nbsp;"Msg&amp;nbsp;send&amp;nbsp;blocked".&amp;nbsp;Then&amp;nbsp;the&amp;nbsp;RTCS&amp;nbsp;task&amp;nbsp;won't&amp;nbsp;even&amp;nbsp;answer&amp;nbsp;toICMP&amp;nbsp;requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while(1){&lt;BR /&gt;if&amp;nbsp;(_lwevent_wait_ticks(&amp;amp;NETW_lwevent,&amp;nbsp;1,&amp;nbsp;TRUE,&amp;nbsp;0) !=&amp;nbsp;MQX_OK) // it is triggered every 0.1s&lt;BR /&gt;_task_block();&amp;nbsp;&lt;BR /&gt;_lwevent_clear(&amp;amp;NETW_lwevent,&amp;nbsp;1);&lt;BR /&gt;byteCount&amp;nbsp;=&amp;nbsp;sendto(sock, &amp;amp;buffer,&amp;nbsp;sizeof(buffer),&amp;nbsp;0, &amp;amp;raddr,&amp;nbsp;sizeof(sockaddr_in));&lt;BR /&gt;if&amp;nbsp;(byteCount&amp;nbsp;!=&amp;nbsp;sizeof(filterResult)){&lt;BR /&gt;printf("\nsendto()&amp;nbsp;failed&amp;nbsp;with&amp;nbsp;count&amp;nbsp;%ld&amp;nbsp;and&amp;nbsp;error&amp;nbsp;%lx\n&amp;nbsp;Task&amp;nbsp;blocked.",&amp;nbsp;count,&amp;nbsp;RTCS_geterror(sock));&lt;BR /&gt;_task_block();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;microcontroller&amp;nbsp;is&amp;nbsp;a&amp;nbsp;bit&amp;nbsp;busy&amp;nbsp;doing&amp;nbsp;other&amp;nbsp;things&amp;nbsp;(from&amp;nbsp;which&amp;nbsp;writing&amp;nbsp;to&amp;nbsp;sdcard,&amp;nbsp;filtering,&amp;nbsp;sampling...)&amp;nbsp;but&amp;nbsp;I&amp;nbsp;set&amp;nbsp;thepriorities&amp;nbsp;of&amp;nbsp;my&amp;nbsp;network&amp;nbsp;task&amp;nbsp;and&amp;nbsp;RTCS&amp;nbsp;higher&amp;nbsp;(lower&amp;nbsp;value)&amp;nbsp;than&amp;nbsp;the&amp;nbsp;other&amp;nbsp;tasks.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;tried&amp;nbsp;the&amp;nbsp;flag&amp;nbsp;RTCS_MSG_NONBLOCK,&amp;nbsp;but&amp;nbsp;still&amp;nbsp;get&amp;nbsp;the&amp;nbsp;same&amp;nbsp;kind&amp;nbsp;of&amp;nbsp;behavior.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;noticed&amp;nbsp;also&amp;nbsp;that&amp;nbsp;even&amp;nbsp;with&amp;nbsp;the&amp;nbsp;provided&amp;nbsp;rtcs&amp;nbsp;examples,&amp;nbsp;it&amp;nbsp;sometimes&amp;nbsp;fails&amp;nbsp;to&amp;nbsp;answer&amp;nbsp;ICMP&amp;nbsp;requests.&amp;nbsp;Do&amp;nbsp;you&amp;nbsp;think&amp;nbsp;it&amp;nbsp;couldbe&amp;nbsp;related&amp;nbsp;to&amp;nbsp;hardware? I already corrected the sdcard+eth issue...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&amp;nbsp;regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 21:10:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187192#M3353</guid>
      <dc:creator>emilien</dc:creator>
      <dc:date>2012-08-08T21:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Msg send blocked</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187193#M3354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- The lost packets were due to hardware issue (the microcontroller clocks and the Eth clock had the same frequency but different sources, knowing that it's surprising it worked for 80% of packets !)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Actually the "Msg send blocked" seems unrelated to the fact that the TCP/IP task hangs... After a bit of investigation it seems I'm blocked in this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tcpip_msg = (TCPIP_MESSAGE_PTR)RTCS_msgq_receive(tcpip_qid, timeout, RTCS_data_ptr-&amp;gt;TCPIP_msg_pool);&lt;/P&gt;&lt;P&gt;if (tcpip_msg) {&lt;BR /&gt;if (NULL != tcpip_msg-&amp;gt;COMMAND)&lt;BR /&gt;tcpip_msg-&amp;gt;COMMAND(tcpip_msg-&amp;gt;DATA);&lt;BR /&gt;RTCS_msg_free(tcpip_msg);&lt;BR /&gt;}&lt;BR /&gt;timeout = TCP_tick();&lt;/P&gt;&lt;P&gt;timeafter = RTCS_time_get();&lt;BR /&gt;timedelta = timeafter - timebefore;&lt;BR /&gt;timebefore = timeafter;&lt;BR /&gt;timedelta = TCPIP_Event_time(timedelta);&lt;BR /&gt;if (timedelta != 0) {&lt;BR /&gt;if ((timedelta &amp;lt; timeout) || (timeout == 0)) {&lt;BR /&gt;timeout = timedelta;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is inside the tcpip.c file in the RTCS sources. I could not localise exactly the problem but I saw somoene reported issues with the TCP/IP message queue (&lt;A __default_attr="95540" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/95540" jivemacro="thread" title="https://community.freescale.com/thread/95540"&gt;https://community.freescale.com/thread/95540&lt;/A&gt;). Is it fixed? Could this be the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 23:34:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187193#M3354</guid>
      <dc:creator>emilien</dc:creator>
      <dc:date>2012-08-09T23:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Msg send blocked</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187194#M3355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's fixed. If somoene gets the same behavior with RTCS, he/she may look at the interrupt levels. I had barebone code which installed interrupts (_int_install_isr ...) with very high priority (low value). This seems to break the scheduler. This could explain why the TCP/IP task refused to release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this post (&lt;A href="https://community.freescale.com/message/96384#96384" title="https://community.freescale.com/message/96384#96384"&gt;https://community.freescale.com/message/96384#96384&lt;/A&gt;) says that it's fixed in mqx 3.8.&lt;/P&gt;&lt;P&gt;Anyway I put higher interrupt values (lower priority) for my user-defined interrupts, and it works now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;nbsp;&lt;/P&gt;&lt;P&gt;Emilien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 17:26:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Msg-send-blocked/m-p/187194#M3355</guid>
      <dc:creator>emilien</dc:creator>
      <dc:date>2012-08-14T17:26:26Z</dc:date>
    </item>
  </channel>
</rss>

