How cherry-embedded/cherryecat works
CherryECAT is an MCU/RTOS EtherCAT master stack. An application configures and starts a master; it scans and configures slaves, then exchanges cyclic PDO datagrams while handling mailbox protocols and distributed-clock synchronization. Shell commands expose master operations, and the repository also provides ESI/ENI conversion tools. The graph combines README-documented capabilities with sampled source and SOURCE INDEX references; some subsystem links are documented rather than verified call paths.
Main entry points: ec_slave.c Slave Scan and Setup · ec_master.c Master Runtime · ec_mailbox.c Mailbox Transfer · ec_datagram.c Datagram Queue
Components 24
Master Control
- Master Runtime
src/ec_master.c - Shell Commands
src/ec_cmd.c - Distributed Clocks
src/ec_slave.c
Slave Protocol
- Slave Scan and Setup
src/ec_slave.c - Slave Information
src/ec_slave_table.c - SII Access
src/ec_sii.c - Mailbox Transfer
src/ec_mailbox.c - CoE
src/ec_coe.c - FoE
src/ec_foe.c - EoE
src/ec_eoe.c - PDO Cycles
include/ec_master.h
Ethernet Transport
- Datagram Queue
src/ec_datagram.c - Network Interface
src/ec_netdev.c - Board Ethernet Ports
port - PHY Detection
src/phy/chry_phy.c
RTOS Platform
- RTOS Abstraction
include/ec_osal.h - RTOS Adapters
osal
Configuration Tools
- ESI Parser
scripts/esi_parser.py - ENI Parser
scripts/eni_parser.py
Other components
- RT Application
- Shell User
- EtherCAT Slaves
- ESI Description
- ENI Configuration
Connections 25
- RT Application → Master Runtime: configures
README.md - Shell User → Shell Commands: invokes
README.md - Shell Commands → Master Runtime: controls
src/ec_cmd.c - Master Runtime → Slave Scan and Setup: scans and configures
README.md - Slave Scan and Setup → Datagram Queue: queues register access
src/ec_slave.c - Master Runtime → Datagram Queue: queues transfers
README.md - Master Runtime → PDO Cycles: runs cyclic exchange
README.md - PDO Cycles → Datagram Queue: transfers PDOs
README.md - Datagram Queue → Network Interface: sends and receives
src/ec_datagram.c - Network Interface → Board Ethernet Ports: uses driver
port/netdev_stm32h7.c - Board Ethernet Ports → PHY Detection: configures PHY
port/netdev_stm32h7.c - Network Interface → EtherCAT Slaves: communicates
README.md - Slave Scan and Setup → Slave Information: updates topology
README.md - Slave Scan and Setup → SII Access: reads slave EEPROM
README.md - Slave Scan and Setup → Mailbox Transfer: uses mailbox
README.md - Mailbox Transfer → CoE: carries CoE
README.md - Mailbox Transfer → FoE: carries FoE
README.md - Mailbox Transfer → EoE: carries EoE
README.md - Slave Scan and Setup → Distributed Clocks: configures clock sync
src/ec_slave.c - Master Runtime → RTOS Abstraction: uses RTOS services
- RTOS Abstraction → RTOS Adapters: implemented by
osal/ec_osal_threadx.c - ESI Description → ESI Parser: parses
README.md - ESI Parser → SII Access: generates EEPROM data
README.md - ENI Configuration → ENI Parser: parses
README.md - ENI Parser → Slave Scan and Setup: generates sync config
README.md