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/TMDSIDK437X: Igh Etherlab Master for AM437x PREEMPT_RT Linux

Part Number: TMDSIDK437X

Tool/software: Linux

Hi, 

I am porting the Igh Etherlab Master library on the AM437x PREEMPT_RT Linux  4.14.67-rt40 platform.

It does not work and show the following messages while connecting one PRU-ICSS Ethernet Port with EtherCAT slave device 

```

[ 3647.211927] EtherCAT 1: Link state of ecm1 changed to DOWN.

[ 3648.151832] EtherCAT WARNING 0: 50 datagrams TIMED OUT!

[ 3649.151855] EtherCAT WARNING 0: 50 datagrams TIMED OUT!

[ 3650.151850] EtherCAT WARNING 0: 50 datagrams TIMED OUT!

[ 3651.151849] EtherCAT WARNING 0: 50 datagrams TIMED OUT!

[ 3652.151850] EtherCAT WARNING 0: 50 datagrams TIMED OUT!

[ 3653.151851] EtherCAT WARNING 0: 50 datagrams TIMED OUT!

...

(unplug the cable)

[ 3653.362718] prueth pruss1_eth eth1: Link is Down 

[ 3653.372085] EtherCAT 0: Link state of ecm0 changed to DOWN.

```

It seems like AM437x did send out the EtherCAT packet through the PRU-ICSS Ethernet port but did not receive any packets back.

```

# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 2E:98:04:77:3A:C8  

          inet6 addr: fe80::2c98:4ff:fe77:3ac8/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:371 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 B)  TX bytes:22426 (21.9 KiB)

```

And here are the tcpdump messages:

```

# tcpdump -i eth1 -v  -c 5

[  117.011859] device eth1 entered promiscuous mode

tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes

[  126.162884] prueth pruss1_eth eth1: Link is Up - 100Mbps/Full - flow control off

[  126.171964] EtherCAT 0: Link state of ecm0 changed to UP.

00:02:06.175730 2e:98:04:77:3a:c8 (oui Unknown) > Broadcast, ethertype Unknown (0x88a4), length 60: 

        0x0000:  0e10 076c 0000 3[  126.193249] EtherCAT WARNING 0: 14 datagrams TIMED OUT!

001 0200 0000 0000 0000  ...l..0.........

        0x0010:  0000 0000 0000 0000 0000 0000 0000 0000  ................

        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............

00:02:06.190162 IP6 (hlim 1, next-header Options (0) payload length: 36) fe80::2c98:4ff:fe77:3ac8 > ff02::16: HBH 

(rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 1 group record(s) [gaddr ff02::1:ff77

:3ac8 to_ex, 0 source(s)]

00:02:06.202319 2e:98:04:77:3a:c8 (oui Unknown) > Broadcast, ethertype Unknown[  126.243578] device eth1 left prom

iscuous mode

 (0x88a4), length 60: 

        0x0000:  0e10 076d 0000 3001 0200 0000 0000 0000  ...m..0.........

        0x0010:  0000 0000 0000 0000 0000 0000 0000 0000  ................

        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............

00:02:06.220193 2e:98:04:77:3a:c8 (oui Unknown) > Broadcast, ethertype Unknown (0x88a4), length 60: 

        0x0000:  0e10 076e 0000 3001 0200 0000 0000 0000  ...n..0.........

        0x0010:  0000 0000 0000 0000 0000 0000 0000 0000  ................

        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............

00:02:06.240115 2e:98:04:77:3a:c8 (oui Unknown) > Broadcast, ethertype Unknown (0x88a4), length 60: 

        0x0000:  0e10 076f 0000 3001 0200 0000 0000 0000  ...o..0.........

        0x0010:  0000 0000 0000 0000 0000 0000 0000 0000  ................

        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............

5 packets captured

5 packets received by filter

0 packets dropped by kernel

```

I also test our EtherCAT slave device on PC with PREEMPT_RT Linux 4.14.71-rt44 by using the Igh Etherlab master. It works without any problem.  

How shall I do to clarify this problem? 

I would greatly appreciate it if there is any suggestion for me.

Thanks.

  • Thanks for your post.

    Is this a custom board or a TI EVM?

    We're not familiar with this library, can you share more about how it interfaces with the network stack? Does it use raw sockets?

    Does the interface work with standard ethernet traffic like ping and iperf?

    The expert in this area is out for the holidays. This information and anything else you can provide should help them provide a reply upon their return. We will get back to you early in the new year. I'm sorry for the delay.

    Thank you.
  • I use the AM437x IDK

    http://www.ti.com/tool/TMDSIDK437X

    You can reference the Igh document(www.etherlab.org/.../ethercat-1.5.2.pdf), Figure 2-1, Page 6.

    The following figure shows the packet information about EtherCAT transmission. Packet with WC=0 is the packet from Master and packet with WC=1 from Slave.

    However, master can not see the packet from slave with WC=1 and show "datagrams TIMED OUT!"

  • Hello,

    The documentation you linked says that the library was developed for Linux 2.6 - 3.x rather than RT Linux 4.14. To confirm: You are running a different version of RT Linux 4.14 on the PC, and you have used the PC to verify that the EtherCAT slave device works as expected?

    Tell us more about the kernel and filesystem you are using on the PC and the AM437x. Are you using the TI provided RT Linux kernel, or a different one?

    To clarify: the EtherCAT slave is responding to the AM437x, but the AM437x is not seeing that response that you captured in the wireshark screenshot? Is it responding in the same way as it did to the PC? Have you done other tests to debug? (e.g., ping?)

    Regards,
    Nick
  • To clarify the support I can offer: TI does not support third party stacks, but we do support the PRUETH driver itself.

    So our next step in debug would be to take a look at the packets that the PRUETH low level driver is exposing for your stack to use and see if those packets are showing up as expected. You would check that by using tcpdump, for example tcpdump -i eth1

    Where is wireshark being connected to observe your above packets?

    Regards,
    Nick
  • Hello Nick,

    Thanks for your reply.

    Nick Saulnier said:

    The documentation you linked says that the library was developed for Linux 2.6 - 3.x rather than RT Linux 4.14. To confirm: You are running a different version of RT Linux 4.14 on the PC, and you have used the PC to verify that the EtherCAT slave device works as expected?

    Tell us more about the kernel and filesystem you are using on the PC and the AM437x. Are you using the TI provided RT Linux kernel, or a different one?

    To clarify: the EtherCAT slave is responding to the AM437x, but the AM437x is not seeing that response that you captured in the wireshark screenshot? Is it responding in the same way as it did to the PC? Have you done other tests to debug? (e.g., ping?)
     

    The kernel on AM437x is built by the default config, am437x_defconfig. My PC also ran Linux 4.14 PREEMPT_RT and the ethercat master could identify the Ethercat slave.  The MAC  of the packet replied by slave is changed.

    Shenzhen 1b:8b:32(6c:b3:11:1b:8b:32) -> 6e:b3:11:1b:8b:32

    Here is my finding. If I configured the MAC address of PRU-Ether with the same one on PC, master on AM437x also could identify the ethercat slave. Through further experiments, if I configured the PRU-Ether's MAC with universally administered addresses (UAA) format, master could also identify slave. 

    The reason might be PRU-Ether set its MAC with the LAA format and dropped the replied packet with the unchanged MAC.