ec_generic can be a mixed bag at 1kHz, depending on your hardware and other 
processing load.  It usually works, but not always.

If you haven’t already, you can try using ec_igb with a PREEMPT_RT kernel; 
that’s usually more stable than ec_generic.  (Xenomai would be even more 
stable, but is usually not required at 1kHz.)

Another possibility to consider is that it might be your cables; they could be 
getting a noise spike from somewhere and corrupting the packet.  Check the 
error counters in the slaves (“ethercat crc” and/or “ethercat diag”) and try 
using STP cable if you can rather than UTP, and avoid running it alongside 
power or motor cables.


Gavin Lambert
Senior Software Developer

[cid:logo_compac_5dcf97ef-52f5-498c-8b9b-728410ddffaf.png]
[cid:compacicon_82e8a8c7-154a-4a32-9720-a5badb6258e0.png]<http://www.compacsort.com>
 [cid:facebook_fa85b924-53b9-45cc-8162-0564f64ec3a3.png] 
<https://www.facebook.com/Compacsort>  
[cid:linkedin_4ec016ad-84fa-443c-85a3-b9615a4ccef8.png] 
<https://www.linkedin.com/company/compac-sorting-equipment/>  
[cid:youtube_32142163-fc27-4aed-b14d-e8a377f98a6d.png] 
<https://vimeo.com/compacsort>  
[cid:twitter_d89338d8-98c8-4b65-9a9e-7b1333160b0d.png] 
<https://twitter.com/compacsort>

COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New 
Zealand
Switchboard: +64 96 34 00 88 | tomra.com<http://www.tomra.com>

The information contained in this communication and any attachment is 
confidential and may be legally privileged. It should only be read by the 
person(s) to whom it is addressed. If you have received this communication in 
error, please notify the sender and delete the communication.

From: Viola Roberto
Sent: Tuesday, 21 May 2019 02:39
To: etherlab-users@etherlab.org
Subject: [etherlab-users] Random Datagram Unmatched

Hi everybody,
  i’m playing with this great library and it’s just works!
I’m running it on a Intel Atom E3930 Dual Core 1.3GHz with 4.14.109 preemptive 
+ xenomai 3.1.

So i started compiling the xenomai example over the ec_generic module. It 
works, but sometimes (randomly) i saw a classic “datagram UNMATCHED”

[ 4187.708617] EtherCAT WARNING 0: 1 datagram UNMATCHED!
[ 4187.844433] EtherCAT WARNING: Datagram ffff89b4783bc798 (domain0-0-main) was 
SKIPPED 1 time.
[ 4188.392447] EtherCAT 0: Domain 0: Working counter changed to 3/3

The error is not deterministic but it occurs often if i increase the load of 
the system.
Reading the ML i understood that at 1KHz everything should run fine even with 
the ec_generic (i have 2 igb port BTW), isn’t it?
I’ve tried 1KHz, 500Hz, 100Hz but the issue is always there (stepping down the 
frequency of the main loop causing the issue be less visible).

I’ve also tried to playing with the ethernet IRQ throttling but they make no 
differences.

ifname="enp2s0"
ifconfig $ifname up
ethtool -L $ifname combined 1
ethtool -C $ifname rx-usecs 0 # default 3
ethtool -C $ifname tx-usecs 0 # default 3

I’ve tried to change the thread RT priority with 50-82-… but the issue is 
always there.

When it happens, looking the stats from “ifconfig”, there aren’t any drop of 
packages (rx and tx go together correctly).

I have no other idea except compiling with –enable-rtdm: i’ve tried but the 
compiling/linking process fails.
Here are my steps:

./bootstrap
CFLAGS=`/usr/xenomai/bin/xeno-config --alchemy --rtdm --compat --cflags`
LDFLAGS=`/usr/xenomai/bin/xeno-config --alchemy --rtdm --compat --ldflags`
./configure --enable-kernel --enable-generic --enable-ccat --disable-8139too 
--disable-e100 --disable-e1000 --disable-e1000e --disable-r8169 
--enable-sii-assign --enable-hrtimer --enable-igb 
--with-linux-dir=/usr/src/linux-headers-4.14.109/ --prefix=/usr --enable-rtdm 
--with-xenomai-dir=/usr/xenomai/
make all modules

