How saga0619/rtnet_soem works
RTNE-SOEM is a C EtherCAT master library, patched for RTnet use. Its documented workflow is to initialize with ec_init or ec_init_redundant on the main thread, then perform EtherCAT communication from a real-time thread; the README also describes redundant links and a humanoid-robot stability test. The graph separates the master runtime, protocol capabilities, platform I/O, and OS timing/thread support. Several protocol modules are present in the tree but were not sampled, so their nodes are shown without speculative call arrows.
Main entry points: ethercatmain.c Master core · osal.h OS abstraction · nicdrv.c RTK NIC driver · ethercatcoe.c CoE
Components 18
Master runtime
- Master core
soem/ethercatmain.c - Wire types
soem/ethercattype.h
EtherCAT protocols
- Base datagrams
soem/ethercatbase.c - Slave configuration
soem/ethercatconfig.c - CoE
soem/ethercatcoe.c - EoE
soem/ethercateoe.c - FoE
soem/ethercatfoe.c - SoE
soem/ethercatsoe.c - Distributed clocks
soem/ethercatdc.c - Protocol printing
soem/ethercatprint.c
Platform I/O
- Linux NIC driver
oshw/linux/nicdrv.c - RTK NIC driver
oshw/rtk/nicdrv.c - RTK MAC support
oshw/rtk/lw_mac/lw_emac.c
OS services
- OS abstraction
osal/osal.h - Linux OS services
osal/linux/osal.c - RTK OS services
osal/rtk/osal.c
Other components
- Application
- EtherCAT slaves
Connections 11
- Application → Master core: initializes and communicates
- Master core → Wire types: uses definitions
soem/ethercatmain.c - Master core → RTK NIC driver: selects platform interface
- Master core → EtherCAT slaves: exchanges datagrams
- Linux NIC driver → EtherCAT slaves: sends and receives frames
oshw/linux/nicdrv.c - RTK NIC driver → RTK MAC support: initializes MAC
oshw/rtk/nicdrv.c - RTK NIC driver → EtherCAT slaves: sends and receives frames
- Master core → OS abstraction: uses timing services
soem/ethercatmain.c - CoE → OS abstraction: uses timing services
soem/ethercatcoe.c - OS abstraction → Linux OS services: platform implementation
- OS abstraction → RTK OS services: platform implementation
osal/osal.h