EtherCAT SubDevice
 
Loading...
Searching...
No Matches
Ethernet PRU_ICSSG instance-0 (PRU_ICSSG0) Usage Guide

Introduction

AM64X extends Sitara’s industrial-grade portfolio into high-performance microcontrollers. The AM64X device is designed for industrial applications, such as motor drives and remote I/O modules, which require a combination of real-time communications and processing capabilities.

The AM64X family offers scalable performance with up to two instances of Sitara’s gigabit TSN-enabled PRU_ICSSG. For more information, refer to the "Programmable Real-Time Unit Subsystem and Industrial Communication Subsystem - Gigabit (PRU_ICSSG)" section in the Processors and Accelerators chapter of the device TRM.

This document serves as a guide for using the PRU_ICSSG0 instance in the PRU_ICSSG peripheral. On EVMs supported by TI (AM64X-EVM, AM243X-EVM), it is not possible to use the PRU_ICSSG0 instance, as the PRG0_RGMII1 and PRG0_RGMII0 pins are not connected to Ethernet PHYs on those EVMs. A dedicated custom board is required to utilize the PRU_ICSSG0 instance of the ICSSG peripheral. The PRU_ICSSG1 instance of the ICSSG peripheral does not have these limitations.

This document provides a setup guide for bringing up the PRU_ICSSG0 instance on a custom board or an ICSSG0-enabled device.

On AM64X, out-of-the-box support for ICSSG0 is not available.

  • The PRU_ICSSG0 is supported on the AM64X SoC, but the standard TI EVMs and LaunchPads do not include board support.
  • PRU_ICSSG0 support can be achieved with a custom board. Contact TI for more details and possibilities.
SoC Architecture and details

Configuring PRU_ICSSG0

Configuring PRU_ICSSG0 instance in Sysconfig

In the "TI Drivers" section, select the "PRU (ICSS)" module and change the following:

  • Rename "CONFIG_PRU_ICSS1" to CONFIG_PRU_ICSS0.
SysConfig changes for TI drivers

In the "TI Industrial Comms Toolkit" section, select the "EtherCAT" module and change the following:

  • "ICCS Instance" to ICSSG0.
  • "MDIO Manual Mode Link Status Update" to PHY Polling Based.
  • "PRU Configuration" to CONFIG_PRU_ICSS0.
SysConfig changes for toolkit 1
SysConfig changes for toolkit 2

In the "TI Board Drivers" section, select the "ETHPHY" module and change the following:

  • In "CONFIG_ETHPHY0", change the "ETHPHY Device" to CUSTOM.
  • In the same config, change the "MDIO Phy Address" to the one of the custom PHY.
  • In the same config, change the "Custom Device Name" to CUST_PHY.
  • In "CONFIG_ETHPHY1", change the "ETHPHY Device" to CUSTOM.
  • In the same config, change the "MDIO Phy Address" to the one of the custom PHY.
  • In the same config, change the "Custom Device Name" to CUST_PHY.
SysConfig changes for board drivers 1
SysConfig changes for board drivers 2

Simple Demo Example with DP83826E (Sysconfig)

For this example, a custom board with two DP83826E PHYs is used.

In addition to the modifications in the previous chapter, the following changes must be made:

In the "TI Board Drivers" section, select the "ETHPHY" module and change the following:

  • In "CONFIG_ETHPHY0", change the "MDIO Phy Address" to 1.
  • In "CONFIG_ETHPHY0", change the "MDIO Phy Address" to 7.

In the "TI Drivers" section, select the GPIO section and add the following GPIO's:

  1. GPIO
    • Name: GPIO_RESET_ICSS0_PHY1
    • PIN Direction: OUTPUT
    • GPIO Pin: GPMC0_CLK/R17
    • Pull Up
  2. GPIO
    • Name: GPIO_RESET_ICSS0_PHY2
    • PIN Direction: OUTPUT
    • GPIO Pin: GPMC0_ADVn_ALE/P16
    • Pull Up
SysConfig changes for TI drivers DP83826E 1
SysConfig changes for TI drivers DP83826E 2

Simple Demo Example with DP83826E (Code Composer Studio Project)

In Code Composer Studio, right click on the project and choose "Properties". Under "Build" → "Arm Compiler" → "Predefined Symbols", add the following symbol:

  • CUST_PHY_DP83826=1
CCS Project changes for DP83826E 1

In the Industrial Communications SDK directory, navigate to "/examples/industrial_comms/custom_phy/src/". Select both files "CUST_PHY_dp83826e.c" and "CUST_PHY_dp83826b.c" and drag and drop them into the project in the Project Explorer. Following window appears, asking how to import the files to the project. Adopt these changes:

CCS Project changes for DP83826E 2

Simple Demo Example with DP83826E (Code)

The initialization routine of DP838261E PHY is different to the DP83869 PHY. Following code must be added to the example code. It can be placed in "ecSubDeviceSimple.c", at the end of the function "EC_SLV_APP_SS_initBoardFunctions()".

GPIO_pinWriteHigh(GPIO_RESET_ICSS0_PHY1_BASE_ADDR, GPIO_RESET_ICSS0_PHY1_PIN);
GPIO_pinWriteHigh(GPIO_RESET_ICSS0_PHY2_BASE_ADDR, GPIO_RESET_ICSS0_PHY2_PIN);
ClockP_usleep(ClockP_ticksToUsec(200));
GPIO_pinWriteLow(GPIO_RESET_ICSS0_PHY1_BASE_ADDR, GPIO_RESET_ICSS0_PHY1_PIN);
GPIO_pinWriteLow(GPIO_RESET_ICSS0_PHY2_BASE_ADDR, GPIO_RESET_ICSS0_PHY2_PIN);
ClockP_usleep(ClockP_ticksToUsec(200));
GPIO_pinWriteHigh(GPIO_RESET_ICSS0_PHY1_BASE_ADDR, GPIO_RESET_ICSS0_PHY1_PIN);
GPIO_pinWriteHigh(GPIO_RESET_ICSS0_PHY2_BASE_ADDR, GPIO_RESET_ICSS0_PHY2_PIN);
ClockP_usleep(ClockP_ticksToUsec(200));

In the file "ESL_BOARD_config.h", adapt the defines as follows:

#define ECAT_PHYADDR_IN (1u)
#define ECAT_PHYADDR_OUT (7u)
#define ECAT_PHYPOLINVERT_IN (false)
#define ECAT_PHYPOLINVERT_OUT (false)
#define ECAT_PHYUSERXLINK_IN (true)
#define ECAT_PHYUSERXLINK_OUT (true)

In the file "ESL_BOARD_OS_config.h, adapt the defines as follows:

#define ESL_DEFAULT_PRUICSS CONFIG_PRU_ICSS0
[...]
#define APP_PHYIN_RESET_PIN ESL_GPIO_enPIN_31
#define APP_PHYIN_RESET_MODULE ESL_GPIO_enMODULE_0
#define APP_PHYOUT_RESET_PIN ESL_GPIO_enPIN_32
#define APP_PHYOUT_RESET_MODULE ESL_GPIO_enMODULE_0