EtherCAT Master Software on Linux

EtherCAT and Linux

Today, EtherCAT has become one of the most popular real-time Ethernet solutions in the world. The EtherCAT Technology Group (ETG) is responsible for keeping the EtherCAT technology open for all potential users. The ETG is the fieldbus organization with the largest number of members in the world. The list of members can be found on its homepage.

While on x86 PCs, the dominating operating system still is Microsoft(c) Windows(c), the operating systems used in Embedded Systems are much more diversified. As over the past years high end ARM based microcontrollers have become more and more complex this diversification has significantly being reduced - Real-time Linux today is the by far most popular real-time operating system (RTOS) for such MCUs. See also how the usage of operating system has changed for acontis' EtherCAT customers here.

Taking the above facts it is obvious that running an EtherCAT Master on Linux has become a need in many customer's applications. Using Linux arises some challenges that have to be overcome. Besides taking care of GPL issues that come up when using the patented EtherCAT technology, performance is the key technical challenge.  

acontis EC-Master EtherCAT master stack for Linux

The acontis EtherCAT Master stack software architecture has been approved by the OSADL to being conform to GPL rules as all software runs in user mode and thus no patent conflicts arise. Furthermore, this architecture in conjunction with real-time user mode drivers guarantees highest possible deterministic real-time performance.

The EtherCAT Master Software EC-Master supports the Linux architectures x86, x64, ARM, AArch64 and PowerPC. Complemented by supporting many different CPUs and Ethernet Controllers, acontis offers out-of-the-box Linux EtherCAT solutions for many controllers.
Due to it´s scalability and modular design, EC-Master may run on low-end systems, equipped with a Cortex-M7 controller, as well as on high-end CPUs, like Intel® Core™-i7.
The master code is designed to run solely in the Linux User space. This enables a fast and convenient development process and also conforms to the GNU General Public License (GPL). To achieve high update rates (short cycle times) the implementation doesn´t require any blocking kernel functions (APIs) in the cyclic part.

Architecture using Linux Network Driver

The EC-Master stack communicates with the slaves by sending and receiving EtherCAT frames using an Standard Ethernet network adapter (MAC). The Linux system includes different network drivers for the different adapter types. The Linux network driver can be used by means of an abstracted network adapter type independend interface called SOCK_RAW to send and receive frames, although the performance may be poor and real-time constraints are typically not kept due to Linux network stack inclusion and driver code that is not optimized for high performance cyclic operation. Because SOCK_RAW is typically available on every Linux Distributions’ Kernel, the pre-compiled EcMasterDemo can be used for evaluation of the EC-Master library‘s general functionality without compiling any host specific files. For discreet slaves that e.g. implement Distributed Clocks, real-time constraints must be kept. In this case SockRaw is very likely not able to send and receive frames in time and the EtherCAT slaves will refuse the operation. Therefore SOCK_RAW should be only used for intial evaluation purpose and be replaced with the acontis real-time driver as explained below.

Architecture using acontis Real-time Driver

The acontis Real-time Driver replaces the standard Linux Ethernet network adapter (MAC) driver for real-time EtherCAT usage. The driver runs in User Space and handles the MAC directly for high performance cyclic operation. It needs direct access to the MAC granted by an GPL‘ed Kernel Module called atemsys. The Kernel module must be compiled to match the running Kernel. Methods for Kernel module compilation can be found in the Linux Distribution‘s documentation. Additionally a build recipe for Yocto Linux is included. The Real-time Driver is not GPL‘ed and must be licensed. It needs the atemsys loaded at the Linux target for running. With the granted access to the MAC HW it operates fast on sending and receiving frames by completely bypassing the Linux network stack. The standard Linux network adapter driver may not operate at the same time on the same instance as the acontis Real-time Driver. It is therefore needed to unbind the network adapter instance by removing the driver from the system, unbinding the instance using the virtual sys-fs or in case of embedded devices by modifying the Linux Device Tree. The atemsys is shipped with the EC-Master and should be updated if the EC-Master contains a newer version.

Architecture used to run EtherCAT on Windows

  • Fully integrated EtherCAT real-time solution
    • one vendor, one support contact
    • Acontis has expertise for Windows real-time extensions back to 1994 and is leading provider for EtherCAT software since 2005
  • Key Features
    • Win32 real-time platform base on Real-time Linux
      • Most popular and de-fact standard RTOS
      • Deterministic and hard real-time
    • Microsoft® Visual Studio® support for the non-real-time and real-time part of the software
    • Class A EtherCAT Master Stack
    • High Performance real-time Ethernet Drivers
  • All runtime components included: No additional license required
    • License for EtherCAT Class A Master Stack
    • License for RT-Linux based Windows Real-time Platform

Real-time Ethernet Drivers (Link Layers)

  • Linux network driver (emllSockRaw): x86, x64, ARM, AArch64, PPC
  • Intel Pro/100 (emllI8255x): x86
  • Intel Pro/1000 (emllI8254x): x86, x64, ARM, AArch64
  • Intel Cyclone V (emllDW3504): ARM
  • Realtek 100MBit (emllRTL8139): x86
  • Realtek Gigabit (emllRTL8169): x86, x64, ARM, AArch64
  • Texas Instruments AM33xx, AM43xx, AM57xx (emllCPSW): ARM
  • Texas Instruments AM33xx, AM57xx (emllICSS): ARM
  • NXP TSEC/eTSEC controller, LS1021A (emllETSEC): ARM, PPC
  • NXP i.MX6, i.MX7, i.MX8 (emllFslFec): ARM
  • Renesas RZ/G1E (emllSHEth): ARM
  • Xilinx Zynq-7000 , UltraScale (emllGEM): ARM, AArch64
  • Beckhoff CCAT (emllCCAT): x86, x64, ARM
  • Nvidia, Jetson TX2 (emllI8254x): AArch64
  • STMicroelectronics STM32MP1 (emllDW3504): ARM

Kernel versions and distributions

The EC-Master can be used with any recent Linux distribution supporting custom Kernel module compilation like Ubuntu, Debian, etc. The Kernel Module atemsys handles legacy Kernel versions down to 2.6.18. Especially drives typically need real-time support which must be supported by the hardware and Kernel (CONFIG_PREEMPT_RT or Xenomai).

More Information