lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] unsent_oversize mismatch / LPC1788+freeRtos / Basic TCP cod


From: Robert Lacoste
Subject: [lwip-users] unsent_oversize mismatch / LPC1788+freeRtos / Basic TCP code : HELP !
Date: Tue, 25 Mar 2014 18:47:12 +0100

Dear all,
 
We are integrating an application using LwIP 1.41 on an LPC1788 microcontroller and LAN8720 PHY under FreeRTos (LPCOpeen framework) and have, well, difficulties.
 
Narrowing the problem we ended up with a very basic test program. We started up with the TCPECHO demo, and modified it to simply send a continuous unidirectionnal flow on the socket as fast as possible (code here under). The code is working well, but after some hundred of frames transmitted the stack stops on an “unsent_oversize mismatch” assertion failed. Here under some traces.
 
We tried to disable the check (TCP_OVERSIZED=0), the assert doesn’t fails but the stack hangs. Looking at the Ethernet trafic it seems that the same frame is resent several times when the bug appears. It seems that this problem was already experienced by other users but we were not able to find out a workaround or a clear explanation of the problem, which seems strange based on the simple configuration.
 
Any HEEEEELP ?
 
Thanks,
Robert
 
------------------------------------------------
Test code :
 
static void tcpecho_thread(void *arg)
{
    struct netconn *conn, *newconn;
    err_t err;
    unsigned long i = 0;
    uint8_t buffer[100] = "\0";
    LWIP_UNUSED_ARG(arg);
 
    /* Create a new connection identifier. */
    conn = netconn_new(NETCONN_TCP);
 
    /* Bind connection to well known port number 7. */
    netconn_bind(conn, NULL, 7);
 
    /* Tell connection to go into listening mode. */
    netconn_listen(conn);
 
    while (1)
    {
        /* Grab new connection. */
        err = netconn_accept(conn, &newconn);
        /*printf("accepted new connection %p\n", newconn);*/
 
        /* Process the new connection. */
        if (err == ERR_OK)
        {
            while (1)
            {
                sprintf((char *)buffer, (const char *)"test Frame %ld\r\0", i);
                err = netconn_write(newconn, (void *) buffer, strlen((const char *)buffer), NETCONN_COPY);
                i++;
                if (err != ERR_OK)
                    printf("tcpecho: netconn_write: error \"%s\"\n", lwip_strerr(err));
 
            }
 
          /*printf("Got EOF, looping\n");*/
          /* Close connection and discard connection identifier. */
          netconn_close(newconn);
          netconn_delete(newconn);
        }
    }
}
 
------------------------------------------------
Full traces :
init done
Waiting for TCPIP thread to initialize...
Starting LWIP TCP echo server...
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000018
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000630
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000c48
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20001260
pbuf_alloc(length=308)
pbuf_alloc(length=308) == 0x200018bc
pbuf_header: old 0x20001904 new 0x200018fc (8)
pbuf_header: old 0x200018fc new 0x200018e8 (20)
pbuf_free(0x200018bc)
pbuf_free: deallocating 0x200018bc
Link connect status: 0
 
