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.

MCU-PLUS-SDK-AM243X: Ethernet can't ping to PC when using dp83822 with RMII

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: AM2434

Hi, 

We design our new hardware board with AM2434 ALX, now we are debugging CPSW 3G with dp83822, but some thing goes wrong, there are two questions.

question1: dp83822 can link up, but my computer can't ping to the board after got the IP. of course, the IP is not from DHCP server but from autoip_create_addr() of LWIP.

   

question2: when pull out the ethernet cable, the code will loop all the time in the CpswMacPort_reset(), the “do” is always 0.

my environments are as follows:

Environments:

  • IDE: CCS 10.3.1
  • SDK: mcu_plus_sdk_am64x_08_01_00_36
  • PHY: DP83822
  • ethernet interface: RMII2
  • test case source: mcu_plus_sdk_am243x_08_01_00_36\examples\networking\lwip\enet_lwip_cpsw\am243x-lp

I use mcu_plus_sdk_am243x_08_01_00_36\examples\networking\lwip\enet_lwip_cpsw\am243x-lp as the source example, and changed the pin config, phy address, add dp83822 configuration to gEnetCpbBoard_am64xEthPort structure in Enet_board_cfg.c, and add some configure code to Dp83822_config() in dp83822.c.

  

it seems some configuration was not correct.

  • Hi,

    question1: dp83822 can link up, but my computer can't ping to the board after got the IP. of course, the IP is not from DHCP server but from autoip_create_addr() of LWIP.

    Few things to note when changing PHY, mode -

    1. MAC mode

    For RMII, it is below -
    interface
    ->layerType = ENET_MAC_LAYER_MII; interface->sublayerType = ENET_MAC_SUBLAYER_REDUCED; interface->variantType = ENET_MAC_VARIANT_NONE;

    AM243x MCU+ SDK: Enet Integration Guide

    2. PHY configuration -

    I don't see message like below in your logs. Can you please confirm that the driver is picking DP83822 PHY.

    EnetPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK

    3. Delay configuration.

    You please print the statistics and confirm no CRC/alignment/other errors

    [FAQ] MCU-PLUS-SDK-AM243X: How do I get CPSW diagnostic statistics using debug gels in MCU+ SDK Enet LLD? - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Regards,

    Prasad

  • Hi Mr. Prasad Jondhale,

    sorry for the late reply.

    I used your method to test ethernet, but currently, the error is the same, I can't get IP from DHCP server but from autoip_create_addr() of LWIP, and my computer can't ping to the board.

    below is my change that follow your method.

    1. MAC mode

    For RMII, it is below -
    interface
    ->layerType = ENET_MAC_LAYER_MII; interface->sublayerType = ENET_MAC_SUBLAYER_REDUCED; interface->variantType = ENET_MAC_VARIANT_NONE;

    I used a wrong config of ethPort.mii.variantType, I had changed from ENET_MAC_VARIANT_FORCED to ENET_MAC_VARIANT_NONE.

    2. PHY configuration -

    I don't see message like below in your logs. Can you please confirm that the driver is picking DP83822 PHY.

    EnetPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK

    some print condition I didn't add, so the driver information didn't show. I had added the print condition, and print some main register value of dp83822, the whole message are as follows:

    3. Delay configuration.

    You please print the statistics and confirm no CRC/alignment/other errors

    below is the information I get:

    it seems I get nothing.

    my board didn't flash SOC initialization binary, so I launched CCS and run the script( loadJSFile "D:/ti/mcu_plus_sdk_am243x_08_01_00_36/tools/ccs_load/am64x_am243x/load_dmsc.js")  before  connect to Main R5F0_0 core.

  • Hi Li,

    the log shown says DHCP is enabled and current IP is 0.0.0.0.

    Can you try with a fixed IP config? Or have a DHCP server providing an IP address to your board first.

    Or how do you know the IP address to ping? 

    Regards,

    Frank

  • Hi Frank,

    I did a wrong action that cause the issue closed, can you reopen this issue?

  • I can't undo your click but the issue is not closed. Just go on...

  • Hi Frank,

    the initialized IP is 0.0.0.0
    after link up, the board will try to get real IP from DHCP server, but my board can't get IP from DHCP server, so after few minutes, my board will get IP from autoip_create_addr() of LWIP, so my computer use this IP to ping.

    the LP board can get IP from DHCP server with the same ethernet environment.

  • Hi Frank,

    my ethernet environment has some problem, I need to fix it and will check it again, I will update the information after I checked.

  • Hi Frank,

    I just fixed my ethernet environment.

    LP board can get IP from DHCP server, and my computer can ping to LP board.

    the same ethernet environment, my board can't get IP from DHCP server, but get IP from autoip_create_addr() of LWIP, and my computer can't ping to board,

  • After I enabled LWIP_AUTOIP in the example I get this:

    Enabling clocks!
    Starting lwIP, local interface IP is autoip-enabled
    CPSW_3G Test on MAIN NAVSS
    EnetPhy_bindDriver: PHY 0: OUI:080028 Model:23 Ver:01 <-> 'dp83867' : OK
    PHY 0 is alive
    Host MAC address: f4:84:4c:f9:58:a7
    [LWIPIF_LWIP] Enet has been started successfully
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    status_callback==UP, local interface IP is 0.0.0.0
    UDP server listening on port 5001
    status_callback==UP, local interface IP is 169.254.168.88
    5.119s : CPU load = 6.89 %
    10.119s : CPU load = 5.07 %

    Now I still need to see if I can ping. Currently don't have a good Ethernet setup... Also may need to change the IP to something working in my network.