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.

AM2434: Ethernet Lwip CPSW Ping Interval Issue

Part Number: AM2434
Other Parts Discussed in Thread: SYSCONFIG

Hi Team,

I received a question about Enet Lwip CPSW from my customer below.
I am checking the operation of the Enet Lwip CPSW sample program using Custom PHY, and I am getting frequent timeouts on the ping command. If you set the ping command interval to 200 ms and run the command repeatedly, it will time out several times until the ping passes, after which the response will return periodically.If I increase the command interval to 2s, most of the timeouts occur. I checked with the debugger and found that the number of valid entries on the ring (pRing->rdOcc) read from the register in csl_lcdma_ringacc.c CSL_lcdma_ringaccPop64MultiAccess() is always 0 while a timeout occurs and the Ring is empty path. I am aware that the value of pRing->rdOcc is incremented when a packet is received, but I wonder if you are aware of this situation. Please let us know if you know the cause of this problem.

Here are the images they attached first one is interval of 200ms, second is interval of 2s.

Best regards,

Mari Tsunoda

  • Hi Mari,

    I believe the timeouts are happening because of packet drops at PHY or at MAC (AM243x CPSW) due to timing violations (RX and TX delays).

    CPSW has HW statistics support which can be used to verify the packet drops.

    Can you please ask customer to follow below to get statistics and adjust the delays accordingly (https://www.ti.com/lit/an/snla243/snla243.pdf)?

    (16) [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 Prasad,

    I received the following question from my customer.

    Thank you for your response. Please allow me to make an additional confirmation to the above question.
    I understood that the method of obtaining HW statistics that you answered is for the evaluation board. We are using a custom board. Is there a way to get HW statistics from a custom board?

    I use SysConfig(ver.1.12.1), SDK(08.03.00.18) and select RMII for Enet(CPSW). This is the case in cpsw.c. In this state, "cpsw.c Cpsw_getPortLinkCfg()" returns an error. I have modified the following part of ti_board_config.c to ENET_MAC_LAYER_MII and use it, but does it affect the operation of this case? If this is incorrect, we would appreciate it if you could tell us how to set it up.

    Best regards,

    Mari Tsunoda

  • I understood that the method of obtaining HW statistics that you answered is for the evaluation board. We are using a custom board. Is there a way to get HW statistics from a custom board?

    This method is independent of the board. It should work on custom board.

    On RMII config, let me have a look in driver and get back.

    Regards,

    Prasad

  • Hi Mari,

    In mcu_plus_sdk\source\networking\.meta\enet_cpsw\templates\am64x_am243x\enet_soc_cfg.c.xdt

    You can change :    

    uint32_t modeSel = CPSW_ENET_CTRL_MODE_RGMII; to CPSW_ENET_CTRL_MODE_RMII

    It is hard coded to RGMII there. I have raised a bug for this .(https://jira.itg.ti.com/browse/MCUSDK-8616)

    Can you please try this and let me know if this works for you?

    BR

    Nilabh A.

  • Hi Nilabh, Prasad,

    Thank you for your support on this issue. I received an update and follow-up question from my customer.

    We have investigated this issue and found that the MAC address is set independently, but the setting point is not correct and inconsistencies occur in the MAC address information of each Ethernet, which may have caused this phenomenon.
    This phenomenon was resolved by changing the MAC address on the following code at the lowest layer, where the MAC address is obtained by register access. Is the following procedure for changing to a unique MAC address correct?
    1. Enable the ENET_MAC_ADDR_HACK define in net_soc.c
    2. Set the number of unique MAC addresses and valid MAC addresses in the macAddr[][] structure.

    Regarding the HW statistics obtaining method, I also received a follow-up question.

    I understood that the mii of gEnetVirtBoard_am243x_evm_EthPort[] in board_config.c will be corrected to ENET_MAC_LAYER_MII by the following method that you have taught. If I specify RMII in cpsw.c Cpsw_getPortLinkCfg(), if ((enetLayer==ENET_MAC_LAYER_GMII) & (enetSublayer==ENET_MAC_SUBLAYER_REDUCED)) is not satisfied and it enters the error path of Link config not available for layer. Is this OK? It enters the error path of Link config not available for layer.
    SysConfig(ver.1.12.1), SDK(08.03.00.18)

    Best regards,

    Mari Tsunoda

  • Hi Mari,

    I have consulted internal team for this. We are yet to receive any update. I will get back once I have it.

    BR

    Nilabh A.

  • Hi Nilabh,

    Any updates on this?

    Best regards,

    Mari

  • Hi Mari,

    RMII support was absent in driver and it has been acknowledged by the software team.The fix for the same has been planned for SDK 8.5 release.

    Will it be okay if it comes as part of 8.5 release, Can the customer move to newer SDK version?

  • Hi Nilabh,

    Thanks for your reply. Unfortunately, they cannot move to 8.5. Is there no other way around this? If not, I will let my customer know. I believe it will not be a big issue with regards to the HW statistics obtaining method.

    Also, can you comment on this?

    Is the following procedure for changing to a unique MAC address correct?
    1. Enable the ENET_MAC_ADDR_HACK define in net_soc.c
    2. Set the number of unique MAC addresses and valid MAC addresses in the macAddr[][] structure.

    Best regards,

    Mari Tsunoda

  • Hi Mari,

    Let me come back on this by EOD today.

  • Hi Mari,

    Is the following procedure for changing to a unique MAC address correct?

    Yes this is fine.

    BE

    Nilabh A.