/usr/xenomai/lib/xenomai/bootstrap.o: In function `xenomai_main':
bootstrap.c:(.text+0x0): multiple definition of `xenomai_main'
/usr/xenomai/lib/xenomai/bootstrap.o:bootstrap.c:(.text+0x0): first defined here
/usr/xenomai/lib/xenomai/bootstrap.o:(.rodata+0x0): multiple definition of 
`xenomai_auto_bootstrap'
/usr/xenomai/lib/xenomai/bootstrap.o:(.rodata+0x0): first defined here
/root/ethercat/lib/.libs/libethercat_rtdm.so: undefined reference to `rt_printk'
/root/ethercat/lib/.libs/libethercat_rtdm.so: undefined reference to 
`rt_dev_ioctl'
/root/ethercat/lib/.libs/libethercat_rtdm.so: undefined reference to 
`rt_dev_open'
/root/ethercat/lib/.libs/libethercat_rtdm.so: undefined reference to 
`rt_dev_close'
collect2: error: ld returned 1 exit status
Makefile:421: recipe for target 'ec_xenomai_example' failed
make[4]: *** [ec_xenomai_example] Error 1
make[4]: Leaving directory '/root/ethercat/examples/xenomai'
Makefile:454: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/root/ethercat/examples'
Makefile:406: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/ethercat/examples'
Makefile:515: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/ethercat'
Makefile:441: recipe for target 'all' failed
make: *** [all] Error 2
make: *** Waiting for unfinished jobs....
  CC [M]  /root/ethercat/master/rtdm.o
In file included from include/xenomai/cobalt/kernel/thread.h:27:0,
                 from include/xenomai/cobalt/kernel/sched.h:24,
                 from include/xenomai/rtdm/driver.h:37,
                 from /root/ethercat/master/rtdm.c:37:
include/xenomai/cobalt/kernel/timer.h:28:34: fatal error: 
asm/xenomai/wrappers.h: No such file or directory
#include <asm/xenomai/wrappers.h>
                                  ^
compilation terminated.
scripts/Makefile.build:326: recipe for target '/root/ethercat/master/rtdm.o' 
failed
make[3]: *** [/root/ethercat/master/rtdm.o] Error 1
scripts/Makefile.build:585: recipe for target '/root/ethercat/master' failed
make[2]: *** [/root/ethercat/master] Error 2
Makefile:1535: recipe for target '_module_/root/ethercat' failed
make[1]: *** [_module_/root/ethercat] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.14.109'
Makefile:936: recipe for target 'modules' failed
make: *** [modules] Error 2

Thanks in advance
R.
Roberto Viola

Technical Dept

+39 0536836680


[cid:image001.jpg@01D50FC8.02B3C7B0]



SYSTEM CERAMICS S.p.A.

Via Ghiarola Vecchia, 73

41042 Fiorano (Mo) ITALY

+39 0536 836111

i...@system-electronics.it<mailto:i...@system-electronics.it>

www.system-electronics.it<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.system-electronics.it&data=02%7C01%7Cgavin.lambert%40tomra.com%7C33b29781c25643a4092008d6dd30f446%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C636939599670767372&sdata=CqCy8kez7Q%2FLsTeStW1bbai%2B1lbGRAYFg6XJZAmqcfc%3D&reserved=0>


[cid:image002.jpg@01D50FC8.02B3C7B0]


________________________________


Le informazioni contenute in questa email, inclusi i suoi allegati, sono 
riservate e ad uso esclusivo del destinatario. Qualora le fosse pervenuta per 
errore, lei non è autorizzato a copiare, inoltrare e/o rendere nota questa 
email e i suoi allegati, totalmente o parzialmente, e pertanto la preghiamo di 
cancellarla immediatamente senza visionarne il contenuto e gli allegati.

Avvertenza: la presente casella e-mail ed i messaggi da essa derivanti, sono di 
esclusivo utilizzo aziendale /lavorativo e mai personale.

Risposte al presente messaggio: si avvisa il destinatario che eventuali sue 
risposte, potranno essere lette dall’intera azienda /ufficio /reparto di 
appartenenza del mittente.

The information contained in this e-mail, including attachments, is 
confidential and exclusively for the use of the intended recipient. If you 
received this communication by mistake you are not authorized to copy, send 
and/or publish this message and its attachments, in whole or in part and 
therefore please delete this message.


_______________________________________________
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to