.. ----------------------------------------------------------------------------- .. *[CR]************************************************************************** Copyright (c) by IBV - Echtzeit- und Embedded GmbH & Co. KG All Rights reserved. .. *[FH]************************************************************************** PROJECT: PHYSDK MODULE: DOC FILE: pb-am64x-industrial-ethernet-comms-sdk.rst CONTENTS: Documentation intended for the phyBOARD-Electra AM64x PHYTEC Wiki .. *[CL]************************************************************************** 12-06-2025 FWA created === FWA: Felix Wagner, IBV, www.ibv-augsburg.de .. ******************************************************************************* .. ------------------------------------------------------------------------------- .. Substitutions .. ------------------------------------------------------------------------------- .. include:: ../substitutions.rst .. |image-electra-jumpers| image:: ../../images/phycore-am64x/pb-07225_kpeb-c-010-am64-cb-j26-j27.webp :width: 500px :alt: phyBOARD-Electra AM64x MII Jumper Setting .. |image-electra-expansion-setup| image:: ../../images/phycore-am64x/pb-07225_kpeb-c-010-devkit-eth-setup.webp :width: 500px :alt: phyBOARD-Electra AM64x with Ethernet Expansion Board Setup .. |image-linux-application| image:: ../../images/phycore-am64x/Linux-Ind-Comms-Application.webp :width: 500px :alt: Linux Application Screenshot .. ------------------------------------------------------------------------------- .. Page .. ------------------------------------------------------------------------------- .. _IndustrialEthernetExample-64: Industrial Ethernet Dev Kit =========================== This wiki section contains information on how to run demo software for industrial Ethernet communication on the PHYTEC phyBOARD-Electra AM64x. The demos support these communication protocols: * EtherCAT SubDevice (slave) * PROFINET Device * EtherNet/IP Adapter The required software/firmware components are provided in binary form for the demo. To communicate with the device an external EtherCAT MainDevice (Master), PROFINET Controller or EtherNet/IP Scanner is required. By default the demo uses the PHYTEC Ethernet Expansion Board ports ETH3 and ETH4. Using ETH1 and ETH2 on the carrier board is supported, too. Requirements ------------ In order to follow this guide, you will need: * The `phyBOARD-Electra AM64x Industrial Ethernet Dev Kit `_. This includes: * phyCORE-AM64x System on Module * phyBOARD-Electra AM64x carrier board * PHYTEC Ethernet Expansion Board KPEB-C-010 (optional) * Micro-USB cable * Two Ethernet cables * Pre-flashed bootable SD card (BSP-Yocto-Ampliphy-AM64x-PD25.1.0) * 12V/2A power supply * USB microSD card reader * `phyBOARD-Electra AM64x Industrial Ethernet Dev Package `_ * When using ETH1 and ETH2 of the carrier board, note that the board must be configured to use MII. Check/resolder the jumpers J26 and J27 to use MII (pins 2+3 (TX_CLK), reference *phyBOARD-Electra AM64x MII Jumper Setting* for the correct placement). |image-electra-jumpers| *phyBOARD-Electra AM64x MII jumper settings* * Follow the `Quickstart Guide `_ to boot into the BSP-Yocto-Ampliphy-AM64x-PD25.1.0 Linux using the supplied SD card. * Assign a static IP address to eth0 as described `here `_ Setup ----- |image-electra-expansion-setup| * Connect ETH0 to the Ethernet network * When using *PHYTEC Ethernet Expansion Board*: * Connect the expansion board as shown * Connect ETH3 to the industrial Ethernet controller node * When NOT using *PHYTEC Ethernet Expansion Board* (carrier board ports): * Connect ETH1 to the industrial Ethernet controller node * Connect the Micro-USB cable to the DEBUG_UART connector Step 1: Setup device tree overlay ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To access the Ethernet interfaces from the R5F core, these interfaces must not be claimed by Linux. Therefore, apply the device tree overlay delivered in demo/boot. * Copy contents of `demo/boot/` to `/boot` (device tree overlays) * Reboot the device with UART console attached * Press SPACE to enter U-Boot console * When using *PHYTEC Ethernet Expansion Board*, execute .. code-block:: shell setenv overlays k3-am642-phyboard-electra-ind-eth-demo_r5f.dtbo k3-am642-phyboard-electra-ind-eth-demo_icssg1.dtbo saveenv boot * When NOT using *PHYTEC Ethernet Expansion Board* (carrier board ports), execute .. code-block:: shell setenv overlays k3-am642-phyboard-electra-ind-eth-demo_r5f.dtbo k3-am642-phyboard-electra-ind-eth-demo_icssg0.dtbo saveenv boot ------------ Note: For the *PHYTEC Ethernet Expansion Board*, ICSSG1 is be disabled, for the carrier board ethernet ports, ICSSG0 is disabled. You may decide to disable both to be flexible in using either port: .. code-block:: shell setenv overlays k3-am642-phyboard-electra-ind-eth-demo_r5f.dtbo k3-am642-phyboard-electra-ind-eth-demo_icssg0.dtbo k3-am642-phyboard-electra-ind-eth-demo_icssg1.dtbo saveenv boot ------------ Step 2: Disable automatic firmware load to R5F ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * To avoid loading of the default R5F application, execute the following in Linux .. code-block:: shell cd /lib/firmware/ ls -l mv am64-main-r5f0_1-fw{,-bck} mv am64-main-r5f1_1-fw{,-bck} mv am64-main-r5f1_0-fw{,-bck} mv am64-main-r5f0_0-fw{,-bck} * Reboot Step 3: Start the application ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * When using *PHYTEC Ethernet Expansion Board* * Copy the content of `demo//Release` to `/root` * When NOT using *PHYTEC Ethernet Expansion Board* (carrier board ports) * Copy the content of `demo//Release_ETHCAR` to `/root` * Copy the contents of `demo/linux_application` to `/root` * To load and run the R5F firmware, run: .. code-block:: shell # for EtherCAT ./start-r5.sh /root/ethercat_subdev_beckhoff_electra.out # for Ethernet/IP ./start-r5.sh /root/ethernetip_adapter_electra.out # for PROFINET ./start-r5.sh /root/profinet_dev_electra.out * Run ``dmesg`` and check for the following output: .. code-block:: shell [ 91.259092] remoteproc remoteproc0: powering up 78000000.r5f [ 91.298590] remoteproc remoteproc0: Booting fw image profinet_dev_electra.out, size 3213032 [ 91.306355] rproc-virtio rproc-virtio.5.auto: assigned reserved memory node r5f-dma-memory@a0000000 [ 91.310681] virtio_rpmsg_bus virtio1: rpmsg host is online [ 91.313839] rproc-virtio rproc-virtio.5.auto: registered virtio1 (type 7) [ 91.313868] remoteproc remoteproc0: remote processor 78000000.r5f is now up [ 91.323525] virtio_rpmsg_bus virtio1: creating channel rpmsg-raw addr 0xd [ 91.327161] virtio_rpmsg_bus virtio1: creating channel rpmsg-raw addr 0xe * Run the Linux application .. code-block:: shell # for EtherCAT ./ind_comms_linux_demo # for Ethernet/IP ./ind_comms_linux_demo -f enip-flash.bin # for PROFINET ./ind_comms_linux_demo -f pn-flash.bin * `-m` sets the MAC address for the interface (not used in EtherCAT firmware), may be omitted * `-f` supplies the file for non-volatile memory emulation, may only be omitted for EtherCAT (not used in EtherCAT firmware). .. note:: The `ind_comms_linux_demo` application must be run to fully initialize the R5F firmware. The industrial Ethernet protocol is not available until this application is started. The application may be stopped after initialization, the firmware will continue to run. * The terminal shows a screen of the demo application: |image-linux-application| * Values of process data variables (outputs) which are provided to Linux by the controlling application * Values of process data variables (input) which are defined by Linux and provided by the controlling application. The values can be incremented and decremented with pressing the keys *A* ... *J* and *a* ... *j* . * Furthermore, these process data variables are managed by the R5F software and provided to the controlling application: * The signal inputs available in the phyBOARD-Electra AM64x Demo: * ADC_IN: Value of 12bit analog in channel (connector X27, pin 43) * GPIO_IN: State of the GPIO (connector X27, pin 30) * GPIO_OUT: Output to control an LED on the phyBOARD-Electra AM64x (LED1) EtherCAT SubDevice on phyBOARD-Electra AM64x -------------------------------------------- Overview ^^^^^^^^ The next diagram gives an overview on the hardware and software architecture to implement an EtherCAT SubDevice based on the phyBOARD-Electra AM64x: .. image:: ../../images/phycore-am64x/phyBOARD-Electra-EtherCAT-SubDevice.webp :width: 500px *EtherCAT SubDevice architecture on phyBOARD-Electra AM64x* * The EtherCAT firmware is started on the **AM64x PRU-ICSSG**. The firmware is provided by Texas Instruments in the TI Industrial Communications SDK. It supports the low level EtherCAT communication via the two connected Ethernet Phys. See here for the `supported EtherCAT features of the TI EtherCAT firmware `_ * On one **Arm Cortex-R5F core** the EtherCAT SubDevice demo application is running: * The application is based on the Beckhoff SSC sample of TI Industrial Communications SDK. It relies on the TI MCU+SDK and the FreeRTOS operating system. More information about the `TI EtherCAT SubDevice sample application `_ * The `Beckhoff ET9300 Slave Stack Code (SSC) `_ is integrated to implement an EtherCAT SubDevice. The SSC is available for free for members of the `EtherCAT Technology Group `_ * The EtherCAT slave stack can be configured via the **Beckhoff ET9300 SSC Tool**. The process data objects (PDOs) can be defined by an Excel file. An ESI (EtherCAT Slave Information) file can be exported describing the EtherCAT features and process data of the EtherCAT SubDevice. * The demo application provided in the PHYTEC Industrial Ethernet Dev Package shows how to provide process data as EtherCAT SubDevice. It supports: * A single GPIO output to control an LED * A single GPIO input * Input values which are read from the AM64x ADC * 10 output and 10 inputs values which are exchanged via an RPMsg channel with Linux as a sample for data exchange with lower real-time requirements * Linux is running on the **Dual-Core Arm Cortex-A53**: * Provides a terminal application with access to the 10 outputs and 10 inputs exchanged via RPMsg. To control the EtherCAT SubDevice application, an EtherCAT MainDevice is necessary. The necessary ESI file for the EtherCAT SubDevice can be found here: demo/ethercat/phyboard-electra-ethercat-subdev-beckhoff.xml Use Beckhoff TwinCAT as EtherCAT MainDevice ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ See this `guide for using Beckhoff TwinCAT on a PC `_ as an EtherCAT MainDevice to control the EtherCAT SubDevice demo on the phyBOARD-Electra. Use CODESYS as EtherCAT MainDevice ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ See this `guide for using CODESYS for EtherCAT on a PC `_ as an EtherCAT MainDevice to control the EtherCAT SubDevice demo on the phyBOARD-Electra. Use IBV icECAT EtherCAT Master Stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IBV provides a portable EtherCAT MainDevice (master) software which can be licensed in source code for a project. * More information can be found on the `icECAT EtherCAT Master product page `_ * Free `demo versions for various boards are provided here `_ * A `full-featured evaluation version `_ for a Linux PC and for various embedded platforms can be requested at IBV. .. todo: icECAT Master for PHYTEC boards phyBOARD-Electra, phyBOARD-Pollux, ... .. todo: icECAT Master on AM64x Linux CPSW binary Standard Link Layer Driver ...? EtherNet/IP Adapter on phyBOARD-Electra --------------------------------------- The diagram below describes the software architecture implementing the EtherNet/IP Adapter on the phyBOARD-Electra. .. image:: ../../images/phycore-am64x/phyBOARD-Electra-EtherNetIP-Adapter.webp :width: 500px *EtherNet/IP Adapter architecture on phyBOARD-Electra* * The **AM64x PRU-ICSSG** is running the TI EtherNet/IP Adapter firmware. This firmware is provided by Texas Instruments in a binary form and loaded to the Programmable Real-Time Unit by the R5F firmware. It implements the switching layer, statistics, DLR (Device Level Ring) and PTP (Precision Time Protocol). * An **Arm Cortex-R5F Core** runs the EtherNet/IP demo application. * It implements the protocol software stack. * It relies on the TI MCU+SDK and the FreeRTOS operating system. More information about the `TI EtherNet/IP Adapter sample application `_. * EDS files can be generated with the `EZ-EDS tool `_ from ODVA * The demo application provided in the PHYTEC Industrial Ethernet Dev Package shows how to provide I/O data as EtherNet/IP Adapter. It supports: * A single GPIO output to control an LED * A single GPIO input * Input values which are read from the AM64x ADC * 10 output and 10 inputs values which are exchanged via an RPMsg channel with Linux as a sample for data exchange with lower real-time requirements * The stack stores configuration data in non-volatile memory. This demo emulates an EEPROM through a separate RPMsg channel. The persistent data is stored in a binary file on the Linux system. * Linux is running on the **Dual-Core Arm Cortex-A53**: * Provides access to the 10 outputs and 10 inputs exchanged via an RPMsg * Provides non-volatile memory emulation (enip-flash.bin) * Provides initial configuration data (MAC) An EtherNet/IP Scanner is required to run the demo and access the adapter's I/O data. The required EDS file can be found in demo/ethernetip/phyboard-electra-EthernetIP.eds Use CODESYS for EtherNet/IP Scanner ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ See this `guide for using CODESYS for EtherNet/IP on a PC `_ as an EtherNet/IP Scanner to control the EtherNet/IP Adapter demo on the phyBOARD-Electra. PROFINET Device on phyBOARD-Electra AM64x ----------------------------------------- The PROFINET Device software architecture for the phyBOARD Electra is provided below. .. image:: ../../images/phycore-am64x/phyBOARD-Electra-PROFINET-Device.webp :width: 500px *PROFINET Device architecture on phyBOARD-Electra AM64x* * The **AM64x PRU-ICSSG** is running the TI PROFINET device firmware. It is provided by Texas Instruments as a binary. It is based on the SIEMENS ERTEC stack and the LWIP network stack since Industrial Communications SDK v09.02 * One **Arm Cortex-R5F Core** is running the PROFINET device application. * It implements the protocol software stack. * It relies on the TI MCU+SDK and the FreeRTOS operating system. More information about the `TI EtherNet/IP Adapter sample application `_. * GSDML files must be edited manually but can be verified using the `PROFINET GSD Checker `_ from the PNO. The GSD Checker currently is only available for members of the PNO/PI. * The demo application provided in the PHYTEC Industrial Ethernet Dev Package shows how to provide I/O data. It supports: * A single GPIO output to control an LED * A single GPIO input * Input values which are read from the AM64x ADC * 10 output and 10 inputs values which are exchanged via an RPMsg channel with Linux from data exchange with lower real-time requirements * The application stores configuration data in non-volatile memory. This demo emulates an EEPROM through a separate RPMsg channel. The persistent data is stored in a binary file on the Linux system. * Linux is running on the **Dual-Core Arm Cortex-A53**: * Provides access to the 10 outputs and 10 inputs exchanged via an RPMsg * Provides non-volatile memory emulation (pn-flash.bin) * Provides initial configuration data (MAC) Use CODESYS for PROFINET Controller ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ See this `guide for using CODESYS for PROFINET on a PC `_ as PROFINET Controller to control the PROFINET Device demo on the phyBOARD-Electra. Building your own Industrial Ethernet application ------------------------------------------------- Additionally to a binary delivery, the `PHYTEC Industrial Ethernet Dev Package `_ provides sources for building and adapting the demo application. These sources are located in src/. See src/doc/index.html for a comprehensive guide on how to build the demo. Additional information ---------------------- * Software sources and build instructions: * phyBOARD-Electra AM64x Ethernet Expansion Board Documentation: |ref-ethernet-expansion| * TI Industrial Communications SDK documentation * `AM64x INDUSTRIAL COMMUNICATIONS SDK 11.00.00 `_ * `CODESYS EtherCAT Master Setup `_ * `CODESYS EtherNet/IP Scanner Setup `_ * `CODESYS PROFINET Controller Setup `_ * `IBV EtherCAT Master Stack on TI AM64x `_ Support ------- As a PHYTEC partner company, `IBV - Echtzeit- und Embedded GmbH & Co. KG `_ provides `professional engineering services for Industrial Ethernet applications `_: * Industrial Ethernet SubDevice development and customization * Customization of the data model * Adaptation to a custom application on R5F or Linux * Handling firmware update * Time synchronization (EtherCAT DC, gPTP, …), also with other AM64x controllers and interfaces * Support for conformance test (EtherCAT) * TI MCU+ SDK extensions: driver development, custom board adaptation Contact ^^^^^^^ | IBV - Echtzeit- und Embedded GmbH & Co. KG | Bergiusstr. 13 | 86199 Augsburg | GERMANY | | Email: sales@ibv-augsburg.de | Web: https://www.ibv-augsburg.de