This software is designed for the TI SoCs with PRU-ICSS IP to enable customers add EtherCAT SubDevice protocol support to their system. It implements EtherCAT SubDevice Controller(ESC) Layer 2 functionality with two MII ports (one IN and one OUT port per PRU-ICSS) in accordance with ETG.1000.4 Data Link Layer protocol specification. This provides EtherCAT ASIC like functionality integrated into TI SoCs.
EtherCAT firmware for PRU-ICSS is a black box product maintained by TI. EtherCAT SubDevice FWHAL(Firmware and Hardware Abstraction Layer) allows loading and running the EtherCAT firmware and acts as an interface with ESC firmware. FWHAL implements the key interface between EtherCAT SubDevice Controller Emulation firmware and EtherCAT stack.
SysConfig can be used to configure things mentioned below:
Sync Jitter measurement done using TwinCAT 3.1 along with C6015-0020 (Beckhoff PLC) with cycle time at 50μs. Note that PRU Core Clock is running at 200MHz, unless mentioned otherwise.
Feature | Detail | Value |
---|---|---|
Distributed Clock | Sync Jitter | 15ns (Capture Duration = 65 hours) |
Latency | Process Path (PRU Clock Frequency @ 200MHz) | Average = 400ns, Max = 410ns |
Auto Forward Path (Reverse Path) (PRU Clock Frequency @ 200MHz) | Average = 340ns, Max = 360ns | |
Process Path (PRU Clock Frequency @ 333MHz) | Average = 280ns, Max = 300ns | |
Auto Forward Path (Reverse Path) (PRU Clock Frequency @ 333MHz) | Average = 220ns, Max = 240ns |
Record ID | Details | Workaround |
---|---|---|
PINDSW-72 | PDI/PD watchdog counter incremented by 1 whenever PDI/PD watchdog is disabled | None |
PINDSW-74 | LRD access on unused registers increment WKC - no register protection while using LRD | None |
PINDSW-2204 | Frames with no SFD not counted as errors if received on reverse path | None |
PINDSW-2360 | System time of next Sync0 pulse register (0x990:0x993) is not instantaneous, resulting in read of incorrect value if read immediately after sync pulse | None |
PINDSW-5135 | Read permissions and byte level write permissions for RW type commands are not checked | None |
PINDSW-5145 | RX_ER counter does not count errors outside frame in MII RX_CLK units precisely | Added PHY RX Error Counter Register (0x0E28) for improving RX Error Counter accuracy. Configuring this register will track RX_ERs within a frame precisely using PHY registers. Refer Register Exceptions for more details. |
PINDSW-5414 | Link Lost Counter is incorrectly incremented once for ports with polarity of RXLINK input as “Active Low” during initialization | Use Active High Polarity for LED_LINK/SPEED connected to MII0/MII1 Receive Link (RXLINK) pin of PRU-ICSS |
For more details, please see the EtherCAT SubDevice Errata document.
In EtherCAT networks, fast detection of link status changes is crucial to maintain real-time communication and network integrity. MDIO enables the processor to read status registers from connected PHYs, allowing the system to:
Please refer to Section 6.4.12 and Section 6.4.14.10 of the AM64x/AM243x Technical Reference Manual
To meet the stringent timing requirements of EtherCAT networks, the AM64x/AM243x platforms implement a fast link detection mechanism using the MDIO MLINK signal. This approach bypasses the standard state machine, allowing for quicker detection of link changes (10µs), which is essential for maintaining low-latency communication and effective cable redundancy. Refer to Enhanced Link for more details.
If your project is based on an older SDK and if you want to upgrade to the latest EtherCAT PRU firmware, follow the steps outlined below to ensure a smooth transition with minimal disruption to your existing codebase and system behavior:
gmake -s -f makefile.am243x.r5f.ti-arm-clang
(for RELEASE build) and gmake -s -f makefile.am243x.r5f.ti-arm-clang PROFILE=debug
(for DEBUG build) at {SDK_INSTALL_PATH}/source/industrial_comms/ethercat_slave/icss_fwhal/ for your corresponding device. Post this, you can rebuild the application to apply the latest FW changes.Folder/Files | Description |
---|---|
${SDK_INSTALL_PATH}/examples/industrial_comms | |
ethercat_subdevice_demo/simple | EtherCAT SubDevice Simple Example (based on pre-integrated stack) |
ethercat_subdevice_demo/cia402 | EtherCAT SubDevice CiA402 Example (based on pre-integrated stack) |
ethercat_subdevice_demo/ctt | EtherCAT SubDevice CTT Example (based on pre-integrated stack) |
ethercat_subdevice_beckhoff_ssc_demo | EtherCAT SubDevice Example based on Beckhoff SSC |
${SDK_INSTALL_PATH}/source/industrial_comms/ethercat_slave | |
icss_fwhal/firmware/g_v1.3 | Firmware for the PRU cores in PRU-ICSS. Firmware Version : 6.5.54 |
icss_fwhal/lib/ | FWHAL library for EtherCAT SubDevice |
icss_fwhal/tiescbsp.h | FWHAL interface file |
stack/*.lib | Evaluation libraries for EtherCAT SubDevice Stack |
stack/esi | ESI XML files for EtherCAT SubDevice Simple Example and EtherCAT SubDevice CiA402 Example |
stack/inc | Stack header files for evaluation stack |
beckhoff_stack/esi | ESI XML file for Beckhoff SubDevice Stack Code(SSC) based example |
beckhoff_stack/patch | Patch file for Beckhoff SubDevice Stack Code(SSC) sources |
beckhoff_stack/stack_hal | Stack adaptation APIs for Beckhoff SubDevice Stack Code(SSC) |
beckhoff_stack/stack_sources | Folder where Beckhoff SubDevice Stack Code(SSC) sources should be copied. Stack sources are not packaged in the SDK |
Please see APIs for Ethercat Slave FWHAL for API documentation.
It is recommended to use these FWHAL APIs in the stack adaptation files. For example, see ${SDK_INSTALL_PATH}/source/industrial_comms/ethercat_slave/beckhoff_stack/stack_hal
, which contains the stack adaptation APIs for Beckhoff SubDevice Stack Code(SSC).
Signal Name | Requirement | Description |
---|---|---|
PRU-ICSS MDIO | ||
PRGx_MDIO0_MDC | Mandatory | MDIO clock |
PRGx_MDIO0_MDIO | Mandatory | MDIO Data |
PRU-ICSS Distributed Clocks (Network Clock synchronization) | ||
PRGx_IEP0_EDC_SYNC_OUT0 | Recommmended (for DC capable SubDevices) | SYNC0 out - Time synchronized OUT0 |
PRGx_IEP0_EDC_SYNC_OUT1 | Optional (depends on customer application)) | SYNC1 out - Time synchronized OUT1 (depends on SYNC0) |
PRGx_IEP0_EDC_LATCH_IN0 | Optional | LATCH0 in (Time stamp latch input0) |
PRGx_IEP0_EDC_LATCH_IN1 | Optional | LATCH1 in (Time stamp latch input1) |
PRU-ICSS MII PDI Interrupt | ||
PRGx_IEP0_EDIO_DATA_IN_OUT28 | Optional | PDI ISR output to external SOC pin (via one of the 4 PRU-ICSS digio outputs). PDI ISR pin can be selected via vendor specific register at offset 0xE0A. |
PRGx_IEP0_EDIO_DATA_IN_OUT29 | ||
PRGx_IEP0_EDIO_DATA_IN_OUT30 | ||
PRGx_IEP0_EDIO_DATA_IN_OUT31 | ||
PRU-ICSS MII Port0 (IN Port) & PRU-ICSS MII Port1 (OUT Port) | ||
PRx_MII0_RXD0 | Mandatory | MII0 and MII1 Receive Data0 |
PRx_MII1_RXD0 | ||
PRx_MII0_RXD1 | Mandatory | MII0 and MII1 Receive Data1 |
PRx_MII1_RXD1 | ||
PRx_MII0_RXD2 | Mandatory | MII0 and MII1 Receive Data2 |
PRx_MII1_RXD2 | ||
PRx_MII0_RXD3 | Mandatory | MII0 and MII1 Receive Data3 |
PRx_MII1_RXD3 | ||
PRx_MII0_RXDV | Mandatory | MII0 and MII1 RX Data Valid |
PRx_MII1_RXDV | ||
PRx_MII0_RXER | Optional if PHY supports Enhanced Link detection | MII0 and MII1 RXERR |
PRx_MII1_RXER | ||
PRx_MII0_TXD0 | Mandatory | MII0 and MII1 Transmit Data0 |
PRx_MII1_TXD0 | ||
PRx_MII0_TXD1 | Mandatory | MII0 and MII1 Transmit Data1 |
PRx_MII1_TXD1 | ||
PRx_MII0_TXD2 | Mandatory | MII0 and MII1 Transmit Data2 |
PRx_MII1_TXD2 | ||
PRx_MII0_TXD3 | Mandatory | MII0 and MII1 Transmit Data3 |
PRx_MII1_TXD3 | ||
PRx_MII0_TXEN | Mandatory | MII0 and MII1 TX enable |
PRx_MII1_TXEN | ||
PRx_MII_MR0_CLK | Mandatory | MII0 and MII1 Receive clock |
PRx_MII_MR1_CLK | ||
PRx_MII_MT0_CLK | Mandatory | MII0 and MII1 Transmit clock |
PRx_MII_MT1_CLK | ||
PRx_MII0_RXLINK | Mandatory for cable redundancy support | Enhanced link detection. Redundancy support: connect LED_LINK/LED_SPEED from PHY here |
PRx_MII1_RXLINK |
EtherCAT SubDevice Controller firmware generates the following interrupts.
8 Host Interrupts (Host Interrupts 2 through 9) are exported from the PRU_ICSSG internal INTC for signaling the device level interrupt controllers. PRU_EVTOUT0 to PRU_EVTOUT7 correspond to these eight interrupts in the following table. Please check PRUICSS Interrupt Controller section for more details.
Name | Host Interrupt | Description |
---|---|---|
DC SYNC0 OUT | PRU_EVTOUT1 | Used in DC mode for syncing the application |
DC SYNC1 OUT | PRU_EVTOUT2 | Used in DC mode for syncing the application |
PDI Interrupt | PRU_EVTOUT3 | AL event/PDI interrupt to host stack |
ESC Command Acknowledgement | PRU_EVTOUT4 | ESC firmware command completion acknowledgement to Host |
enhancedlink_enable
of bsp_params should be set to TIESC_MDIO_RX_LINK_ENABLE while initializing the EtherCAT SubDevice FWHAL. This configuration is done in tiesc_socParamsInit()
in tiescsoc.c file. In the current implementation, this feature is enabled by default and configurable through the EtherCAT module in SysConfig for ease of use:
tiesc_ethphyInit()
in tiescsoc.c file.TI EtherCAT SubDevice Controller Register List contains descriptions of the registers in TI's EtherCAT SubDevice Controller implementation.
TI EtherCAT SubDevice Controller Exceptions lists the exceptions TI's EtherCAT SubDevice Controller implementation when compared with ET1100 ASIC. Please note that TI ESC is a 2 port EtherCAT SubDevice and it does not support E-bus interface and all the corresponding register fields are not implemented.
EtherCAT Debug Guide covers the most obvious use cases and debug scenarios encountered while using EtherCAT SubDevice.
Please refer to below documents to understand more about EtherCAT SubDevice on TI platforms and EtherCAT SubDevice protocol specifications.
Document | Description |
---|---|
EtherCAT on Sitara Processors | Application note by TI on the EtherCAT SubDevice implementation on TI's Sitara Processors. |
PRU-ICSS EtherCAT SubDevice Troubleshooting Guide | This troubleshooting guide is intended to provide guidance on how to set up and debug the EtherCAT SubDevice implemented on TI's Sitara processors. |
EtherCAT ESC Datasheet Section 1 - Technology | Section 1 of Beckhoff's EtherCAT SubDevice Controller (ESC) documentation which describes basic EtherCAT technology. |
EtherCAT ESC Datasheet Section 2 - Register Description | Section 2 of Beckhoff's EtherCAT SubDevice Controller (ESC) documentation which contains ESC register descriptions. |
Application Note ET9300 (EtherCAT SubDevice Stack Code) | This contains details on how to start EtherCAT SubDevice development with SubDevice Stack Code. |
EtherCAT SubDevice Implementation Guide from EtherCAT Technology Group | This contains information on how to develop an EtherCAT SubDevice implementation. |
EtherCAT SubDevice Design Quick Guide from Beckhoff | This contains information on modifying PDO when using Beckhoff SSC Tool for code generation. |