<?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: FTPSRV_release in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439693#M14684</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;Thanks for your answer, but my problem is not with a particular use : server_tid is the one which is include in the Freescale FTPSRV_STRUCT struct. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just tried your idea, but there is no difference.&lt;/P&gt;&lt;P&gt;I think that everybody who try to use the FTPSRV will have this symptom...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2015 07:31:46 GMT</pubDate>
    <dc:creator>yb</dc:creator>
    <dc:date>2015-08-17T07:31:46Z</dc:date>
    <item>
      <title>FTPSRV_release</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439691#M14682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;CW 10.6 / MQX 4.2 / K60&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I'm using FTPSRV with no problems, everything is OK... except if I have an active connection and then, call FTPSRV_release().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this call, EVERY tasks on my projects are blocked for ever in ftpsrc.c line 96 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(server-&amp;gt;server_tid)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _sched_yield() ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to add a _time_delay() in this loop and I have other tasks OK. But the FTPSRV NEVER shutdown before I cut the FTP client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nobody shutdown the FTPSRV() ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Yvan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 17:46:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439691#M14682</guid>
      <dc:creator>yb</dc:creator>
      <dc:date>2015-08-13T17:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: FTPSRV_release</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439692#M14683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The release mechanism depends on the ftpsrv_server_task() setting the server-&amp;gt;server_tid member to zero. As it is a different task than the one that calls FTPSRV_release(), I think it must have "volatile" keyword to force the compiler to always read from memory when checking the value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe your compiler optimized this out - you can check by looking into assembly when inside the while loop. Try to declare "server_tid" as volatile.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 18:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439692#M14683</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2015-08-13T18:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: FTPSRV_release</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439693#M14684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;Thanks for your answer, but my problem is not with a particular use : server_tid is the one which is include in the Freescale FTPSRV_STRUCT struct. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just tried your idea, but there is no difference.&lt;/P&gt;&lt;P&gt;I think that everybody who try to use the FTPSRV will have this symptom...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 07:31:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439693#M14684</guid>
      <dc:creator>yb</dc:creator>
      <dc:date>2015-08-17T07:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: FTPSRV_release</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439694#M14685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This thread is more than one year old. But I see same effect in MQX 4.2.0 and no fix could be found.&lt;/P&gt;&lt;P&gt;A work around which works for me is to use following code:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTPSRV_STRUCT*&amp;nbsp; server = (FTPSRV_STRUCT*)FTPs_hd;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = shutdown ( server-&amp;gt;sock_v4, FLAG_ABORT_CONNECTION );&lt;/PRE&gt;&lt;P&gt;instead of calling FTPSRV_release().&lt;/P&gt;&lt;P&gt;It looks like that closesocket() does not release the select() in ftpsrv_wait_for_conn() but shutdown() does.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 11:18:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439694#M14685</guid>
      <dc:creator>Fabi</dc:creator>
      <dc:date>2016-10-18T11:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: FTPSRV_release</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439695#M14686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The call to FTPSRV_release()&amp;nbsp; may get stuck also because of a wrong task priority schema. The RTCS user manual gives a hint about it.&lt;/P&gt;&lt;P&gt;I got the case with following task priorities:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;TCP_TASK&amp;nbsp; =&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;FTP_SERVER_TASK = 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;TASK that calls FTPSRV_release() = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the manual it's stated that FTP_SERVER_TASK must be lower than TCP_TASK. I would like to add, also the call task of FTPSRV_release() must be lower. So after adjusting the task priorities to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;TCP_TASK&amp;nbsp; =&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;FTP_SERVER_TASK = 11&lt;/P&gt;&lt;P&gt;&amp;nbsp;TASK that calls FTPSRV_release() = 12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FTPSRV exits gracefully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Stefan Haase&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 11:34:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTPSRV-release/m-p/439695#M14686</guid>
      <dc:creator>stefanhaase</dc:creator>
      <dc:date>2016-11-10T11:34:39Z</dc:date>
    </item>
  </channel>
</rss>

