<?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>Kinetis Software Development KitのトピックRe: problem while TCP Transmission of continuous data</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499827#M4740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;But how it should be if i need to send continuous sensor sampling data @48ksps having about 70 bytes of information per sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Punit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Mar 2016 05:00:47 GMT</pubDate>
    <dc:creator>punitkumar</dc:creator>
    <dc:date>2016-03-26T05:00:47Z</dc:date>
    <item>
      <title>problem while TCP Transmission of continuous data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499825#M4738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi There,&lt;/P&gt;&lt;P&gt;I'm using lwip TCP client using raw api with kinetis k64 MCU.&lt;/P&gt;&lt;P&gt;It's a high speed data transmission (about 2mbps), and the code looking working good.&lt;/P&gt;&lt;P&gt;But there is some problem, because of which the code jumps to sys_assert() functionafter transferring few 10s of MBs and stay there. The section of code&amp;nbsp; is as follows-&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void sys_assert( const char *msg )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //FSL:only needed for debugging&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #ifdef LWIP_DEBUG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF(msg);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\n\r");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OSA_EnterCritical(kCriticalDisableInt);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i'm transferring the data to lwip by repeatedly calling below section&lt;/P&gt;&lt;P&gt;if(ERR_OK == tcp_write(tcp_conn_pcb, p_byTCPSendBuff, g_TCPSendSize, TCP_WRITE_FLAG_MORE))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_TCPSendSize = 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the code jumps to sys_assert() from following section of tcp_in.c&lt;/P&gt;&lt;P&gt;LWIP_ASSERT("tcp_receive: valid queue length", pcb-&amp;gt;unacked != NULL ||&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pcb-&amp;gt;unsent != NULL);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone tell me&amp;nbsp; what i'm doing wrong and how can i prevent the execution from going to sys_assert()&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Punit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 10:23:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499825#M4738</guid>
      <dc:creator>punitkumar</dc:creator>
      <dc:date>2016-03-23T10:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: problem while TCP Transmission of continuous data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499826#M4739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Punit,&lt;/P&gt;&lt;P&gt;Regarding your question, I think there is problem if you transfer packet to an Ip address continuously.&lt;/P&gt;&lt;P&gt;How about using the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while(1)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; tcp_write(); &lt;/P&gt;&lt;P&gt;&amp;nbsp; tcp_recv();&lt;/P&gt;&lt;P&gt;&amp;nbsp; tcp_close();&lt;/P&gt;&lt;P&gt;delay();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2016 07:15:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499826#M4739</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-03-24T07:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: problem while TCP Transmission of continuous data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499827#M4740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;But how it should be if i need to send continuous sensor sampling data @48ksps having about 70 bytes of information per sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Punit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Mar 2016 05:00:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499827#M4740</guid>
      <dc:creator>punitkumar</dc:creator>
      <dc:date>2016-03-26T05:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem while TCP Transmission of continuous data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499828#M4741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Punit,&lt;/P&gt;&lt;P&gt;Regarding your question, let's figure out the required bit rate:&lt;/P&gt;&lt;P&gt;70*8*48KSPS=2.688Mega bits per second, as we know the Ethernet interface can transmit 100M bits per second if the Ethernet bus is idle, even if we consider the packet head load such as mac address/IP address/port, i think it is okay. Because you transfer stream, I suggest you use DGRAM mode(using&amp;nbsp; UDP protocol). I suggest you use the maximum packet size, in other words, put as many as samples into one packet to increase efficiency.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 02:42:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499828#M4741</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-03-28T02:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem while TCP Transmission of continuous data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499829#M4742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;can you please tell me how this condition be true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pcb-&amp;gt;snd_queuelen != 0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LWIP_ASSERT("tcp_receive: valid queue length", pcb-&amp;gt;unacked != NULL || pcb-&amp;gt;unsent != NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;i got this message, which is possible only if unacked == 0 &amp;amp; unsent == 0, but still queuelen != 0,i.e.,something there in queue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;awaiting your response&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Punit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 11:25:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499829#M4742</guid>
      <dc:creator>punitkumar</dc:creator>
      <dc:date>2016-04-08T11:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem while TCP Transmission of continuous data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499830#M4743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Punit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I discussed the issue with our experts and there are their points:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;lwIP with raw API must be used in single thread mode. Either everything in an interrupt or everything in a main. Make sure that your app follows a simple main loop design as shown below.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;It looks like the lwIP bare-metal architecture is not designed for interrupts.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It can work in interrupt but the code may not be mixed with lwIP usage in main application.&lt;/P&gt;&lt;P&gt;It simply must be one-threaded. Main application and hooks running in interrupts creating preemption.&lt;/P&gt;&lt;P&gt;All the code using lwIP must be in interrupt (cause of lwIP hooks), so using it in user application is forbidden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;lwIP wiki &lt;A href="http://lwip.wikia.com/wiki/LwIP_with_or_without_an_operating_system"&gt;http://lwip.wikia.com/wiki/LwIP_with_or_without_an_operating_system&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P style="margin-top: 12pt; margin-bottom: 12pt; margin-left: 1in; background: #bacdd8 none repeat scroll 0% 0%;"&gt;&lt;STRONG style="color: #3a3a3a; font-size: 10.5pt; font-family: 'Helvetica',sans-serif;"&gt;A simple main loop for a single-threaded system (lwIP 1.4.0+) might look like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-left: 1in; background: #f2f2f2 none repeat scroll 0% 0%;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Courier New'; color: #3a3a3a;"&gt;while(1) {&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1in; background: #f2f2f2 none repeat scroll 0% 0%;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Courier New'; color: #3a3a3a;"&gt;&amp;nbsp;&amp;nbsp; /* poll the driver, get any outstanding frames, alloc memory for them, and&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1in; background: #f2f2f2 none repeat scroll 0% 0%;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Courier New'; color: #3a3a3a;"&gt;&amp;nbsp;&amp;nbsp; call netif-&amp;gt;input, which is actually ip_input() */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1in; background: #f2f2f2 none repeat scroll 0% 0%;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Courier New'; color: #3a3a3a;"&gt;&amp;nbsp;&amp;nbsp; poll_driver(netif);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1in; background: #f2f2f2 none repeat scroll 0% 0%;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Courier New'; color: #3a3a3a;"&gt;&amp;nbsp;&amp;nbsp; sys_check_timeouts(); /* Handle all system timeouts for all core protocols */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1in; background: #f2f2f2 none repeat scroll 0% 0%;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Courier New'; color: #3a3a3a;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; there are no interrupts.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Atmel AN “Using the lwIP Network Stack” &lt;A href="http://www.atmel.com/Images/Atmel-42233-Using-the-lwIP-Network-Stack_AP-Note_AT04055.pdf"&gt;http://www.atmel.com/Images/Atmel-42233-Using-the-lwIP-Network-Stack_AP-Note_AT04055.pdf&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; “To enable the lwIP stack, the user application has to perform two functions calls from the main program loop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; • ethernetif_input() to treat incoming packets (function defined in the network interface GMAC driver)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; • timers_update() to refresh and trigger the lwIP timers (defined in the user application, typically under the&lt;/P&gt;&lt;P&gt;network folder)”&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It mean that the lwIP in bare-metal is polled – not interrupt driven.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To your question about &lt;SPAN style="color: #1f497d;"&gt;snd_queuelen please see the explanation here on the thread &lt;A href="http://lwip.100.n7.nabble.com/tcp-write-errors-on-snd-queuelen-td8599.html" title="http://lwip.100.n7.nabble.com/tcp-write-errors-on-snd-queuelen-td8599.html"&gt;lwip-users - tcp_write() errors on snd_queuelen&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, all these experts are on lwip community, please for lwIP-related questions, the user may ask on “Mailing list for lwIP users”: &lt;A href="https://lists.nongnu.org/mailman/listinfo/lwip-users"&gt;https://lists.nongnu.org/mailman/listinfo/lwip-users&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 14:43:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/problem-while-TCP-Transmission-of-continuous-data/m-p/499830#M4743</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2016-05-24T14:43:54Z</dc:date>
    </item>
  </channel>
</rss>

