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.

EtherCAT Master issue

I'm attempting to get the Igh EtherLab EtherCAT master running on am437x-idk with processor-sdk-04.03.00.05.  I used yocto and  built image tisdk-rootfs-image.  I added my own ethercat recipe to build and install the master.

This is what appears when I start the master:

root@am437x-evm:~# /etc/08_ethercat start
Starting EtherCAT master 1.5.2 [ 1000.708151] EtherCAT: Master driver 1.5.2 2eff7c993a63
[ 1000.724378] EtherCAT: 1 master waiting for devices.
[ 1000.755662] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 2eff7c993a63
[ 1000.768309] EtherCAT: Accepting F0:45:DA:6F:1B:96 as main device for master 0.
[ 1000.779010] ec_generic: Binding socket to interface 2 (eth0).
[ 1000.810833] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 1000.816140] EtherCAT 0: Link state of ecm0 changed to UP.
done
[ 1000.840860] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[ 1001.840834] EtherCAT WARNING 0: 50 datagrams TIMED OUT!
[ 1002.840816] EtherCAT WARNING 0: 50 datagrams TIMED OUT!
[ 1003.840816] EtherCAT WARNING 0: 50 datagrams TIMED OUT!  ...

The ethercat master command shows expected results (except with many datagram timeout messages interleaved on the output).

I use a Beckhoff ET2000 Tap/Probe to wireshark  on the packets between the master and my one EtherCAT slave.  I see the packet returning from the slave with WC=1, everything as expected.  It seems that the packet is dropped.  The outgoing packet has the proper source MAC address of my eth0 interface. The return packet has the source address of the master eth0 but with the LAA bit on, so it is a unique address.  I verified on another  system  (am335x system based on sdk 03.x.x.x) that this is how the system normally operates.  All destination addresses are  always the ether broadcast address.

I notice the PRU eth ports get random MACs assigned with the LAA bit on.  This probably would cause a problem with being an EtherCAT master as the return  MAC would be the same as the sending, since the both have the LAA bit set.  The interface would drop its own broadcast packet.

This is a representation from wireshark of the master egress packet:311 3.100221 TexasIns_6f:1b:96 Broadcast ECAT 80 'BRD': Len: 2, Adp 0x0, Ado 0x130, Wc 0   (TexasIns=f0:45:da)

This is a representation from wireshark of the master ingress packet: 312 3.100222 f2:45:da:6f:1b:96 Broadcast ECAT 77 'BRD': Len: 2, Adp 0x1, Ado 0x130, Wc 1 

Any idea about where the filtering might be happening?  I read in the TRM about some kind of OUI deny feature of the CPSW, but I haven't figured out the driver to see how this might be affecting things.  My next step is to try build with the CPSE ALE disabled, and/or using DUAL EMAC.  Also to try the pru eth ports with non LAA MAC addresses.

  • Hello Bruno,

    I do not have physical access to my boards right now, so I will not be able to run any tests. The CPSW ALE should not impact PRU Ethernet ports. Does using non-LAA MAC addresses fix your issue, like it did for the customer in post Igh Etherlab Master for AM437x PREEMPT_RT Linux ?

    Regards,

    Nick

  • Hi Nick,

    I was already using a non-LAA MAC on the CPSW port.  If I switch to using a PRU eth port and non-LAA MAC, the master works, same as the prior post.

    There seems to be something about the CPSW that causes the return packet not to make it to the stack.  I tried disabling CONFIG_TI_CPSW_ALE in the kernel config, but that had no effect.

  • Hello Bruno,

    Got it.

    * Is your EtherCAT slave a TI device, or something else?

    * Is using a non-LLA MAC on PRU Ethernet port an acceptable solution? Or do you need additional support on getting non-LLA MAC working on CPSW port?

    Regards,

    Nick

  • Hi Nick,

    I've tried 2 different slaves, 1 I know is not a TI implementation, the other I suspect also is not TI.

    I'd prefer to have a CPSW solution, but the PRU solution is acceptable for now.

    What is the minimal CPSW kernel config for the AM437X-IDK to run the 1 CPSW physical port as simply as possible?

  • Hi Bruno,

    EtherCAT Master will run on a CPSW port. But the issue you have here is that the IDK board that you are using only has one CPSW port. When we have seen EtherCAT master implemented on a board both CPSW both ports are used and configured for dual MAC mode.  The reason I am making a distinction concerning dual mac mode is the CPSW has configuration capabilities to either be a switch or two separate MACs.

    Your observation concerning a minimal configuration for the ethernet port would be what is needed. But this will be somewhat involved since the TI SDK enables Ethernet Ports through the SystemD init system. As part of the start up a lot of daemons are launched including Avahi which likes to send discovery packets. Overall the SDK has assumed that eth0 is a general network port. We don't have any ready examples that show configure the ethernet port in a minimal configuration.

    I would like to add that if you don't need a general Ethernet port say for NFS as an example then you might want to consider booting to a single shell for experimentation purposes. With just a single shell none of the network daemons would get started since SystemD is not initialized, this would be a very minimal system. If you want to try booting to a single shell here is an training session on this technique on TI EVMs.

    Link to boot to a single shell.

    I am not familiar with the EtherCAT message framing so I am not able to comment on the LAA bit that you are looking at.

    Best Regards,

    Schuyler

  • HI Schuyler,

    When I have time I will try your suggestions.  I will mark this issue as resolved, and make a new one in the future if I need further help.

    Thanks,

    Bruno

  • hi bruno, I use the am5728-evm and sdk-linux-rt-0402, you can try this post http://e2e.ti.com/support/processors/f/791/t/753782 ,I change CPSW_MIN_PACKET_SIZE 60 in cpsw.c, than can scan the slave, when I start my ethercat application slave can into op state, slave can be enable,but it becomes disabled after a while. I check dmesg and find frame loss. 

    my issue : https://e2e.ti.com/support/processors/f/791/t/895313?tisearch=e2e-sitesearch&keymatch=Igh%20Etherlab%20Master%20for%20AM572%20PREEMPT_RT%20Linux