This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/EK-TM4C1294XL: enet_tcpecho_server with static IP

Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

Dear team,

My customer is using TivaWare_C_Series-2.2.0.295 and ek-tm4c129xl.

They tested enet_tcpecho_server code. 

It works normally in dynamic IP. When changing to static IP, if the received byte is less than 10 characters, the network port will not work. It must be reset to return to normal.

Please help me to check it.

  • change the lwipopts.h:

    //*****************************************************************************
    //
    // ---------- DHCP options ----------
    //
    //*****************************************************************************
    #define LWIP_DHCP 1 // default is 0
    //#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))

    CHANGE TO 


    //*****************************************************************************
    //
    // ---------- DHCP options ----------
    //
    //*****************************************************************************
    //#define LWIP_DHCP 1 // default is 0
    //#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))





    //*****************************************************************************
    //
    // ---------- AUTOIP options ----------
    //
    //*****************************************************************************
    #define LWIP_AUTOIP 1 // default is 0
    #define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))
    // default is 0
    #define LWIP_DHCP_AUTOIP_COOP_TRIES 5 // default is 9

    CHANGE TO 


    //*****************************************************************************
    //
    // ---------- AUTOIP options ----------
    //
    //*****************************************************************************
    //#define LWIP_AUTOIP 1 // default is 0
    //#define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))
    // default is 0
    //#define LWIP_DHCP_AUTOIP_COOP_TRIES 5 // default is 9

    3 CHANGE enet_tcp_echo_server.c:


    lwIPInit(g_ui32SysClock, pui8MACArray, 0, 0, 0, IPADDR_USE_DHCP);
    CHANGE TO 
    lwIPInit(g_ui32SysClock, pui8MACArray, 0xc0a8017e, 0xffffff00, 0, IPADDR_USE_STATIC);

    After downloading, it can be pinged and a connection can be established. It is normal when more than 10 characters are received. There will be no response if less than 10 characters. The connection cannot be re-established after disconnection. Reset is required.

  • Hi Susan,

      Instead of commenting out the #define, can you try below. Does that make a difference? Please also check if the server and the client are on the same subnet. 

    FROM:

    #define LWIP_DHCP 1 // default is 0

    #define LWIP_AUTOIP 1 // default is 0
    #define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))

    CHANGE TO:

    #define LWIP_DHCP 0 // default is 0

    #define LWIP_AUTOIP 0 // default is 0
    #define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))

  • I run the tcp_echo_server with static address and I don't see a problem.  My static address is 192.168.254.67. On the client side (i use SocketTest tool), I send a short string 'TEST" that is less than 10 characters and another string 'this is a long test string' which is longer than 10 characters and both works. The server echoes back with the converted case in both cases.

  • It is a problem with the compiler. After recompiling with CCS, it is fine. It is estimated that the library files used by different compilers are different.