This example shows how to build and run an ICS host application on Linux on the AM64x-EVM, connected over SPI to a TICS100MOD target. It supports EtherCAT, EtherNet/IP, and PROFINET, with one build configuration per protocol, and includes an EtherCAT demo with TwinCAT.
Before starting, complete the Quick Start Guide and flash the protocol firmware for your chosen protocol onto the target, as described in the Configurator guide.
am64-main-app is an ICS host application for Linux. In the installed TICS100MOD SDK, the project is located under:
Import this folder into Eclipse IDE. The imported project is named ics-host-app-am64-linux.
| Item | Details |
|---|---|
| Host | AM64x-EVM |
| Target | TICS100MOD |
| Host-target interface | MCU SPI0 plus GPIO handshake and reset lines |
| Operating system | Linux (ti-processor-sdk-linux-am64xx-evm-11.01.05.03) |
| Protocols | EtherCAT, EtherNet/IP, PROFINET |
| Project name | ics-host-app-am64-linux |
| Item | Details |
|---|---|
| Hardware | AM64x-EVM, TICS100MOD (Carrier Board and ICS Development Board), 8 jumper wires, industrial network controller |
| Host PC software | Eclipse IDE for C/C++ Developers, Arm GNU Toolchain (AArch64 Linux), MinGW make |
| Linux SDK | Patched kernel and device tree (see AM64x Linux SDK Modifications) |
| Target firmware | Firmware for the chosen protocol, flashed as described in the Quick Start Guide |
| Controller software | TwinCAT (EtherCAT), a PROFINET controller and PRONETA (PROFINET), or an EtherNet/IP scanner (EtherNet/IP) |
Connect the AM64x-EVM to the TICS100MOD target with jumper wires according to the table below.
| Signal | AM64x-EVM pin (Safety Connector) | TICS100MOD pin | Wiring Color Code |
|---|---|---|---|
| CLOCK | 16 (MCU_SPI0_CLK) | SPI0_CLK | Blue |
| MOSI | 4 (MCU_SPI0_D0) | SPI0_D0 | Red |
| MISO | 2 (MCU_SPI0_D1) | SPI0_D1 | Green |
| CS | 12 (MCU_GPIO0_9) | SPI0_CS | Yellow |
| TARGET BUSY | 5 (MCU_GPIO0_8) | GPIO8 | Orange |
| TARGET REQUEST | 9 (MCU_GPIO0_7) | GPIO14 | Purple |
| TARGET RESET | 20 (MCU_I2C0_SCL) | PORZ_HOST | Grey |
| GND | 23 (DGND) | GND | Black |
This section describes the software tools, development environment, and target-specific modifications used to develop and build the ICS host application for the AM64x EVM platform.
The host application was initially developed on Windows using Eclipse IDE for C/C++ Developers.
While the current workflow is Eclipse-based, future development may migrate toward a more platform-independent build system, such as CMake or Autotools, to simplify integration with environments such as Yocto and other Linux-based build systems.
Install Eclipse IDE for C/C++ Developers.
Download: LINK
Install the Arm GNU cross-compilation toolchain used to build the Linux application for the AM64x target.
Download: LINK
After installation, add the toolchain bin directory to the system PATH.
Install MinGW to provide the make utility required by the build process.
Download: LINK
Select the mingw32-base package and add the MinGW bin directory to the system PATH.
Create a copy of mingw32-make.exe and rename the copied file to make.exe.
ti-processor-sdk-linux-am64xx-evm-11.01.05.03. If a different SDK version is used, the patch may require manual review or adaptation before being applied successfully.Several Linux kernel and device-tree modifications are required on the AM64x EVM to support the host application.
Since no Main Domain SPI interface is exposed through the board connectors, the mcu_spi0 peripheral is used for communication with the target device.
The industrial LED GPIO expander driver must also be enabled by setting:
All the required GPIOs are configured as well.
In addition, the onboard red LED was repurposed for application testing and validation, and its default device-tree configuration was disabled.
All required Linux SDK modifications are provided in the patch below:
After applying the Linux SDK patch:
The project provides one build configuration for each supported protocol:
| Configuration | Protocol |
|---|---|
Debug Ethernetip | EtherNet/IP |
Debug Profinet | PROFINET |
Debug Ethercat | EtherCAT |
ics-host-app-am64-linux.Install the rebuilt kernel modules, including the TPIC2810 driver, alongside the matching kernel and device tree. Confirm that /dev/spidev1.0 and the configured GPIO chips are available, and grant the application the required device access. Install the matching libgpiod runtime, ensure the binary has execute permission, and launch it from a writable working directory for file-transfer tests.
In Eclipse, set the Cross GCC toolchain path to the actual compiler installation directory and verify its AArch64 Linux compiler prefix. The project's saved compiler directory is independent of the shell PATH.
After a successful build:
The controller-side configuration for each protocol is described in the EtherCAT, EtherNet/IP, and PROFINET demo sections below.
The following tests are common to all protocols:
These common tests demonstrate how the same ICS API can be used across all of the supported industrial protocols: EtherCAT, EtherNet/IP, and PROFINET.
The application console interface is used for executing test commands when launched from an interactive terminal.
The available commands allow you to start and stop supported tests and check their status where applicable.
The auto increment variable test validates the acyclic network-to-target object read/get request and the associated object read callback mechanism. The test verifies that the callback is triggered whenever the object is read by a network controller.
When a network controller (for example, a PLC) requests the value of the auto increment variable, the read callback is triggered on the host. The callback increments the current variable value by 1 and returns the updated value to the requester. As a result, each successive read operation returns a value that is one greater than the previous one.
The emergency variable test validates the acyclic network-to-target object write/set request and the associated object write callback mechanism. The test verifies that the callback is triggered whenever the object is written by a network controller.
When the emergency variable is written, the callback compares its value against the configured EMERGENCY_THRESHOLD of 100. Values greater than the threshold set the emergency output pin high; otherwise, it is set low.
The LED test reads the cyclic network-to-target LED status variable and updates the corresponding host LEDs.
Start the test:
Stop the test:
Display the current LED status:
The Target-to-Network (T2N) test periodically increments a 16-bit variable and applies the updated value to the target.
Start the test:
Stop the test:
Display the current T2N test status:
The bus state monitoring test periodically refreshes and reads the bus state variable. The result is reported in the application debug logs.
Start the test:
Stop the test:
am64-main-app application has been built using the Debug Ethercat build configuration and that the corresponding EtherCAT SubDevice firmware is running on the target TICOM100MOD.
Launch the Linux host application using the procedure described in Run.
Copy the EtherCAT ESI XML file, TICS100MOD Simple.xml, to the TwinCAT directory:
The following demonstrations illustrate the common functionality provided by the ICS host application. The same application-level interfaces are used across all of the supported industrial protocols.
The LED test reads the cyclic network-to-target LED status variable and updates the corresponding host LEDs.
Start the test by entering the following command in the Linux host application's console:
i2c-leds.
255 to the variable.
Verify that the updated value is reflected in TwinCAT and in the Linux host application's console output.
The host console should report the LED states, with all eight LEDs shown as ON when the value is 255.
The Target-to-Network (T2N) test periodically increments a variable and applies the updated value to the target. The value is transferred cyclically and can be monitored in TwinCAT.
Start the test by entering the following command in the Linux host application's console:
Stop the test by entering the following command in the Linux host application's console:
The emergency variable test validates acyclic object write access and the associated host-side write callback. When the emergency variable is written through TwinCAT, the host application logs the received value and controls the emergency output pin according to the configured EMERGENCY_THRESHOLD of 100.
100 (for example, 101) to the variable.
100 (for example, 100) to the variable. Verify that the terminal logs the new value and that the emergency output pin is set LOW.
The File Access over EtherCAT (FoE) test demonstrates file transfer between TwinCAT and the ICS application using the FoE service.
In the Download section, select a test file and download it to the device. In this example, the target firmware .mcelf file is used.
Verify that the download completes successfully.
In the Upload section, upload the file from the device back to the PC, specifying the appropriate file name and destination.
Verify that the upload completes successfully.
The Ethernet over EtherCAT (EoE) test demonstrates Ethernet communication over the EtherCAT connection. The test uses TwinCAT to configure EoE and verifies connectivity by pinging the configured IP address and observing the corresponding output in the Linux host application's terminal.
02:01:05:20:03:E9192.168.1.15
Open the Windows Command Prompt and ping the configured IP address:
Replace <IP_ADDRESS> with the IP address configured for EoE.
The ADS over EtherCAT (AoE) test demonstrates read and write access through TwinCAT.
This test demonstrates the transmission of diagnostic messages and verifies that they are displayed in TwinCAT's diagnostic history. The example includes Info, Warning, and Error messages.
The EtherNet/IP demo showcases both cyclic and acyclic data exchange between an EtherNet/IP network controller (for example, a PLC) and the host application through the ICS software stack.
The demo creates a custom EtherNet/IP object and a set of assemblies that can be used to validate different communication paths and callback mechanisms implemented by the host application.
The demo creates a custom EtherNet/IP object with:
0x700x01| Attribute ID | Size in bytes | Purpose | Related Test |
|---|---|---|---|
0x300 | 2 | Cyclic | T2N Test |
0x301 | 2 | Cyclic | - |
0x302 | 2 | Cyclic | - |
0x303 | 2 | Cyclic | - |
0x310 | 1 | Cyclic | LED Test |
0x311 | 2 | Cyclic | - |
0x312 | 2 | Cyclic | - |
0x313 | 2 | Cyclic | - |
0x320 | 1 | Cyclic | - |
0x321 | 1 | Cyclic | - |
0x322 | 1 | Cyclic | - |
0x323 | 1 | Cyclic | - |
0x380 | 4 | Acyclic | Auto Increment Variable Test |
0x381 | 4 | Acyclic | Emergency Variable Test |
0x400 | 2 | Acyclic (Class Attribute) |
The demo test variables are mapped to their corresponding EtherNet/IP object attributes in examples/ics-host/linux/am64-main-app/linux-app/ethernetip/ics_protocol_ethernetip.c, as shown below:
The mapping associates the application variables used by the demo test cases with their corresponding EtherNet/IP object attributes:
leds_status_byte → Attribute 0x310 (LED Test)auto_increment_word → Attribute 0x300 (T2N Test)increment_by_read → Attribute 0x380 (Auto Increment Variable Test)emergency_uint32 → Attribute 0x381 (Emergency Variable Test)| Assembly Type | Instance ID | Mapped Attributes |
|---|---|---|
| Configuration Assembly | 0x04 | 0x320, 0x321 |
| Configuration Assembly | 0x05 | 0x322, 0x323 |
| Input Assembly | 0x64 | 0x300, 0x301 |
| Output Assembly | 0x65 | 0x310, 0x311 |
| Input Assembly | 0x66 | 0x302, 0x303 |
| Output Assembly | 0x67 | 0x312, 0x313 |
In addition to the custom object and assemblies, the demo creates two custom CIP services under Class 0x70.
| Service Code | Class ID | Instance ID | Response Type | Purpose |
|---|---|---|---|---|
0x4B | 0x70 | 0x00 | Synchronous | Demonstrates a custom class-level CIP service. |
0x4C | 0x70 | 0x01 | Asynchronous | Demonstrates a custom instance-level CIP service. |
This service is implemented at the class level (Class 0x70, Instance 0x00) and returns its response synchronously.
The response size increases each time the service is executed. If the service has been invoked X times since startup, the response contains X bytes, where every byte has the value X.
This behavior allows users to verify that the service has been executed and that the returned payload is generated dynamically on each request.
This service is implemented at the instance level (Class 0x70, Instance 0x01) and demonstrates the use of the ICS asynchronous custom service response mechanism.
Upon receiving the service request, the host application does not return the response immediately. Instead, the request is completed asynchronously using the custom-service asynchronous response handler mechanism.
192.168.1.10. Ensure that the EtherNet/IP network controller is configured with an IP address in the same subnet (for example, 192.168.1.1 with subnet mask 255.255.255.0) to allow communication with the adapter.The following sections describe each test in detail, including the corresponding attribute and the procedure required to validate its functionality.
Associated Attribute: 0x380
The auto increment variable test validates the acyclic object read path and the associated object read callback mechanism.
To execute the test:
0x700x010x380Expected result:
1 before the response is sent.Associated Attribute: 0x381
The emergency variable test validates the acyclic object write path and the associated object write callback mechanism.
To execute the test:
0x700x010x3810x64 (100 decimal).Expected result:
100).100, the red emergency LED on the AM64x-EVM board turns ON.100, the red emergency LED turns OFF.In the Linux host console, run LED_TEST start before performing the controller steps below.
Associated Attribute: 0x310
The LED test validates the cyclic network-to-target communication path.
To execute the test:
Establish an I/O connection by sending a ForwardOpen request using the following connection string:
0x650x640x65 process data. This byte is mapped to Attribute 0x310.Expected result:
In the Linux host console, run T2N_TEST start before performing the controller steps below.
Associated Attribute: 0x300
The T2N (Target-to-Network) test validates the cyclic target-to-network communication path.
To execute the test:
Establish an I/O connection by sending a ForwardOpen request using the following connection string:
0x64, which contains Attribute 0x300.Expected result:
0x300 in the background.0x64 therefore changes continuously.The custom CIP services can be tested directly from the network controller by issuing requests to the corresponding service codes.
Service 0x4B (Synchronous Service)
0x700x000x4BExpected result:
| Request Count | Response Data |
|---|---|
| 1 | 0x01 |
| 2 | 0x02 0x02 |
| 3 | 0x03 0x03 0x03 |
Service 0x4C (Asynchronous Service)
0x700x010x4CExpected result:
0xFF.| Request Count | Response Pattern |
|---|---|
| 1 | All bytes = 0xFF |
| 2 | All bytes = 0xFE |
| 3 | All bytes = 0xFD |
| 4 | All bytes = 0xFC |
This test validates the EtherNet/IP connection timeout notification mechanism.
To execute the test:
Expected result:
This test validates the ability of the host application to modify selected EtherNet/IP adapter configuration objects at runtime.
Execute the following command from the host application console:
Example:
Expected result:
Execute:
Expected result:
1.Execute:
Expected result:
1.This test validates the built-in EtherNet/IP Reset service implementation.
To execute the test:
Expected result:
The Profinet demo showcases both cyclic and acyclic data exchange between a Profinet controller (for example, a PLC) and the host application through the ICS software stack.
The demo uses 4 submodules from the gsd file used as the following:
| Variable | Module | Sub Module | Record/ InOut |
|---|---|---|---|
| IDM_IOM_V1_IDS_TIO2_Input_IDT_TI2 | IDM_IOM_V1 | IDS_TIO2 | Input |
| IDM_IOM_V1_IDS_TIO4_Output_IDT_TO4 | IDM_IOM_V1 | IDS_TIO4 | Output |
| IDM_IOM_V1_IDS_IOM_MAP_IDT_MOD_Param_Dummy_Byte0 | IDM_IOM_V1 | IDS_IOM_MAP | IDT_MOD_Param |
| IDM_IM_V1_IDS_IM_MAP_IDT_MOD_Param_Dummy_Byte0 | IDM_IM_V1 | IDS_IM_MAP | IDT_MOD_Param |
Associated Variable: IDM_IOM_V1_IDS_IOM_MAP_IDT_MOD_Param_Dummy_Byte0
The auto increment variable test validates the acyclic object read path and the associated object read callback mechanism.
To execute the test:
IDM_IOM_V1IDS_IOM_MAP409616
Expected result:
1 before the response is sent.Associated Variable: IDM_IM_V1_IDS_IM_MAP_IDT_MOD_Param_Dummy_Byte0
The emergency variable test validates the acyclic object write path and the associated object write callback mechanism.
To execute the test:
IDM_IM_V1IDS_IM_MAP409616
0x64 (100 decimal).Expected result:
100).100, the red emergency LED on the AM64x-EVM board turns ON.100, the red emergency LED turns OFF.In the Linux host console, run LED_TEST start before performing the controller steps below.
Associated Variable: IDM_IOM_V1_IDS_TIO4_Output_IDT_TO4
The LED test validates the cyclic network-to-target communication path.
To execute the test:
IDM_IOM_V1\IDS_TIO4In the Linux host console, run T2N_TEST start before performing the controller steps below.
Associated Variable: IDM_IOM_V1_IDS_TIO2_Input_IDT_TI2
The T2N (Target-to-Network) test validates the cyclic target-to-network communication path.
To execute the test:
IDM_IOM_V1\IDS_TIO2The Diagnostics test validates a special type of acyclic communication:
ALARM_TX_TEST add_diag n where n could be from 1 to 5
ALARM_TX_TEST remove_diag n where n could be from 1 to 5