The subdirectory 'linux' contains hacked linux network drivers to directly communicate with the nic instead of using raw socket of the network stack. These drivers are inspired by IGH's EtherCAT master drivers. Contrary to this here we provide an interface to user-level processes.
Change working directory to the linux subdirecty and build the driver for your os/kernel.
-
Build drivers (guess os/kernel):
make
or (specify os/kernel dir):
make KERNEL_SOURCE_DIR=/usr/src/linux-rt
-
Install drivers:
sudo make modules_install
type vim /etc/modprobe.d/blacklist-igb.conf
and add following content:
# prevent linux from loading it's own igb network driver
blacklist igb
All network devices which should be used as an EtherCAT interface have to be
specified explicitly. Therefore you have to pass the MAC-addressses to the
kernel module. Type vim /etc/default/grub
and change:
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/disk/by-partlabel/swap0 showopts splash=silent intel_iommu=on preempt=full quiet security=apparmor mitigations=auto processor.max_cstate=1 intel_idle.max_cstate=0 nortsched isolcpus=2,3,4,5 nohz_full=2,3,4,5 mitigations=off idle=poll nosmt systemd.unit=default-offline.target"
to
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/disk/by-partlabel/swap0 showopts splash=silent igb_ethercat.ethercat_mac_addr=00:1b:21:ed:35:41 intel_iommu=on preempt=full quiet security=apparmor mitigations=auto processor.max_cstate=1 intel_idle.max_cstate=0 nortsched isolcpus=2,3,4,5 nohz_full=2,3,4,5 mitigations=off idle=poll nosmt systemd.unit=default-offline.target"
Enter
grub2-mkconfig -o /boot/grub2/grub.cfg
Create /etc/udev/rules.d/991-ecat.rules
with following content:
# udev rules for EtherCAT devices:
SUBSYSTEM=="ecat", KERNEL=="ecat?", MODE="0666"