This example shows how to build and run a FreeRTOS-based ICS host application on the AM261x-LP, connected over SPI to a TICS100MOD target. It supports EtherCAT, EtherNet/IP, and PROFINET, with one build configuration per protocol.
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.
am261-main-app is a CCS-based ICS host application for the AM261x-LP platform. In the installed TICS100MOD SDK, the project is located under:
Import this folder into Code Composer Studio (CCS). The imported project is named ics-host-app-am261-freertos.
| Item | Details |
|---|---|
| Host | AM261x-LP |
| Target | TICS100MOD |
| Host-target interface | SPI0 plus GPIO handshake and reset lines |
| Operating system | FreeRTOS (R5F) |
| Protocols | EtherCAT, EtherNet/IP, PROFINET |
| Project name | ics-host-app-am261-freertos |
| Item | Details |
|---|---|
| Hardware | AM261x-LP, TICS100MOD (Carrier Board and ICS Development Board), 8 jumper wires, industrial network controller |
| Software | CCS, MCU+ SDK AM261X 26.0.0.06, SysConfig 1.27.0, TI Arm Clang 4.0.4.LTS |
| Target firmware | Firmware for the chosen protocol, flashed as described in the Quick Start Guide |
| Controller software | TwinCAT (EtherCAT), a PROFINET controller or tool (PROFINET), or an EtherNet/IP scanner (EtherNet/IP) |
Install the listed products and make the MCU+ SDK available in CCS before importing and building the project.
Connect the AM261x-LP to the TICS100MOD target with jumper wires according to the table below.
| Signal | AM261x-LP pin (host) | TICS100MOD pin (target) | Wiring Color Code |
|---|---|---|---|
| CLOCK | J1.7 | SPI0_CLK | Blue |
| MOSI | J2.15 | SPI0_D0 | Red |
| MISO | J2.14 | SPI0_D1 | Green |
| TARGET REQUEST FEED | J2.19 | SPI0_CS | Yellow |
| TARGET BUSY | J6.53 | GPIO8 | Orange |
| TARGET REQUEST | J8.78 | GPIO14 | Purple |
| TARGET RESET | J8.77 | PORZ_HOST | Grey |
| GND | - | - | Black |
The project provides one build configuration for each supported protocol:
| Configuration | Protocol |
|---|---|
Debug-ethernetip | EtherNet/IP |
Debug-profinet | PROFINET |
Debug-ethercat | EtherCAT |
am261-main-app into CCS.ics-host-app-am261-freertos.The controller-side operation for each protocol is described under "Bring the Bus State On" in the next section.
For the AM261x-LP SoC initialization and CCS loading procedure, see the MCU+ SDK CCS Launch, Load and Run guide. To run the host application from flash without CCS, follow the MCU+ SDK Flash a Hello World example guide and select the images generated by your build configuration.
The following tests are common to EtherNet/IP, PROFINET, and EtherCAT:
After Ics_start() succeeds, the application registers the read and write callbacks and creates the bus-state monitor, T2N, and LED test threads. The monitor periodically refreshes the BusState reported by the target. The T2N and LED threads perform their cyclic work while the bus state is On (true) and pause while it is Off (false).
The industrial network controller initiates the read and write requests used by the auto increment and emergency tests. The T2N and LED tasks run automatically once the bus state allows cyclic work.
The target updates the bus state automatically. Use the operation for the selected protocol:
| Protocol | Controller operation and bus-state behavior |
|---|---|
| EtherCAT | Configure or scan the target in TwinCAT using the supplied ESI file, then bring it to OP (Operational). The target reports On when it enters OP and Off when it leaves OP. |
| PROFINET | Configure the controller using the supplied GSDML and the application's modules and submodules, then start controller communication to establish an Application Relationship (AR) with the target. The AR connection callback sets the bus state On; the disconnection callback sets it Off. |
| EtherNet/IP | Run the host application so that the target's EtherNet/IP adapter initializes. The target sets the bus state On after adapter initialization. For the cyclic tests, also establish an I/O connection from the controller with ForwardOpen, using Output Assembly 0x65 and Input Assembly 0x64. The On flag alone does not establish this cyclic connection. |
Use the read request for the selected protocol:
| Protocol | Read request |
|---|---|
| EtherCAT | In TwinCAT CoE - Online, read Incr. by read, index 0x2017, subindex 0. |
| EtherNet/IP | Send Get_Attribute_Single to Class 0x70, Instance 0x01, Attribute 0x380. |
| PROFINET | Read record index 4096 for submodule IDS_IOM_MAP in module IDM_IOM_V1. The test variable is the first byte of the record. |
1 before returning it to the controller.Use the write request for the selected protocol:
| Protocol | Write request |
|---|---|
| EtherCAT | In TwinCAT CoE - Online, write Emergency message, index 0x200C, subindex 0. |
| EtherNet/IP | Send Set_Attribute_Single to Class 0x70, Instance 0x01, Attribute 0x381. |
| PROFINET | Write record index 4096 for submodule IDS_IM_MAP in module IDM_IM_V1. Put the test value in the first byte of the record. |
freertos-app/ics_app.c, set a breakpoint at the start of OnWrite_EmergencyMsg, and resume the host application.101 to the variable listed above.IcsObject_get(object, ICS_UINT32(value)) and inspect the local variable value in CCS. It should equal 101. Resume the application.Use the LED output variable for the selected protocol:
| Protocol | Output variable |
|---|---|
| EtherCAT | TwinCAT RxPDO variable i2c-leds, index 0x2000, subindex 2. |
| EtherNet/IP | First byte of Output Assembly 0x65, mapped to Class 0x70, Instance 0x01, Attribute 0x310. |
| PROFINET | First byte of the four-byte output submodule IDS_TIO4 in module IDM_IOM_V1. |
255 (0xFF) to the LED output variable, then write 0.255 and OFF for 0.Use the input variable for the selected protocol:
| Protocol | Input variable |
|---|---|
| EtherCAT | TwinCAT TxPDO variable Test Record, SubIndex 4, index 0x2002, subindex 4. |
| EtherNet/IP | First two bytes of Input Assembly 0x64, mapped to Class 0x70, Instance 0x01, Attribute 0x300. |
| PROFINET | Two-byte input submodule IDS_TI2 in module IDM_IOM_V1. |
10 ms delay between iterations.For controller setup and protocol-specific network operations, see the Linux Host AM64x-EVM example. Its Linux console commands apply only to the Linux host application; use the procedures on this page for the FreeRTOS example.
am261-main-app host application.