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.

[FAQ] PROCESSOR-SDK-AM64X: Configure Static IP with MCU+ SDK enet_lwip_cpsw or enet_lwip_icssg example

Part Number: PROCESSOR-SDK-AM64X
Other Parts Discussed in Thread: DP83869

Problem Statement:

Can you please share steps to configure Static IP with MCU+ SDK enet_lwip_cpsw or enet_lwip_icssg example ?

Regards

  • Solution:

    Static IP configuration steps for lwip icssg/cpsw example: ( Note: Below is for ICSSG example same can be done for cpsw example also)

    1. Uncomment following macro in file mcu_plus_sdk\examples\networking\lwip\enet_lwip_icssg\lwipcfg.h

    /* #define USE_DHCP    0 */
    /* #define USE_AUTOIP  0 */

    mcu_plus_sdk\examples\networking\lwip\enet_lwip_icssg\lwipcfg.h

    2. For setting the IP address, Default gateway and Subnet mask use following lines in file mcu_plus_sdk\examples\networking\lwip\enet_lwip_icssg\lwipcfg.h

    #define LWIP_PORT_INIT_IPADDR(addr)   IP4_ADDR((addr), 192,168,1,200)   -> Defines IP address in format 192.168.1.200
    #define LWIP_PORT_INIT_GW(addr)       IP4_ADDR((addr), 192,168,1,1)          -> Defines Gateway in format 192.168.1.1
    #define LWIP_PORT_INIT_NETMASK(addr)  IP4_ADDR((addr), 255,255,255,0) -> -> Defines Gateway in format 255.255.255.0
    3. Recompile the example (recompiling any lib is not required) after following changes and it will set example in static ip mode with the IP address provided in step 2.

    Test to ensure configuration was successful:

    1. CCS log in uart terminal will print the local dhcp address as:

    DUT side:
    ==========================
    ENET LWIP App
    ==========================
    Enabling clocks!
    Starting lwIP, local interface IP is 192.168.1.200
    CPSW_3G Test on MAIN NAVSS
    EnetPhy_bindDriver: PHY 3: OUI:080028 Model:0f Ver:01 <-> 'dp83869' : OK
    PHY 3 is alive
    PHY 15 is alive
    Host MAC address: f4:84:4c:f9:88:ca
    [LWIPIF_LWIP] Enet has been started successfully
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    status_callback==UP, local interface IP is 192.168.1.200
    UDP server listening on port 5001
    Cpsw_handleLinkUp: Port 1: Link up: 1-Gbps Full-Duplex
    MAC Port 1: link up
    link_callback==UP
    2. Ping DUT at the configured IP(Ex : ping 192.168.1.200)
    Open command prompt/Terminal and give following command:  ping 192.168.1.200
    Note : Client Side PC needs to configured in static IP with same gateway and netmask address. (For Windows PC:https://www.trendnet.com/press/resource-library/how-to-set-static-ip-address)
    3. Iperf test also can be run using following documentation (See section Measuring the throughput using Iperf) 
    Note: This is based on  AM64x MCU+ SDK 08.06.00.