pbuf_alloc(length=308)
pbuf_alloc(length=308) == 0x200018bc
pbuf_header: old 0x20001904 new 0x200018fc (8)
pbuf_header: old 0x200018fc new 0x200018e8 (20)
pbuf_header: old 0x200018e8 new 0x200018da (14)
pbuf_free(0x200018bc)
pbuf_free: 0x200018bc has ref 1, ending here.
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x20001a40
pbuf_free(0x20001a40)
pbuf_free: 0x20001a40 has ref 1, ending here.
pbuf_free(0x200018bc)
pbuf_free: deallocating 0x200018bc
pbuf_free(0x20001a40)
pbuf_free: deallocating 0x20001a40
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x200018bc
pbuf_free(0x20000018)
pbuf_free: deallocating 0x20000018
Link connect status: 1
 
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000018
pbuf_header: old 0x20000640 new 0x2000064e (-14)
pbuf_header: old 0x2000064e new 0x20000662 (-20)
pbuf_header: old 0x20000662 new 0x2000066a (-8)
pbuf_alloc(length=308)
pbuf_alloc(length=308) == 0x20001ed4
pbuf_header: old 0x20001f1c new 0x20001f14 (8)
pbuf_header: old 0x20001f14 new 0x20001f00 (20)
pbuf_header: old 0x20001f00 new 0x20001ef2 (14)
pbuf_free(0x20001ed4)
pbuf_free: 0x20001ed4 has ref 1, ending here.
pbuf_free(0x20000630)
pbuf_free: deallocating 0x20000630
pbuf_free(0x20001ed4)
pbuf_free: deallocating 0x20001ed4
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000630
pbuf_header: old 0x20000c58 new 0x20000c66 (-14)
pbuf_free(0x20000c48)
pbuf_free: deallocating 0x20000c48
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000c48
pbuf_header: old 0x20001270 new 0x2000127e (-14)
pbuf_header: old 0x2000127e new 0x20001292 (-20)
pbuf_header: old 0x20001292 new 0x2000129a (-8)
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x20001ed4
pbuf_free(0x20001ed4)
pbuf_free: 0x20001ed4 has ref 1, ending here.
pbuf_free(0x20001260)
pbuf_free: deallocating 0x20001260
pbuf_free(0x20001ed4)
pbuf_free: deallocating 0x20001ed4
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20001260
pbuf_free(0x200018bc)
pbuf_free: deallocating 0x200018bc
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x200018bc
pbuf_free(0x200018bc)
pbuf_free: 0x200018bc has ref 1, ending here.
pbuf_free(0x200018bc)
pbuf_free: deallocating 0x200018bc
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x200018bc
pbuf_free(0x20000018)
pbuf_free: deallocating 0x20000018
IP_ADDR    : 192.168.1.29
 
NET_MASK   : 255.255.255.0
 
