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.

LP-AM243: MCU+SDK 8.5.0.24: Changing LWIP example to static IP

Part Number: LP-AM243
Other Parts Discussed in Thread: DP83869

Hi Experts,

I am using the enet_lwip_cpsw example from MCU+SDK 08.05.00.24 on the lp-am243. It is running as expected using DHCP, but only if I disable the second netif.

However, I want to use a static IP address. So I changed

--- lwipcfg.h

#define LWIP_PORT_INIT_IPADDR(addr) IP4_ADDR((addr), 192,168,39,5)
#define LWIP_PORT_INIT_GW(addr) IP4_ADDR((addr), 192,168,39,1)
#define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), 255,255,255,0)

--- lwipopts.h

#define LWIP_DHCP               0

This used to work with the previous SDK.

However, in this case the firmware runs into a RTOS abort.

Is this a bug, or is there a different way to use a static IP address? Which documentation should I look in?

Thanks for a hint

Alexander

2063.enet_lwip_cpsw_am243x-lp_r5fss0-0_freertos_ti-arm-clang.zip

  • Hi Alex,

    I have few questions:

    1. Do you want to use single net if or dual netif

    2. If dual net if then,do you need DHCP or static ip on both netif

    3. You can refer :https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1120698/faq-mcu-plus-sdk-am243x-configure-static-ip-with-mcu-sdk-enet_lwip_cpsw-or-enet_lwip_icssg-example?tisearch=e2e-sitesearch&keymatch=faq%3Atrue

    Also I will check on my end to confirm the example.

  • Hi Nilabh,

    for the moment, I want to use a single netif with static IP. With your link, it works fine.

  • Glad to Know. Will close this thread

  • Hi Nilabh,

    today I tried the same with the EVM board; still the enet_lwip_cpsw example from MCU+SDK 08.05.00.24 on an old TMDS243GPEVM

    The example works fine with DHCP. 

    With the solution from your link, I get to the point that

    - the debug output looks as expacted

    - ping is working for the static 

    - but iperf does not get a connection.

    What am I missing?

    The project is attached

    The debug output was:

    ==========================
    ENET LWIP App
    ==========================
    Enabling clocks!
    Mdio_open: MDIO Manual_Mode enabled
    EnetPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
    EnetPhy_bindDriver: PHY 3: OUI:080028 Model:0f Ver:01 <-> 'dp83869' : OK
    PHY 0 is alive
    PHY 3 is alive
    Starting lwIP, local interface IP is 192.168.39.5
    Host MAC address-0 : f4:84:4c:f9:84:01
    Host MAC address-1 : 70:ff:76:1e:63:79
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    [LWIPIF_LWIP] Enet has been started successfully
    status_callback==UP, local interface IP is 192.168.39.5
    status_callback==UP, local interface IP is 192.168.39.5
    UDP server listening on port 5001
    Cpsw_handleLinkUp: Port 1: Link up: 1-Gbps Full-Duplex
    MAC Port 1: link up
    link_callback==UP
    link_callback==UP
    5. 69s : CPU load = 3.50 %
    10. 69s : CPU load = 3.13 %
    15. 69s : CPU load = 2.92 %
    [...]

    The command window was:

    C:\DevTools\iperf-2.0.9-win64>ping 192.168.39.5

    Ping wird ausgeführt für 192.168.39.5 mit 32 Bytes Daten:
    Antwort von 192.168.39.5: Bytes=32 Zeit=2ms TTL=255
    Antwort von 192.168.39.5: Bytes=32 Zeit=1ms TTL=255
    Antwort von 192.168.39.5: Bytes=32 Zeit=1ms TTL=255
    Antwort von 192.168.39.5: Bytes=32 Zeit<1ms TTL=255

    Ping-Statistik für 192.168.39.5:
    Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
    (0% Verlust),
    Ca. Zeitangaben in Millisek.:
    Minimum = 0ms, Maximum = 2ms, Mittelwert = 1ms

    C:\DevTools\iperf-2.0.9-win64>

    C:\DevTools\iperf-2.0.9-win64>iperf -c 192.168.39.5 -i 5 -t 20 -d
    ------------------------------------------------------------
    Server listening on TCP port 5001
    TCP window size: 208 KByte (default)
    ------------------------------------------------------------
    connect failed: Connection timed out

    C:\DevTools\iperf-2.0.9-win64>

    BR

    Alex

    1323.enet_lwip_cpsw_am243x-evm_r5fss0-0_freertos_ti-arm-clang.zip

  • Hi Alex, 

    Host MAC address-0 : f4:84:4c:f9:84:01
    Host MAC address-1 : 70:ff:76:1e:63:79
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    [LWIPIF_LWIP] Enet has been started successfully
    status_callback==UP, local interface IP is 192.168.39.5
    status_callback==UP, local interface IP is 192.168.39.5
    UDP server listening on port 5001
    Cpsw_handleLinkUp: Port 1: Link up: 1-Gbps Full-Duplex

    It seems both netif have got same ip address. So it may be the issue.

    Can you please follow this thread: e2e.ti.com/.../am2434-cpsw-dual-mac-mode

    This will ensure that two netif gets different ip address. Then can you try and let me know if this works

  • Thanks for your quick help. That worked.

    BR

    Alex