Hi Graeme,
Thanks for your quick response and the link to the Gavin Lambert patch set!
I try to compile the IgH ethercat master with this patch set, but I get a
compile error.
Some OS properties:
Dirtribution: Ubuntu 20.04
Linux: 5.11.0-27-lowlatency
Gcc: 9.3.0-17ubuntu1-20.04
Ld: 2.34
I'm using the following commands:
cd /home/ferdi/hg
hg clone -u 33b922ec1871 http://hg.code.sf.net/p/etherlabmaster/code
ethercat_patch
cd ethercat_patch
hg clone http://hg.code.sf.net/u/uecasm/etherlab-patches .hg/patches
hg qpush -a
./bootstrap
./configure --prefix=/usr/local --disable-8139too --enable-generic --disable-eoe
make
make modules
I get the following compile error:
make -C "/usr/src/linux-headers-5.11.0-27-lowlatency"
M="/home/ferdi/hg/ethercat_patch" modules
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-27-lowlatency'
CC [M] /home/ferdi/hg/ethercat_patch/examples/mini/mini.o
LD [M] /home/ferdi/hg/ethercat_patch/examples/mini/ec_mini.o
CC [M] /home/ferdi/hg/ethercat_patch/master/cdev.o
In file included from /home/ferdi/hg/ethercat_patch/master/master.h:46,
from /home/ferdi/hg/ethercat_patch/master/cdev.c:42:
/home/ferdi/hg/ethercat_patch/master/device.h:95:20: error: field
'timeval_poll' has incomplete type
95 | struct timeval timeval_poll;
| ^~~~~~~~~~~~
/home/ferdi/hg/ethercat_patch/master/cdev.c:91:14: error: initialization of
'vm_fault_t (*)(struct vm_fault *)' {aka 'unsigned int (*)(struct vm_fault *)'}
from incompatible pointer type 'int (*)(struct vm_fault *)'
[-Werror=incompatible-pointer-types]
91 | .fault = eccdev_vma_fault
| ^~~~~~~~~~~~~~~~
/home/ferdi/hg/ethercat_patch/master/cdev.c:91:14: note: (near initialization
for 'eccdev_vm_ops.fault')
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:287:
/home/ferdi/hg/ethercat_patch/master/cdev.o] Error 1
make[2]: *** [scripts/Makefile.build:518: /home/ferdi/hg/ethercat_patch/master]
Error 2
make[1]: *** [Makefile:1848: /home/ferdi/hg/ethercat_patch] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-27-lowlatency'
make: *** [Makefile:946: modules] Error 2
Any suggestions?
Kind regards,
Ferdinand Postema
From: Graeme Foot <[email protected]>
Sent: 23 August 2021 23:11
To: Ferdinand Postema - LR <[email protected]>; [email protected]
Subject: RE: EoE messages are disturbing CoE communication
Hi Ferdinand,
The vanilla Etherlab master does not separate the different mailbox protocols.
However, the Gavin Lambert patchset applied to the master does. The patchset
can be found at:
https://sourceforge.net/u/uecasm/etherlab-patches/ci/default/tree/#readme<https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_u_uecasm_etherlab-2Dpatches_ci_default_tree_-23readme&d=DwMFAg&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=xcqiP100iU6SF3NlGrtZl-C3jz-A5-phbUVoejbCeyo&m=PTHySrPZbwZRPvGbLGnLsOyMeB-1CBVY6mNTpspgSNM&s=uLpG6imAGxxaNePvyg9tgzKEslVGNq6AloGI6HlHZ4w&e=>
If you have Ethernet over EtherCAT (EoE) enabled it requires the
ecrt_master_callbacks() method to be used to provide synchronization between
the master realtime thread and the EoE thread.
Note: This method needs to be called from a kernel space application, with
kernel space callback methods. If you have a user space only application
things become a lot more complex.
If you don't want to use EoE then disabling it is fine and the above patchset
should sort out the rest.
Regards,
Graeme.
From: Etherlab-users
<[email protected]<mailto:[email protected]>>
On Behalf Of Ferdinand Postema - LR
Sent: Tuesday, 24 August 2021 04:12
To: [email protected]<mailto:[email protected]>
Subject: [Etherlab-users] EoE messages are disturbing CoE communication
Hello,
I'm using a Beckhoff EL6695 Ethercat Bridge terminal. This terminal can do many
things, but I use it to exchange variables between 2 masters (IgH master and a
CX2040). This device is also capable of multiple mailbox protocols (CoE, EoE
and AoE).
Recently I updated the IgH-master. Before the master was updated, I experienced
an intermittent (rarely) startup problem: Sometimes the communication could
not be established. Bringing the slaves to INIT and then back to OP resolved
the problem. After the upgrade, it was almost not possible to get the
communication up and running. After many hours of debugging I discovered that
the problem is that the EoE messages are disturbing the CoE communication. I
disabled the EoE protocol in the IgH-master with the -disable-eoe option when
configuring and building the software. Now I'm able to get the communication
running with de newer version of the IgH-master. But the occasional startup
problems remain...
While using wireshark to debug the problem further I still see EoE messages.
These messages originate from the terminal and not from the IgH master. But
these messages do disturb the CoE communication. The following short sample of
a wireshark trace shows the problem:
No. Time Source Destination Proto Length Info
875 0.000003 00:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 1052 'FPWR': Len:
1024, Adp 0x1, Ado 0x1000, Wc 0 Mbx(CoE SDO Req : 'Initiate Upload' (2)
Idx=0x1c12 Sub=0)
876 0.000242 02:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 1052 'FPWR': Len:
1024, Adp 0x1, Ado 0x1000, Wc 1 Mbx(CoE SDO Req : 'Initiate Upload' (2)
Idx=0x1c12 Sub=0)
877 0.000002 00:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 60 'FPRD': Len:
8, Adp 0x1, Ado 0x808, Wc 0
878 0.000240 02:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 60 'FPRD': Len:
8, Adp 0x1, Ado 0x808, Wc 1
879 0.000002 00:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 1052 'FPRD': Len:
1024, Adp 0x1, Ado 0x1600, Wc 0
880 0.000244 fe80::d9ac:9249:59ff:e2c5 ff02::1:2 EoE-DHCPv6 1052
EoE(Solicit XID: 0xaa5bf0 CID: 0001000120481c730001052d4758 )
881 0.000005 00:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 1052 'FPWR': Len:
1024, Adp 0x1, Ado 0x1000, Wc 0 Mbx(CoE SDO Req : 'Initiate Upload' (2)
Idx=0x1c13 Sub=0)
882 0.000237 02:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 1052 'FPWR': Len:
1024, Adp 0x1, Ado 0x1000, Wc 1 Mbx(CoE SDO Req : 'Initiate Upload' (2)
Idx=0x1c13 Sub=0)
883 0.000002 00:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 60 'FPRD': Len:
8, Adp 0x1, Ado 0x808, Wc 0
884 0.000242 02:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 60 'FPRD': Len:
8, Adp 0x1, Ado 0x808, Wc 1
885 0.000002 00:0a:cd:30:30:f3 ff:ff:ff:ff:ff:ff ECAT 1052 'FPRD': Len:
1024, Adp 0x1, Ado 0x1600, Wc 0
886 0.000243 fe80::d9ac:9249:59ff:e2c5 ff02::1:2 EoE-DHCPv6 1052
EoE(Solicit XID: 0xaa5bf0 CID: 0001000120481c730001052d4758 )
In frame 875/876, the IgH master requests an SDO-upload
In frame 877/878, the IgH master checks the SM-status to check if a mailbox
message is ready to be read.
In frame 879/880, the IgH master reads the mailbox message, expecting a
response to the SDO-upload request, but receives an EoE message. This EoE
message is probably generated by the slave much earlier, but was not read by
the master. Due to this EoE message, the master aborts the 'upload RxPDO
assignment/mapping'
In frame 881-886, the same happens when the IgH master tries to upload the
TxPDO assignment/mapping. Apparently, another EoE message was already queued
for transmission to the master.
I think the IgH master does not properly separate these mailbox protocols. The
one should never influence the other. I think to realize this, would require a
large change in the IgH master.
Maybe a quick fix would be to ignore the other mailbox protocol messages during
CoE communication (or when -disable-eoe is specified) and re-read the mailbox
until a CoE meassage is read.
I hope this contibutes to your great effort to realize a free ethercat master!
I really appreciate this ethercat master.
Kind regards,
Ferdinand Postema
--
Etherlab-users mailing list
[email protected]
https://lists.etherlab.org/mailman/listinfo/etherlab-users