<?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: LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052202#M40751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Craig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your contributions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2020 22:15:29 GMT</pubDate>
    <dc:creator>Alexis_A</dc:creator>
    <dc:date>2020-07-20T22:15:29Z</dc:date>
    <item>
      <title>LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052200#M40749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using lwIP 2.1.2 on an LPC1766. I adapted the lwIP EMAC driver code from &lt;A href="https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769.zip"&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769&lt;/SPAN&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been having an issue where sometimes the Ethernet RX locks up — the processor's Ethernet MAC just stops receiving any packets, even though everything still appears to be configured normally in the MAC registers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tracked down the bug to the lwIP driver file &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;lpc17xx_40xx_emac.c&lt;/SPAN&gt;, function &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;lpc_low_level_input()&lt;/SPAN&gt;. The problem is the line:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p-&amp;gt;len = (u16_t) length;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the following if statement triggers (that is, if it is unable to allocate a new pbuf to replace the one just being taken for this received packet, due to low memory):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lpc_rx_queue(lpc_enetif-&amp;gt;pnetif) == 0) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it re-queues the current pbuf:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&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; lpc_rxqueue_pbuf(lpc_enetif, p);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, because of the previous line that sets &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;p-&amp;gt;len&lt;/SPAN&gt; to the length of this received packet, the pbuf now has a shorter length (the length of the packet just received), rather than its original length of &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;ENET_ETH_MAX_FLEN&lt;/SPAN&gt;. This means this pbuf is now unable to receive longer packets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once that bug happens a few times while receiving short packets, RX is effectively crippled in its ability to receive longer packets, and Ethernet RX effectively halts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fix is to move the line&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p-&amp;gt;len = (u16_t) length;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to be just below the comment:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Save size */&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ie where it also sets &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;p-&amp;gt;tot_len&lt;/SPAN&gt; to the length.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 06:37:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052200#M40749</guid>
      <dc:creator>craigmcqueenir</dc:creator>
      <dc:date>2020-07-16T06:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052201#M40750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;diff --git a/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769.old/software/lwip/lpclwip/arch/lpc17xx_40xx_emac.c b/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769/software/lwip/lpclwip/arch/lpc17xx_40xx_emac.c
index 09b39c2..892b389 100644
--- a/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769.old/software/lwip/lpclwip/arch/lpc17xx_40xx_emac.c
+++ b/lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769/software/lwip/lpclwip/arch/lpc17xx_40xx_emac.c
@@ -275,7 +275,6 @@ STATIC struct pbuf *lpc_low_level_input(struct netif *netif) {
 
    /* Zero-copy */
    p = lpc_enetif-&amp;gt;rxb[idx];
-   p-&amp;gt;len = (u16_t) length;
 
    /* Free pbuf from desriptor */
    lpc_enetif-&amp;gt;rxb[idx] = NULL;
@@ -302,6 +301,7 @@ STATIC struct pbuf *lpc_low_level_input(struct netif *netif) {
         p, length, idx));
 
     /* Save size */
+    p-&amp;gt;len = (u16_t) length;
     p-&amp;gt;tot_len = (u16_t) length;
     LINK_STATS_INC(link.recv);
    }
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 10:15:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052201#M40750</guid>
      <dc:creator>craigmcqueenir</dc:creator>
      <dc:date>2020-07-16T10:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052202#M40751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Craig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your contributions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 22:15:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052202#M40751</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-07-20T22:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052203#M40752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will the LPCOpen downloads be updated with a fix?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 07:58:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052203#M40752</guid>
      <dc:creator>craigmcqueenir</dc:creator>
      <dc:date>2020-07-21T07:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052204#M40753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, there is no news about further releases for LPCOpen so any comments and fixes about it are very appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 16:02:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1052204#M40753</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-07-21T16:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1766 LPCOpen lwIP EMAC driver bug locks up RX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1238906#M44106</link>
      <description>&lt;P&gt;I'm surprised to hear this. It is very much in NXP's best interests to respond to user-submitted bug reports, and to fix known bugs promptly. By doing so, NXP will improve its reputation as a company that produces robust products.&lt;/P&gt;&lt;P&gt;It would be great if you could contact the people in NXP responsible for doing LPCOpen, and notify them of this bug report.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 22:43:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1766-LPCOpen-lwIP-EMAC-driver-bug-locks-up-RX/m-p/1238906#M44106</guid>
      <dc:creator>craigmcqueenir</dc:creator>
      <dc:date>2021-03-02T22:43:31Z</dc:date>
    </item>
  </channel>
</rss>

