Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

Linux/AM5728: EtherCAT packets dropped

Part Number: AM5728

Tool/software: Linux

Hi,

I have been using v4.4.x SDK release with ethercat working, but now when I updated to the latest SDK v4.14.x release I see ethercat is broken.

From the ethtool I can see Rx Align/Code Errors, following is the dump.

~$ ethtool -S eth0
NIC statistics:
     Good Rx Frames: 0
     Broadcast Rx Frames: 0
     Multicast Rx Frames: 0
     Pause Rx Frames: 0
     Rx CRC Errors: 0
     Rx Align/Code Errors: 25
     Oversize Rx Frames: 0
     Rx Jabbers: 0
     Undersize (Short) Rx Frames: 0
     Rx Fragments: 23
     Rx Octets: 0
     Good Tx Frames: 71
     Broadcast Tx Frames: 25
     Multicast Tx Frames: 46
     Pause Tx Frames: 0
     Deferred Tx Frames: 0
     Collisions: 0
     Single Collision Tx Frames: 0
     Multiple Collision Tx Frames: 0
     Excessive Collisions: 0
     Late Collisions: 0
     Tx Underrun: 0
     Carrier Sense Errors: 0
     Tx Octets: 9918
     Rx + Tx 64 Octet Frames: 25
     Rx + Tx 65-127 Octet Frames: 51
     Rx + Tx 128-255 Octet Frames: 6
     Rx + Tx 256-511 Octet Frames: 14
     Rx + Tx 512-1023 Octet Frames: 0
     Rx + Tx 1024-Up Octet Frames: 0
     Net Octets: 11840
     Rx Start of Frame Overruns: 0
     Rx Middle of Frame Overruns: 0
     Rx DMA Overruns: 0
     Rx DMA chan 0: head_enqueue: 1
     Rx DMA chan 0: tail_enqueue: 127
     Rx DMA chan 0: pad_enqueue: 0
     Rx DMA chan 0: misqueued: 0
     Rx DMA chan 0: desc_alloc_fail: 0
     Rx DMA chan 0: pad_alloc_fail: 0
     Rx DMA chan 0: runt_receive_buf: 0
     Rx DMA chan 0: runt_transmit_bu: 0
     Rx DMA chan 0: empty_dequeue: 0
     Rx DMA chan 0: busy_dequeue: 0
     Rx DMA chan 0: good_dequeue: 0
     Rx DMA chan 0: requeue: 0
     Rx DMA chan 0: teardown_dequeue: 0
     Tx DMA chan 0: head_enqueue: 70
     Tx DMA chan 0: tail_enqueue: 1
     Tx DMA chan 0: pad_enqueue: 0
     Tx DMA chan 0: misqueued: 1
     Tx DMA chan 0: desc_alloc_fail: 0
     Tx DMA chan 0: pad_alloc_fail: 0
     Tx DMA chan 0: runt_receive_buf: 0
     Tx DMA chan 0: runt_transmit_bu: 25
     Tx DMA chan 0: empty_dequeue: 70
     Tx DMA chan 0: busy_dequeue: 0
     Tx DMA chan 0: good_dequeue: 71
     Tx DMA chan 0: requeue: 0
     Tx DMA chan 0: teardown_dequeue: 0
~$

Cheers,

Prabhakar Lad

  • Is this EtherCAT Master stack? Who is the stack provider?
  • Hi,

    This is the SOEM (ethercat master) stack which is running. I was just sending the broadcast of ethercat packets to detect the slaves connected. But I dont get any response because of the issues.

    Rest of the networking is fine on the interface its just the ethercat packets dropped.

    The same example just works on previous sdk which is based on v4.4.x release.  

    I tested on v4.9.x and v4.14.x release both of them drop ethercat packets.

    Cheers,

    Prabhakar

  • Hi,

    Could you tell me more about the board you are running? Is it a TI EVM or a custom board?

    The code align errors are typically a PHY issue. Are you able to tap the line with a port mirroring switch to look at possible return traffic?

    Best Regards,
    Schuyler
  • Hi Schuyler,

    Thank you for getting back.

    Its a custom board, but I suspect this should be reproducible on TI's EVM as well (as its the same phy we have on our custom board) , Just connect a ethercat slave on eth0 and try to get the slave info using the SOEM master [1] example.

    But I did manage to get it working with following changes to cpsw:
    diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
    index fdd7636..595133a 100644
    --- a/drivers/net/ethernet/ti/cpsw.c
    +++ b/drivers/net/ethernet/ti/cpsw.c
    @@ -122,7 +122,7 @@ do { \

    #define CPSW_POLL_WEIGHT 64
    #define CPSW_RX_VLAN_ENCAP_HDR_SIZE 4
    -#define CPSW_MIN_PACKET_SIZE (VLAN_ETH_ZLEN)
    +#define CPSW_MIN_PACKET_SIZE (ETH_ZLEN)


    [1] github.com/.../slaveinfo

    Cheers,
    --Prabhakar Lad