Discussion:
[etherlab-users] Xenomai 3 and RTDM's Net drivers.
Per Oberg
2018-11-13 18:05:23 UTC
Permalink
EtherLab master over real-time Ethernet drivers from Xenomai 3 just works !
This is great news!

I was just looking for Xenomai / EtherCat for x86_64 so I will definitely take this out for a spin.

Best Regards
Per Öberg
I also added a new device : devices/rtdmnet.c. It is really similar to
devices/generic.c, but it uses RTDM's Net drivers instead of Linux
drivers. This new device still needs fixing, and only works in idle mode
for now - working on a fix right now.
Now fixed.
For the record, and in case anyone would want to reproduce the
experiment on I.mx6 with real-time FEC driver, patches for Xenomai
3.0.7 to enable and fix FEC driver are attached. Tested with Linux
4.9.51.
Best regards
Edouard Tisserant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-xenomai_adjust_RTSKB_SIZE_for_FEC.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-xenomai_fix_FEC.patch
Type: text/x-patch
Size: 3498 bytes
Desc: not available
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xenomai-enable-FEC.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0002.bin>
Per Oberg
2018-11-14 16:03:41 UTC
Permalink
Hi

I tried this today, but I ran into some troubles. Most of my troubles are probably due to me being new to etherlab/ethercat.

However, this is what happened:

In lack of a valid ethernet-card on the right computer running the right kernel I tried using the xenomai rt_loopback device and got

[ 82.574576] EtherCAT: 1 master waiting for devices.
[ 104.779742] ec_rtdmnet: EtherCAT master RTnet Ethernet device module 1.5.2 32c9a2dea9ed
[ 104.779750] EtherCAT: Accepting 00:00:00:00:00:00 as main device for master 0.
[ 104.779751] rtdm_socket() = -97!
[ 104.779752] EtherCAT 0: Releasing main device 00:00:00:00:00:00.

-97 usually means EAFNOSUPPORT or "Address family not supported by protocol"

Is that to be expected when using the loopback-device or am I doing something else wrong?
sudo modprobe rt_loopback
sudo insmod ./master/ec_master.ko main_devices=ff:ff:ff:ff:ff:ff debug_level=1
sudo insmod ./devices/ec_rtdmnet.ko
./configure --enable-rtdm --with-xenomai-dir=/opt/xenomai --with-linux-dir=/.../xenomai-kernel-ipipe.git --disable-r8169 --disable-8139too
Kernel is 4.9.38

Xenomai is 3.0.7

Per Öberg
EtherLab master over real-time Ethernet drivers from Xenomai 3 just works !
This is great news!
I was just looking for Xenomai / EtherCat for x86_64 so I will definitely take
this out for a spin.
Best Regards
Per Öberg
I also added a new device : devices/rtdmnet.c. It is really similar to
devices/generic.c, but it uses RTDM's Net drivers instead of Linux
drivers. This new device still needs fixing, and only works in idle mode
for now - working on a fix right now.
Now fixed.
For the record, and in case anyone would want to reproduce the
experiment on I.mx6 with real-time FEC driver, patches for Xenomai
3.0.7 to enable and fix FEC driver are attached. Tested with Linux
4.9.51.
Best regards
Edouard Tisserant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-xenomai_adjust_RTSKB_SIZE_for_FEC.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-xenomai_fix_FEC.patch
Type: text/x-patch
Size: 3498 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xenomai-enable-FEC.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0002.bin>
Edouard Tisserant
2018-11-14 19:26:57 UTC
Permalink
Hi Per

I should have documented this : rtdmnet.ko use RAW packet socket.

Don't forget to build and load rtpacket module to make it available.

Hereafter are commands I use to run a test with rt-FEC driver:


modprobe rt_fec
modprobe rtpacket
rtifconfig rteth0 up

cat > /etc/sysconfig/ethercat <<EOF
MASTER0_DEVICE="ff:ff:ff:ff:ff:ff"
DEVICE_MODULES="rtdmnet"
EOF

/etc/init.d/ethercat start

ethercat slaves


Cheers,

