<?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>LPC MicrocontrollersのトピックRe: LWIP on LPC4357, stuck in lpc_low_level_output</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685537#M27613</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I am using WireShark to see the network traffic. I can confirm the same problem exists in the ethernet tcp echo raw demo, running on external memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Aug 2017 15:58:13 GMT</pubDate>
    <dc:creator>mj7man</dc:creator>
    <dc:date>2017-08-08T15:58:13Z</dc:date>
    <item>
      <title>LWIP on LPC4357, stuck in lpc_low_level_output</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685535#M27611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm stuck here with the TX side of my app. It appears I am running out of descriptors. I've already modified the famous loop that is problematic as follows:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;(in lpc18xx_43xx_emac)&lt;/P&gt;&lt;P&gt;&amp;nbsp;volatile u32_t check = lpc_tx_ready(netif);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while(dn &amp;gt; check)&lt;BR /&gt;#if NO_SYS == 0&lt;BR /&gt; { xSemaphoreTake(lpc_netifdata-&amp;gt;xTXDCountSem, 0);}&lt;BR /&gt;#else&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; lpc_tx_reclaim(netif);&lt;BR /&gt;&amp;nbsp; check = lpc_tx_ready(netif);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The strange thing is this is only happening when I'm sending a payload that is following a full packet. So if I'm sending anything under 1460 bytes I can do as many transmissions as I want. When I send 1460 followed by a shorter packet of say 500 then it gets stuck. It is very strange. I'll include the mechanisms I'm using to queue the data.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;send_buffer(const void* pvBuffer, uint32 uiNumBytes)&lt;/P&gt;&lt;P&gt;struct pbuf *ptr;&lt;BR /&gt; ptr = pbuf_alloc(PBUF_TRANSPORT, uiNumBytes , PBUF_RAM);&lt;BR /&gt; pbuf_take(ptr, pvBuffer, uiNumBytes);&lt;BR /&gt; // std::memcpy(ptr-&amp;gt;payload, pvBuffer, uiNumBytes);&lt;BR /&gt;// ptr-&amp;gt;len = ptr-&amp;gt;tot_len = uiNumBytes;&lt;BR /&gt; return AddDataAndSend(ptr);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if(mxDataSet.out_pb == NULL || mxDataSet.out_pb-&amp;gt;tot_len == 0)&lt;BR /&gt; {&lt;BR /&gt; // load data to out_pb&lt;BR /&gt; if(mxDataSet.out_pb-&amp;gt;tot_len == 0)&lt;BR /&gt; {&lt;BR /&gt; pbuf_free(mxDataSet.out_pb);&lt;BR /&gt; }&lt;BR /&gt; mxDataSet.out_pb = ptr;&lt;BR /&gt; }else&lt;BR /&gt; {&lt;BR /&gt; pbuf_cat(mxDataSet.out_pb, ptr);&lt;BR /&gt; }&lt;BR /&gt; return tcp_client_send_data_set(&amp;amp;mxDataSet);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;which is implemented as follows&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void tcp_client_raw_send(struct EStreamDataSet* data_set)&lt;BR /&gt;{&lt;BR /&gt; struct pbuf *ptr;&lt;BR /&gt; err_t wr_err = ERR_OK;&lt;/P&gt;&lt;P&gt;while ((wr_err == ERR_OK) &amp;amp;&amp;amp; (data_set-&amp;gt;out_pb != NULL) &amp;amp;&amp;amp; (data_set-&amp;gt;out_pb-&amp;gt;len &amp;lt;= tcp_sndbuf(data_set-&amp;gt;pcb)))&lt;BR /&gt; {&lt;BR /&gt; ptr = data_set-&amp;gt;out_pb;&lt;BR /&gt; /* enqueue data for transmission */&lt;BR /&gt; wr_err = tcp_write(data_set-&amp;gt;pcb, ptr-&amp;gt;payload, ptr-&amp;gt;len, 1);&lt;BR /&gt; if (wr_err == ERR_OK) {&lt;BR /&gt; /* continue with next pbuf in chain (if any) */&lt;BR /&gt; data_set-&amp;gt;out_pb = ptr-&amp;gt;next;&lt;BR /&gt; if(data_set-&amp;gt;out_pb != NULL) {&lt;BR /&gt; /* new reference! */&lt;BR /&gt; pbuf_ref(data_set-&amp;gt;out_pb);&lt;BR /&gt; }&lt;BR /&gt; /* chop first pbuf from chain */&lt;BR /&gt; pbuf_free(ptr);&lt;BR /&gt; } else if(wr_err == ERR_MEM) {&lt;BR /&gt; /* we are low on memory, try later / harder, defer to poll */&lt;BR /&gt; data_set-&amp;gt;out_pb = ptr;&lt;BR /&gt; } else {&lt;BR /&gt; /* other problem ?? */&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;static err_t tcp_client_raw_sent(void *arg, struct tcp_pcb *tpcb, u16_t len)&lt;BR /&gt;{&lt;BR /&gt; struct EStreamDataSet *data_set;&lt;BR /&gt; data_set = (struct EStreamDataSet *)arg;&lt;/P&gt;&lt;P&gt;LWIP_UNUSED_ARG(len);&lt;/P&gt;&lt;P&gt;if(data_set-&amp;gt;out_pb != NULL)&lt;BR /&gt; {&lt;BR /&gt; /* still got pbufs to send */&lt;BR /&gt; tcp_sent(tpcb, tcp_client_raw_sent);&lt;BR /&gt; tcp_client_raw_send(data_set);&lt;BR /&gt; } else&lt;BR /&gt; {&lt;BR /&gt; /* no more pbufs to send */&lt;BR /&gt; }&lt;BR /&gt; return ERR_OK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Do you think I'm experiencing underflow problems? Or is this a different issue entirely?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the payloads are getting queued in seperate calls to the send function, the first with a full buffer 1460 the second with an amount less than that. In this instance it seems that second packets descriptor is not clearing, and after 4 of these sequences of 2 (the number of descriptors I have) I get stuck in an infinite loop in emac.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oh and just in case, here's my poll&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static err_t&lt;BR /&gt;tcp_client_raw_poll(void *arg, struct tcp_pcb *tpcb)&lt;BR /&gt;{&lt;BR /&gt; err_t ret_err;&lt;BR /&gt; struct EStreamDataSet *data_set;&lt;BR /&gt; data_set = (struct EStreamDataSet *)arg;&lt;/P&gt;&lt;P&gt;if (data_set != NULL)&lt;BR /&gt; {&lt;BR /&gt; if ((data_set-&amp;gt;out_pb != NULL) &amp;amp;&amp;amp; (data_set-&amp;gt;out_pb-&amp;gt;tot_len &amp;gt; 0))&lt;BR /&gt; {&lt;BR /&gt; /* there is a remaining pbuf (chain) */&lt;BR /&gt; tcp_client_raw_send(data_set);&lt;BR /&gt; } else&lt;BR /&gt; {&lt;BR /&gt; /* no remaining pbuf (chain) */&lt;BR /&gt; // TODO: what needs to happen here?&lt;BR /&gt; if (data_set-&amp;gt;out_pb != NULL)&lt;BR /&gt; {&lt;BR /&gt; // Free the buffer.&lt;BR /&gt; pbuf_free(data_set-&amp;gt;out_pb);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; ret_err = ERR_OK;&lt;BR /&gt; } else&lt;BR /&gt; {&lt;BR /&gt; /* nothing to be done */&lt;BR /&gt;// tcp_abort(tpcb);&lt;BR /&gt; ret_err = ERR_ABRT;&lt;BR /&gt; }&lt;BR /&gt; return ret_err;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2017 23:45:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685535#M27611</guid>
      <dc:creator>mj7man</dc:creator>
      <dc:date>2017-07-27T23:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP on LPC4357, stuck in lpc_low_level_output</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685536#M27612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="286936" data-username="mj7man" href="https://community.nxp.com/people/mj7man"&gt;Mitchell Jones&lt;/A&gt; ,&lt;/P&gt;&lt;DIV style="color: #000000; font-family: 微软雅黑; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16px; line-height: 1.5; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thank you for your interest in NXP Semiconductor products and&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #000000; font-family: 微软雅黑; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16px; line-height: 1.5; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;the opportunity to serve you.&lt;BR style="background-color: inherit;" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #000000; font-family: 微软雅黑; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16px; line-height: 1.5; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I was wondering if you can tell me which code you testing, and I also wonder whether you use the wireshark to testing.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #000000; font-family: 微软雅黑; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 16px; line-height: 1.5; background-color: #ffffff;"&gt;Have a great day,&lt;/DIV&gt;&lt;P&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2017 07:37:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685536#M27612</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-08-08T07:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP on LPC4357, stuck in lpc_low_level_output</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685537#M27613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I am using WireShark to see the network traffic. I can confirm the same problem exists in the ethernet tcp echo raw demo, running on external memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2017 15:58:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685537#M27613</guid>
      <dc:creator>mj7man</dc:creator>
      <dc:date>2017-08-08T15:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP on LPC4357, stuck in lpc_low_level_output</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685538#M27614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="286936" data-username="mj7man" href="https://community.nxp.com/people/mj7man"&gt;Mitchell Jones&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;I find that there are some lwip demos in the lpcopen_2_20_keil_iar_keil_mcb_4357, didn't these demo you run?&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Aug 2017 02:49:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685538#M27614</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-08-09T02:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP on LPC4357, stuck in lpc_low_level_output</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685539#M27615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I have the same type of problems (not with LWIP but with KEIL-MDK and a LPC4337)..&lt;/P&gt;&lt;P&gt;After a first send of 1440 bytes, the second send of&amp;nbsp;the rest of the frame (about 200 bytes) may fail.&lt;/P&gt;&lt;P&gt;I have a bit TX Underflow set in the DMA_STAT register of the EMAC, and I must reset the EMAC to have TCP transmissions again.&lt;/P&gt;&lt;P&gt;Did you find a solution to your problem ?&lt;/P&gt;&lt;P&gt;Jean-Marc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 09:41:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LWIP-on-LPC4357-stuck-in-lpc-low-level-output/m-p/685539#M27615</guid>
      <dc:creator>jean-marcrouxel</dc:creator>
      <dc:date>2019-04-16T09:41:38Z</dc:date>
    </item>
  </channel>
</rss>