GATEWAY_IP : 192.168.1.1
 
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000018
pbuf_free(0x20000630)
pbuf_free: 0x20000630 has ref 1, ending here.
pbuf_free(0x20000630)
pbuf_free: deallocating 0x20000630
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000630
pbuf_header: old 0x20000c58 new 0x20000c66 (-14)
pbuf_header: old 0x20000c66 new 0x20000c7a (-20)
pbuf_header: old 0x20000c7a new 0x20000c8e (-20)
pbuf_alloc(length=20)
pbuf_alloc(length=20) == 0x20000c98
pbuf_header: old 0x20000ccc new 0x20000cb8 (20)
pbuf_header: old 0x20000cb8 new 0x20000caa (14)
pbuf_free(0x20000c98)
pbuf_free: 0x20000c98 has ref 1, ending here.
pbuf_free(0x20000c48)
pbuf_free: deallocating 0x20000c48
pbuf_free(0x20000c98)
pbuf_free: deallocating 0x20000c98
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20000c48
pbuf_header: old 0x20001270 new 0x2000127e (-14)
pbuf_header: old 0x2000127e new 0x20001292 (-20)
pbuf_free(0x20001260)
pbuf_free: deallocating 0x20001260
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x20001260
pbuf_header: old 0x200018cc new 0x200018da (-14)
pbuf_header: old 0x200018da new 0x200018ee (-20)
pbuf_header: old 0x200018ee new 0x2000190e (-32)
pbuf_alloc(length=4)
pbuf_alloc(length=4) == 0x20001ed4
pbuf_header: old 0x20001f1c new 0x20001f08 (20)
pbuf_header: old 0x20001f08 new 0x20001ef4 (20)
pbuf_header: old 0x20001ef4 new 0x20001ee6 (14)
pbuf_free(0x200018bc)
pbuf_free: deallocating 0x200018bc
pbuf_free(0x20001ed4)
pbuf_free: 0x20001ed4 has ref 1, ending here.
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x200018bc
pbuf_header: old 0x20000028 new 0x20000036 (-14)
pbuf_header: old 0x20000036 new 0x2000004a (-20)
pbuf_header: old 0x2000004a new 0x2000005e (-20)
pbuf_free(0x20001ed4)
pbuf_free: deallocating 0x20001ed4
pbuf_free(0x20000018)
pbuf_free: deallocating 0x20000018
pbuf_alloc(length=13)
pbuf_alloc(length=13) == 0x20000018
pbuf_header: old 0x20000060 new 0x2000004c (20)
pbuf_header: old 0x2000004c new 0x20000038 (20)
pbuf_header: old 0x20000038 new 0x2000002a (14)
pbuf_free(0x20000018)
pbuf_free: 0x20000018 has ref 1, ending here.
pbuf_alloc(length=1460)
pbuf_alloc(length=1460) == 0x20001ed4
pbuf_header: old 0x20001f1c new 0x20001f08 (20)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x200024d8
pbuf_header: old 0x20000640 new 0x2000064e (-14)
pbuf_header: old 0x2000064e new 0x20000662 (-20)
pbuf_header: old 0x20000662 new 0x20000676 (-20)
pbuf_free(0x20000018)
pbuf_free: deallocating 0x20000018
pbuf_header: old 0x20001f08 new 0x20001ef4 (20)
pbuf_header: old 0x20001ef4 new 0x20001ee6 (14)
pbuf_free(0x20000630)
pbuf_free: deallocating 0x20000630
pbuf_free(0x20001ed4)
pbuf_free: 0x20001ed4 has ref 1, ending here.
pbuf_alloc(length=1460)
pbuf_alloc(length=1460) == 0x20000018
pbuf_header: old 0x20000060 new 0x2000004c (20)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 0x2000061c
pbuf_header: old 0x20000c58 new 0x20000c66 (-14)
pbuf_header: old 0x20000c66 new 0x20000c7a (-20)
pbuf_header: old 0x20000c7a new 0x20000c8e (-20)
pbuf_free(0x20001ed4)
pbuf_free: deallocating 0x20001ed4
pbuf_header: old 0x2000004c new 0x20000038 (20)
pbuf_header: old 0x20000038 new 0x2000002a (14)
pbuf_free(0x20000c48)
pbuf_free: deallocating 0x20000c48
pbuf_free(0x20000018)
pbuf_free: 0x20000018 has ref 1, ending here.
pbuf_alloc(length=1460)
pbuf_alloc(length=1460) == 0x20000c34
pbuf_header: old 0x20000c7c new 0x20000c68 (20)
pbuf_alloc(length=1536)
pbuf_alloc(length=1460)
pbuf_alloc(length=1460) == 0x20001ed4
pbuf_header: old 0x20001f1c new 0x20001f08 (20)
pbuf_header: old 0x20000c68 new 0x20000c54 (20)
pbuf_header: old 0x20000c54 new 0x20000c46 (14)
pbuf_free(0x20000c34)
pbuf_free: 0x20000c34 has ref 1, ending here.
pbuf_alloc(length=1536)
pbuf_header: old 0x20001f08 new 0x20001ef4 (20)
pbuf_header: old 0x20001ef4 new 0x20001ee6 (14)
pbuf_free(0x20001ed4)
pbuf_free: 0x20001ed4 has ref 1, ending here.
pbuf_alloc(length=1536)
pbuf_alloc(length=1536)
pbuf_header: old 0x2000004c new 0x20000038 (20)
pbuf_header: old 0x20000038 new 0x2000002a (14)
pbuf_free(0x20000018)
pbuf_free: 0x20000018 has ref 1, ending here.
pbuf_alloc(length=1536)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536)
unsent_oversize mismatch (pcb vs. last_unsent):445 in file ../LwIP/core/tcp_out.c
 
 
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]