Edouard
Post by Per Oberg
Hi
I tried this today, but I ran into some troubles. Most of my troubles are probably due to me being new to etherlab/ethercat.
In lack of a valid ethernet-card on the right computer running the right kernel I tried using the xenomai rt_loopback device and got
[ 82.574576] EtherCAT: 1 master waiting for devices.
[ 104.779742] ec_rtdmnet: EtherCAT master RTnet Ethernet device module 1.5.2 32c9a2dea9ed
[ 104.779750] EtherCAT: Accepting 00:00:00:00:00:00 as main device for master 0.
[ 104.779751] rtdm_socket() = -97!
[ 104.779752] EtherCAT 0: Releasing main device 00:00:00:00:00:00.
-97 usually means EAFNOSUPPORT or "Address family not supported by protocol"
Is that to be expected when using the loopback-device or am I doing something else wrong?
sudo modprobe rt_loopback
sudo insmod ./master/ec_master.ko main_devices=ff:ff:ff:ff:ff:ff debug_level=1
sudo insmod ./devices/ec_rtdmnet.ko
./configure --enable-rtdm --with-xenomai-dir=/opt/xenomai --with-linux-dir=/.../xenomai-kernel-ipipe.git --disable-r8169 --disable-8139too
Kernel is 4.9.38
Xenomai is 3.0.7
Per Öberg
EtherLab master over real-time Ethernet drivers from Xenomai 3 just works !
This is great news!
I was just looking for Xenomai / EtherCat for x86_64 so I will definitely take
this out for a spin.
Best Regards
Per Öberg
I also added a new device : devices/rtdmnet.c. It is really similar to
devices/generic.c, but it uses RTDM's Net drivers instead of Linux
drivers. This new device still needs fixing, and only works in idle mode
for now - working on a fix right now.
Now fixed.
For the record, and in case anyone would want to reproduce the
experiment on I.mx6 with real-time FEC driver, patches for Xenomai
3.0.7 to enable and fix FEC driver are attached. Tested with Linux
4.9.51.
Best regards
Edouard Tisserant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-xenomai_adjust_RTSKB_SIZE_for_FEC.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-xenomai_fix_FEC.patch
Type: text/x-patch
Size: 3498 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xenomai-enable-FEC.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0002.bin>
_______________________________________________
etherlab-users mailing list
http://lists.etherlab.org/mailman/listinfo/etherlab-users
Per Oberg
2018-11-15 15:03:08 UTC
Permalink
Thanks, I'll definitely try that.

In the meantime I have been trying to make it work on my Yocto/Poky Xenomai distribution. Problem is I have a toolchain with a sysroot and it won't compile straight away. I usually compile using CMake and I don't know whats right and wrong in the world of autotools.
LD = x86_64-poky-linux-ld --sysroot=/opt/poky/2.5/sysroots/corei7-64-poky-linux -m elf_x86_64
and later...
ac_ct_CC = x86_64-poky-linux-gcc -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 --sysroot=/opt/poky/2.5/sysroots/corei7-64-poky-linux
which seems about right. But to actually use include files and lib files from the sysroot I need to use

-I=/usr/include/xenomai and -L=/usr/lib/

so that the sysroot may be inserted here when compiling.

I'm not sure how to tell the tools to insert the "=" automatically, and worse. It seems like that technique is not a valid approach for locating the "bootstrap.o" file or the "dynlist.ld" file.

For now I have just settled for hand-crafting the Makefile to be able to take it out for a spin.

Per Öberg
Hi Per
I should have documented this : rtdmnet.ko use RAW packet socket.
Don't forget to build and load rtpacket module to make it available.
modprobe rt_fec
modprobe rtpacket
rtifconfig rteth0 up
cat > /etc/sysconfig/ethercat <<EOF
MASTER0_DEVICE="ff:ff:ff:ff:ff:ff"
DEVICE_MODULES="rtdmnet"
EOF
/etc/init.d/ethercat start
ethercat slaves
Cheers,
Edouard
Post by Per Oberg
Hi
I tried this today, but I ran into some troubles. Most of my troubles are
probably due to me being new to etherlab/ethercat.
In lack of a valid ethernet-card on the right computer running the right kernel
I tried using the xenomai rt_loopback device and got
[ 82.574576] EtherCAT: 1 master waiting for devices.
[ 104.779742] ec_rtdmnet: EtherCAT master RTnet Ethernet device module 1.5.2
32c9a2dea9ed
[ 104.779750] EtherCAT: Accepting 00:00:00:00:00:00 as main device for master 0.
[ 104.779751] rtdm_socket() = -97!
[ 104.779752] EtherCAT 0: Releasing main device 00:00:00:00:00:00.
-97 usually means EAFNOSUPPORT or "Address family not supported by protocol"
Is that to be expected when using the loopback-device or am I doing something
else wrong?
sudo modprobe rt_loopback
sudo insmod ./master/ec_master.ko main_devices=ff:ff:ff:ff:ff:ff debug_level=1
sudo insmod ./devices/ec_rtdmnet.ko
./configure --enable-rtdm --with-xenomai-dir=/opt/xenomai
--with-linux-dir=/.../xenomai-kernel-ipipe.git --disable-r8169
--disable-8139too
Kernel is 4.9.38
Xenomai is 3.0.7
Per Öberg
EtherLab master over real-time Ethernet drivers from Xenomai 3 just works !
This is great news!
I was just looking for Xenomai / EtherCat for x86_64 so I will definitely take
this out for a spin.
Best Regards
Per Öberg
I also added a new device : devices/rtdmnet.c. It is really similar to
devices/generic.c, but it uses RTDM's Net drivers instead of Linux
drivers. This new device still needs fixing, and only works in idle mode
for now - working on a fix right now.
Now fixed.
For the record, and in case anyone would want to reproduce the
experiment on I.mx6 with real-time FEC driver, patches for Xenomai
3.0.7 to enable and fix FEC driver are attached. Tested with Linux
4.9.51.
Best regards
Edouard Tisserant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-xenomai_adjust_RTSKB_SIZE_for_FEC.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-xenomai_fix_FEC.patch
Type: text/x-patch
Size: 3498 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xenomai-enable-FEC.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0002.bin>
_______________________________________________
etherlab-users mailing list
http://lists.etherlab.org/mailman/listinfo/etherlab-users
Per Oberg
2018-11-16 07:46:35 UTC
Permalink
Post by Per Oberg
I'm not sure how to tell the tools to insert the "=" automatically, and worse.
It seems like that technique is not a valid approach for locating the
"bootstrap.o" file or the "dynlist.ld" file.
It turns out that I failed to remember that xeno-config needs DESTDIR to be set when compiling using the build-root.

