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.

TDA4VM: IP not getting on MCU1.0 side using DHCP

Part Number: TDA4VM

Hi TI Team,

I am running the enet_lwip_example code on mcu1.0 side, Here I am not getting the IP address on my custom board but in TDA4 EVM I got the IP address.

Differences between EVM and custom board:

EVM : we have MCU Ethernet with PHY (DP83867ERGZT)

Custom board : we don't have PHY in custom board, here we are using external loopback between cpsw9(mcu2.0) and cpsw2(mcu1.0).

Whatever I am running the example on EVM, same example I ran in custom board with few modifications. I made a PHY-less changes in my code, In main.c, we have this function EnetApp_initLinkArgs(). In this function below 3 lines I modified.

EVM code:

     phyCfg->phyAddr  =  boardPhyCfg->phyAddr;

     linkCfg->speed      =  ENET_SPEED_AUTO;

     linkCfg ->duplexity =  ENET_DUPLEX_AUTO;

Custom board code changes:

     phyCfg->phyAddr  = ENETPHY_INVALID_PHYADDR;

     linkCfg->speed      =  ENET_SPEED_1GBIT;

     linkCfg ->duplexity =  ENET_DUPLEX_FULL;

Please find the below output logs both EVM and custom board.

EVM LOG:

Select peripheral type
0: CPSW_2G

0
Select MAC port
0: ENET_MAC_PORT_1 - RGMII

0
Enabling clocks!
CPU Load: 1%
Starting lwIP, local interface IP is dhcp-enabled
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:0 From 1 To 0
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:4 From 1 To 0
EnetMcm: CPSW_2G on MCU NAVSS
PHY 0 is alive
EnetBoard_setupPorts: 1 of 1 ports configurations found
EnetPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
Host MAC address: 78:db:2f:e6:30:5c
status_callback==UP, local interface IP is 0.0.0.0
status_callback==UP
Cpsw_handleLinkUp: Port 1: Link up: 1-Gbps Full-Duplex
MAC Port 1: link up
udp_input: received datagram of length 308
UDP header:
+-------------------------------+
| 67 | 68 | (src port, dest port)
+-------------------------------+
| 308 | 0xb6b8 | (len, chksum)
+-------------------------------+
udp (192.168.1.172, 68) <-- (192.168.1.1, 67)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)
udp_input: calculating checksum
dhcp_recv(pbuf = a08f9180) from DHCP server 192.168.1.1 port 67
pbuf->len = 300
pbuf->tot_len = 300
udp_input: received datagram of length 308
UDP header:
+-------------------------------+
| 67 | 68 | (src port, dest port)
+-------------------------------+
| 308 | 0xb3b8 | (len, chksum)
+-------------------------------+
udp (192.168.1.172, 68) <-- (192.168.1.1, 67)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)
dhcp_recv(pbuf = a08f7e00) from DHCP server 192.168.1.1 port 67
pbuf->len = 300
pbuf->tot_len = 300
status_callback==UP, local interface IP is 192.168.1.172
Enet lwIP App: Added Network IP address I/F ti1: 192.168.1.172

Custom board Log:

Select peripheral type
0: CPSW_2G

0
Select MAC port
0: ENET_MAC_PORT_1 - RGMII

0
Enabling clocks!
CPU Load: 1%
Starting lwIP, local interface IP is dhcp-enabled
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:0 From 1 To 0
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:4 From 1 To 0
EnetMcm: CPSW_2G on MCU NAVSS
MAC Port 1: link up
Host MAC address: 24:76:25:9a:0d:6f
status_callback==UP, local interface IP is 0.0.0.0
status_callback==UP
udp_input: received datagram of length 308
UDP header:
+-------------------------------+
| 68 | 67 | (src port, dest port)
+-------------------------------+
| 308 | 0xe46b | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 67) <-- (0.0.0.0, 68)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)

udp_input: received datagram of length 308
UDP header:
+-------------------------------+
| 68 | 67 | (src port, dest port)
+-------------------------------+
| 308 | 0xe468 | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 67) <-- (0.0.0.0, 68)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)

udp_input: received datagram of length 48
UDP header:
+-------------------------------+
| 64482 | 1947 | (src port, dest port)
+-------------------------------+
| 48 | 0xd629 | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 1947) <-- (192.168.7.9, 64482)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)
udp_input: received datagram of length 24
UDP header:
+-------------------------------+
| 64237 | 8610 | (src port, dest port)
+-------------------------------+
| 24 | 0xa2a2 | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 8610) <-- (192.168.7.237, 64237)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)
udp_input: received datagram of length 24
UDP header:
+-------------------------------+
| 64237 | 8610 | (src port, dest port)
+-------------------------------+
| 24 | 0xa2a2 | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 8610) <-- (192.168.7.237, 64237)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)
udp_input: received datagram of length 48
UDP header:
+-------------------------------+
| 59919 | 1947 | (src port, dest port)
+-------------------------------+
| 48 | 0x99ca | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 1947) <-- (192.168.7.9, 59919)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)
udp_input: received datagram of length 24
UDP header:
+-------------------------------+
| 50349 | 8610 | (src port, dest port)
+-------------------------------+
| 24 | 0xd8c0 | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 8610) <-- (192.168.7.237, 50349)
pcb (0.0.0.0, 68) <-- (0.0.0.0, 67)

On custom board It is going continuously. Can you please help me to resolve this issue.

  • Hi,

    Sorry for the delayed response.

    I am running the enet_lwip_example code on mcu1.0 side, Here I am not getting the IP address on my custom board but in TDA4 EVM I got the IP address.

    I hope you have connected the CPSW2G port on EVM to the external PC, where the DHCP server is running. As enet_lwip_example application is enabled for DHCP So, getting IP from the Server.

    Custom board : we don't have PHY in custom board, here we are using external loopback between cpsw9(mcu2.0) and cpsw2(mcu1.0).

    In the above connectivity, is CPSW2G exposed to the DHCP server to get an IP address?
    I mean, is CPSW9G running or not? If so, is connected to an external PC where the DHCP server is running via a switch port?

    From the above logs, it looks like the path from CPSW2G to the DHCP server is missing, so it keeps trying to get an IP address.

    Also, make sure that loopback is disabled in CPSW2G in the above connectivity.


    Best Regards,
    Sudheer