LWIP Transmit cleanup task error - How mature is lwip?

28 Mar 2013

While having problems to get a DM9161 PHY working (http://mbed.org/users/frankvnk/code/lpc_phy_DM9161A/), i started checking out the lwip code and also searched the LPCWare community.

http://www.lpcware.com/content/bugtrackerissue/error-vtransmitcleanuptask-lpclwip-project mentiones an error in the 'Transmit cleanup task' in lpc17_emac.c. I checked the latest mbed library (https://mbed.org/users/emilmont/code/lwip-eth/file/dd8b8f5b449a/arch/lpc17_emac.c) and this error is also present:

            /* De-allocate all queued TX pbufs */
            for (idx = 0; idx < LPC_NUM_BUFF_RXDESCS; idx++) {
                if (lpc_enetif->txb[idx] != NULL) {
                    pbuf_free(lpc_enetif->txb[idx]);
                    lpc_enetif->txb[idx] = NULL;
                }
            }

According to the LPCWare link LPC_NUM_BUFF_RXDESCS should be LPC_NUM_BUFF_TXDESCS

Since this is not the first problem i encountered, can anyone tell me how mature the lwip 1.4 code is (the previous error is already resolved: http://mbed.org/forum/bugs-suggestions/topic/4268/). I have the impression the latest lwip (1.4) is still under heavy development and needs additional debugging.

I already managed to port EasyWeb (http://mbed.org/users/frankvnk/code/LPC1768_Mini-DK_EasyWeb_DM9161/ - works quite slow - needs improvement) but my goal is to use the mbed rtos+lwip. I know the DM9161 PHY is not part of the mbed environment but i would like to know if anyone can assist me with this PHY.

Note : Adam Green already assisted me (thanks Adam), and is also willing to run a remote debug session, but i don't want to waste his time until i know my lpc_phy_DM9161A.c code is error free. I also found many other code on the web - the best source for comparison is the atmel at91sam7x-ek since they use the DM9161 on their demo board (i did notice the code contains goto statements....).

Initialisation and DHCP work fine but further communication is troublesome. There are probably timing problems in the EMAC / DM9161 PHY communication : when i add printf's in my DM9161 file (in lpc_update_phy_sts), on rare occasions, the code runs correctly. I would like to know where i can lower the EMAC/PHY communication speed (besides changing the RMII management clock rate).

I really hope this topic gets more attention than my previous one (i know this should probably be moved to the lwip forum but it is worth mentioning here if other users try a different PHY - by the way, the 8720 PHY works perfectly with little modifications).

Currently also checking http://lwip.100.n7.nabble.com/Crash-in-new-1-4-1-td21096.html#a21098 and http://lpcware.com/content/bugtrackerissue/lpc17xx-mac-bugs

03 Jun 2013

Hi Frank,

Frank Vannieuwkerke wrote:

LPC_NUM_BUFF_RXDESCS should be LPC_NUM_BUFF_TXDESCS

Thank you for reporting this issue, we fixed that in Rev 6 of the lwip-eth library.

As you can see, we are not actively developing the Ethernet driver for the LPC1768, but we are relying on the NXP LPC port of the Lightweight TCP/IP Stack: the last change to this repository was submitted 10 months ago.

Emilio