Snippet from the Xenomai xeno-config man-pages:

"Xenomai’s handling of DESTDIR is conformant to the GNU coding and installation standards, for generating pathnames rooted at some staging area on the build system. Such staging area is commonly NFS-mounted from the target system running Xenomai.
...
If DESTDIR was set when installing Xenomai - typically after cross-compiling - DESTDIR must be set to the same value before calling xeno-config for accessing the target-based directories and files from the build system."

TTFN
Per Öberg
Per Oberg
2018-11-16 16:20:15 UTC
Permalink
I just wanted to report that I now have successfully compiled everything and managed so connect to my device using the examples/xenomai and examples/xenomai_posix

I am currently using

X86-64 PC with Yocto/Poky + Xenomai

Modules:
rt_e1000e
rtpacket
ec_master (with main_devices=ff:ff:ff:ff:ff:ff)
ec_rtdmnet.

It definitely manages to send some packets and during initialization it correctly reports a slave error and manages to reset the slave. Then during the looping there seems to be some timeouts and it complains about things I don't understand. This may well be because of my lack of understanding of the workings of the etherlab master.

So, for now I will treat this as success story.

TTFN, and have a great weekend!

Thanks
Per Öberg
Post by Edouard Tisserant
Hi Per
I should have documented this : rtdmnet.ko use RAW packet socket.
Don't forget to build and load rtpacket module to make it available.
modprobe rt_fec
modprobe rtpacket
rtifconfig rteth0 up
cat > /etc/sysconfig/ethercat <<EOF
MASTER0_DEVICE="ff:ff:ff:ff:ff:ff"
DEVICE_MODULES="rtdmnet"
EOF
/etc/init.d/ethercat start
ethercat slaves
Cheers,
Edouard
Post by Per Oberg
Hi
I tried this today, but I ran into some troubles. Most of my troubles are
probably due to me being new to etherlab/ethercat.
In lack of a valid ethernet-card on the right computer running the right kernel
I tried using the xenomai rt_loopback device and got
[ 82.574576] EtherCAT: 1 master waiting for devices.
[ 104.779742] ec_rtdmnet: EtherCAT master RTnet Ethernet device module 1.5.2
32c9a2dea9ed
[ 104.779750] EtherCAT: Accepting 00:00:00:00:00:00 as main device for master 0.
[ 104.779751] rtdm_socket() = -97!
[ 104.779752] EtherCAT 0: Releasing main device 00:00:00:00:00:00.
-97 usually means EAFNOSUPPORT or "Address family not supported by protocol"
Is that to be expected when using the loopback-device or am I doing something
else wrong?
sudo modprobe rt_loopback
sudo insmod ./master/ec_master.ko main_devices=ff:ff:ff:ff:ff:ff debug_level=1
sudo insmod ./devices/ec_rtdmnet.ko
./configure --enable-rtdm --with-xenomai-dir=/opt/xenomai
--with-linux-dir=/.../xenomai-kernel-ipipe.git --disable-r8169
--disable-8139too
Kernel is 4.9.38
Xenomai is 3.0.7
Per Öberg
EtherLab master over real-time Ethernet drivers from Xenomai 3 just works !
This is great news!
I was just looking for Xenomai / EtherCat for x86_64 so I will definitely take
this out for a spin.
Best Regards
Per Öberg
I also added a new device : devices/rtdmnet.c. It is really similar to
devices/generic.c, but it uses RTDM's Net drivers instead of Linux
drivers. This new device still needs fixing, and only works in idle mode
for now - working on a fix right now.
Now fixed.
For the record, and in case anyone would want to reproduce the
experiment on I.mx6 with real-time FEC driver, patches for Xenomai
3.0.7 to enable and fix FEC driver are attached. Tested with Linux
4.9.51.
Best regards
Edouard Tisserant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-xenomai_adjust_RTSKB_SIZE_for_FEC.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-xenomai_fix_FEC.patch
Type: text/x-patch
Size: 3498 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xenomai-enable-FEC.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
<http://lists.etherlab.org/pipermail/etherlab-users/attachments/20181008/776c6159/attachment-0002.bin>
_______________________________________________
etherlab-users mailing list
http://lists.etherlab.org/mailman/listinfo/etherlab-users
Loading...