PRU ICSS Profinet Device User Guide

Introduction

PRU-ICSS Profinet Device package is designed for the Sitara processor family (with PRU-ICSS IP) to enable customers add Profinet Device support to their system.


System Requirements

Supported Devices

  • AM572x IDK 1.3A/B
  • AM571x IDK 1.3A
  • AM437x IDK
  • AM335x ICEV2
  • AMIC11x ICE

Component Version


This release requires Processor SDK RTOS, see Processor SDK Getting Started Guide


Component Version
Processor SDK RTOS for AM57xx 6.3.2
Processor SDK RTOS for AM437x 6.3.0
Processor SDK RTOS for AM335x 6.3.0

Directory Structure

|  |--- docs
|       |---Industrial_Protocol_Package_Getting_Started_Guide.pdf
|       |---PROFINET_IRT_Slave_Datasheet.pdf
|       |---PRU_ICSS_Profinet_Release_Notes.pdf
|       |---PRU_ICSS_Profinet_Slave_User_Guide.pdf
|       |---PRU-ICSS-Profinet_Slave_01.00.04_manifest.html
|  |--- examples
|       |--- board
|           | --- common
|           | --- iceAM335x
|           | --- iceAM437x
|           | --- idkAM571x
|           | --- idkAM572x
|           | --- include
|       |--- profinet_slave
|           | --- AM57xx
|           | --- AM335x
|           | --- AM437x
|           | --- GSD
|           | --- snmp
|       |--- osal
|   |--- protocols
|       |--- profinet_slave
|               |--- docs
|                       |--- doxygen
|               |--- drivers
|               |--- firmware
|                       |--- v1.0
|                       |--- v2.1
|               |--- include
|                       |--- IRT
|                       |--- RT_MRP
|               |--- projects
|                       |--- ccsproject_args
|       |--- snmp
|               |--- drivers
|               |--- include
|               |--- projects
|  |--- third_party
|       |--- protocols
|               |--- profinet_slave
|                           |--- Docs
|                           |--- include
|                                |--- IRT
|                                |--- RT_MRP
|                           |--- source
|                           |--- stack_lib
|                                |--- am57xx
|                                     |--- a15
|                                          |--- IRT
|                                          |--- RT_MRP
|                                |--- am437x
|                                     |--- a9
|                                          |--- IRT
|                                          |--- RT_MRP
|                                |--- am335x
|                                     |--- a8
|                                          |--- IRT
|                                          |--- RT_MRP
|               |--- snmp
|                           |--- snmp_core
|                                 |--- source
|                           |--- source
|                           |--- stack_lib
|                                |--- am57xx
|                                     |--- a15
|                                |--- am437x
|                                     |--- a9
|                                |--- am335x
|                                     |--- a8

Note

Refer to install path to get updated view for any changes in directory structure


Generating Project files

Steps to generate Project files

  • Setup the environment variables

    • Edit the file [INSTALL-DIR]/protocols/<protocol name>/projects/projectCreate.bat or .sh to align to the environment in your machine. All these paths should be accurate and mandatory; otherwise it will cause errors.

    • Edit the file [INSTALL-DIR]/protocols/<protocol name>/projects/projectCreate.bat or .sh to align to the environment in your machine. All these paths should be accurate and mandatory; otherwise it will cause errors.

      • CCS_INSTALL_DIR - Set the path where the recommended version of CCS is installed in user machine. For example, if CCSv10.4.0 is installed in default path, set it to “C:\ti\ccs1040\ccs”.

      Note

      Use the path up to where the folder ‘eclipse’ is located.

      • CCS_WORKSPACE_LOC - Set the CCS workspace location. This folder will be created if it doesn’t exist already.

      Note

      Use the default path provided for CCS_WORKSPACE_LOC as a reference.

      • IA_SDK_HOME - Specify the IA_SDK_HOME based on the the directory where the industrial package is installed. If the package is installed in a custom directory, make sure this path is modified properly.
      • PDK_INSTALL_PATH - Set the path where PDK RTOS package is installed (Refer to default path in projectCreate.bat)

      Note

      Use the path up to where the folder ‘ti’ is located.

      • PROJECT_CREATE_DIR - Set the folder where the created project will be kept. User can import the projects from this directory to CCS
      • PROJECT_CREATE_OPTIONS_FILE_DIR - Specify the directory where the project create options files are kept. This folder contains the *.txt files which specify the project settings (linked files, predefined symbols, compiler and linker options for a specific project)
  • Open Command/Shell Prompt and navigate to [INSTALL-DIR]/protocols/<protocol name>/projects

  • Run projectCreate.bat or projectCreate.sh. The batch file intakes three mandatory command line arguments (The mandatory arguments are case sensitive!)

Usage format: projectCreate.bat [SOC] [PROCESSOR] [PROJECT_NAME]

  • [SOC]

    • The valid values for first command line argument [SOC] are
      • AM571x - To generate a project specific to AM571x
      • AM572x - To generate a project specific to AM572x
      • AM437x - To generate a project specific to AM437x
      • AM335x - To generate a project specific to AM335x
      • AMIC11x - To generate a project specific to AMIC11x
      • AM57xx - To generate a library project specific to AM57xx

    Note

    AM571x/AM572x should be used for profinet_slave_IRT/profinet_slave_RT_MRP project and AM57xx should be used for snmp_core_stack project.

  • [PROCESSOR]

    • The valid values for second command line argument [PROCESSOR] are
      • arm - To generate a project specific to ARM core
  • [PROJECT_NAME]

    • The valid values for third command line argument [PROJECT_NAME] to be used with Profinet slave installer package
      • profinet_slave_IRT - to generate Profinet slave IRT application project
      • profinet_slave_RT_MRP - to generate Profinet slave MRP application project
      • snmp_core_stack - to generate SNMP stack library project

Note

Ensure that Code Composer Studio is not running when executing projectCreate.bat or projectCreate.sh. If not, the eclipsec may throw errors

  • Usage example 1: projectCreate.bat AM572x arm profinet_slave_IRT
    To generate the project files for Profinet slave IRT application for AM572x ARM core by overwriting the project if it is already existing in PROJECT_CREATE_DIR\PROJECT_NAME_SOC_PROCESSOR
  • Usage example 2: projectCreate.bat AM335x arm profinet_slave_RT_MRP
    To generate the project files for Profinet slave RT MRP application for AM335x ARM core by overwriting the project if it is already existing in PROJECT_CREATE_DIR\PROJECT_NAME_SOC_PROCESSOR
  • Usage example 3: projectCreate.bat AM57xx arm snmp_core_stack
    To generate the project files for SNMP stack for AM571x/AM572x ARM core by overwriting the project if it is already existing in PROJECT_CREATE_DIR\PROJECT_NAME_SOC_PROCESSOR
  • Usage example 4: projectCreate.bat AM437x arm snmp_core_stack
    To generate the project files for SNMP stack for AM437x ARM core by overwriting the project if it is already existing in PROJECT_CREATE_DIR\PROJECT_NAME_SOC_PROCESSOR

Note

If the project create is successful, the generated project files will be found in [INSTALL-DIR]/protocols/<protocol name>/projects/PROJECT_NAME_SOC_PROCESSOR


Functional Details

Note

PROFINET I/O RT/IRT Device is certified by COMDEC for Conformance Classes A, B and C

Note

As per the SLA terms, TI cannot distribute the PROFINET Device stack code from Molex/TMG in source format. The evaluation library is provided with this release. For production use, one has to obtain the license directly from Molex/TMG

Note

As per the SLA terms, TI cannot distribute the SNMP stack code from HCC Embedded/Tuxera in source format. The evaluation library is provided with this release. For production use, one has to obtain the license directly from HCC Embedded/Tuxera. Please refer section Building full feature SNMP stack to rebuild the SNMP stack

Note

The application uses DMTimer4 as the clock source for the SYSBIOS Ticks (Refer to cfg file for details). The DMTimer module should be enabled for the application to load properly with the change. This needs to be done in the GEL file.

Make the following changes in GEL File to enable DMTimer4

  1. Add the line inside hotmenu AM3359_ICE_Initialization()
    • WR_MEM_32(CM_PER_TIMER4_CLKCTRL, PRCM_MODULEMODE_ENABLE);
  2. Add the defines in the GEL File
    • #define CM_PER_TIMER4_CLKCTRL (PRCM_BASE_ADDR + 0x88)
    • #define PRCM_MODULEMODE_ENABLE (2U)

Note

User can use the Digital Input to write default remanent values to Flash. Digital input position 5 is used to flash the values. Use HVS or Rotary switch depending on the board to select digital input value.

PROFINET IRT

This example is a PROFINET I/O IRT Device application based on Molex/TMG PROFINET stack. PROFINET is a real-time Ethernet standard for high-speed, deterministic communications used in a wide range of industrial applications including factory automation, process automation and building automation.

This example also incorporates SNMP(Simple Network Management Protocol)using HCC Embedded/Tuxera SNMP stack. SNMP is required for managing devices in the network. This application supports SNMP MIB-2(System and Interfaces), LLDP-MIB, LLDP-EXT3-MIB and LLDP-PNO-MIB which are mandated for Conformance Class B. Current implementation of the LLDP-MIBs are limited in nature as the integration between PROFINET stack and SNMP interface is incomplete. The SNMP stack available in the example is a limited version, and shuts down after 1024 SNMP requests.

During start-up, the I/O Device is assigned an IP Address of 0.0.0.0 . The PROFINET master will have to configure the desired IP Address and device name to the I/O device before an I/O connection can be established with the device. Once the application is up, PROFINET I/O IRT device will start communicating with a PROFINET PLC, or a PROFINET IO Tester or SPIRTA.

The GSD file used for configuring the I/O Device in the master side is provided along with the application in [INSTALL-DIR]/examples/profinet_slave/GSD folder.

PROFINET I/O IRT Device has an integrated two-port cut-through learning switch. Switch handles the non real-time traffic and it has been interfaced with the PROFINET stack and TCP/IP (NDK) stack. It implements the PROFINET Quality of Service (QoS) using four priority queues on host and port interfaces. It implements PROFINET Filter Database for multicast addresses.

On the EVMs, the LED will blink in blue/orange when the application is running.

A simple sample I/O Application has been provided to demonstrate the usage of PROFINET implementation. All the 1440 bytes of output data are exposed to the application. Sample I/O application simply uses the first byte of output data and maps it to the Digital Output LED’s on the board. It also implements a mechanism to read the Digital Inputs. Interpretation of Digital Inputs by sample application is described below:

  • Setting Jumper on Digital Input pin 7-8 (4th pair of pins in J37 Industrial IO connector in AM57xx IDK EVM) generates an Alarm. This is an external way to manually generate the alarms from the I/O device.
  • Setting Jumper on Digital Input pin 5-6 (3rd pair of pins in J37 Industrial IO connector in AM57xx IDK EVM) generates a bit shift pattern input. Application reads this input and transmits to PLC.
  • Setting Jumper on Digital Input pin 9-10 (5th pair of pins in J37 Industrial IO connector in AM57xx IDK EVM) generates a fixed test data input.

User can write a simple PLC program where input data of I/O device is transmitted back by PLC as output data. For example, a Jumper can be inserted in Digital Input 1 on I/O device to generate a bit shift pattern which is then transmitted back by PLC to demonstrate the moving LED light on the Digital Output LED’s.

Details on setting up a PROFINET Connection with a PLC is included in [INSTALL-DIR]/third_party/protocols/profinet_slave/docs

The PROFINET Driver API guide is available here - [INSTALL-DIR]/protocols/profinet_slave/docs/API_documentation.html


PROFINET RT/MRP

This example is a PROFINET I/O RT/MRP Device application based on Molex/TMG PROFINET stack. PROFINET is a real-time Ethernet standard for high-speed, deterministic communications used in a wide range of industrial applications including factory automation, process automation and building automation.

This example also incorporates SNMP(Simple Network Management Protocol)using HCC Embedded/Tuxera SNMP stack. SNMP is required for managing devices in the network. This application supports SNMP MIB-2(System and Interfaces), LLDP-MIB, LLDP-EXT3-MIB and LLDP-PNO-MIB which are mandated for Conformance Class B. Current implementation of the LLDP-MIBs are limited in nature as the integration between PROFINET stack and SNMP interface is incomplete. The SNMP stack available in the example is a limited version, and shuts down after 1024 SNMP requests.

During start-up, the I/O Device is assigned an IP Address of 0.0.0.0 . The PROFINET master will have to configure the desired IP Address and device name to the I/O device before an I/O connection can be established with the device. Once the application is up, PROFINET I/O RT/MRP device will start communicating with a PROFINET PLC, or a PROFINET IO Tester.

The GSD file used for configuring the I/O Device in the master side is provided along with the application in [INSTALL-DIR]/examples/profinet_slave/GSD folder.

PROFINET I/O RT/MRP Device has an integrated two-port cut-through learning switch. Switch handles the non real-time traffic and it has been interfaced with the PROFINET stack and TCP/IP (NDK) stack. It implements the PROFINET Quality of Service (QoS) using four priority queues on host and port interfaces. It implements PROFINET Filter Database for multicast addresses.

On the EVMs, the LED will blink in blue/orange when the application is running.

A simple sample I/O Application has been provided to demonstrate the usage of PROFINET implementation. All the 1440 bytes of output data are exposed to the application. Sample I/O application simply uses the first byte of output data and maps it to the Digital Output LED’s on the board. It also implements a mechanism to read the Digital Inputs. Interpretation of Digital Inputs by sample application is described below:

  • Setting Jumper on Digital Input pin 7-8 (4th pair of pins in J37 Industrial IO connector in AM57xx IDK EVM) generates an Alarm. This is an external way to manually generate the alarms from the I/O device.
  • Setting Jumper on Digital Input pin 5-6 (3rd pair of pins in J37 Industrial IO connector in AM57xx IDK EVM) generates a bit shift pattern input. Application reads this input and transmits to PLC.
  • Setting Jumper on Digital Input pin 9-10 (5th pair of pins in J37 Industrial IO connector in AM57xx IDK EVM) generates a fixed test data input.

User can write a simple PLC program where input data of I/O device is transmitted back by PLC as output data. For example, a Jumper can be inserted in Digital Input 1 on I/O device to generate a bit shift pattern which is then transmitted back by PLC to demonstrate the moving LED light on the Digital Output LED’s.

Details on setting up a PROFINET Connection with a PLC is included in [INSTALL-DIR]/third_party/protocols/profinet_slave/docs

The PROFINET Driver API guide is available here - [INSTALL-DIR]/protocols/profinet_slave/docs/API_documetation.html

Isochronous Mode Support

Isochronus mode support has been enabled on Profinet Device firmware. Firmware can be configured to trigger isochronous mode signals. User can configure a maximum of two signals in a cycle. These signals can be used as Ti and To. The implementaion uses prX_edc_sync1_out signal. Both signal will be available in the Sync1 pin. Once configured, firmware will trigger the signals in all network cycles.

The ISOM features supports two modes - GPIO mode - In this mode Signals will be generated on Sync1 pin at configured time - Interrupt mode - In this mode, Hardware interrupt will be triggered at configured time Please note the signal will be gnenerated in Interrupt mode also.By default PRU EVTOUT7 is used for interrupt mode . User needs to provide the ISR handler in the the ISOM structure in the PN handle

Current implementation supports only single pulse width configuration for the signals. Pulse width used in latest configuration is taken

Note

Sync0 and Sync1 signals shares common pulse width configuration.User need to take care of this while enabling ISOM features. By default Sync0 is configured to 25 micro seconds. Changing the ISOM signal pulse width will impact the Sync0 signal also

Note

CMP register usage to configure Start of Green (SOG) values has been optimized in firmware 1.0 version. This is done to free CMP1 register for ISOM implementation. Instead of having separate SOG value for Tx and Rx for each port, the 1.0 firmware will have common SOG value for a direction ie Port1 Rx SOG and Port2 Tx SOG will have a single value and similarly Port2 Rx SOG and Port1 Tx SOG will have a single value. The values configured for a given direction is compared and highest value is used.

Building Full Feature SNMP stack

SNMP is provided as a library in the PRU-ICSS Profinet Device package with a limit of 1000 SNMP requests(after which it will shutdown). To have full development capability, users have to get the stack from HCC Embedded/Tuxera (please contact - https://www.hcc-embedded.com/embedded-snmp/ )

The SNMP stack project files can be generated by following the steps mentioned here . Once the user has access to the stack source, they can copy the files to [INSTALL-DIR]/third_party/protocols/snmp/snmp_core/source and re-build the library to get full development access.

The steps for building full feature SNMP stack using HCC Embedded/Tuxera SNMP source are given below.

  1. Copy the SNMP stack source to [INSTALL-DIR]/third_party/protocols/snmp/snmp_core/source
  2. Launch CCS and import snmp_core project found at [INSTALL-DIR]/protocols/profinet/projects/snmp_core_stack to CCS
  3. Build the project. This will generate the application binary(at [INSTALL-DIR]/third_party/protocols/snmp/stack_lib/$(SOC)/$(CORE)) which can be used to run in application.

Archives

../../../_images/E2e9.jpg

For technical support, please post your questions at http://e2e.ti.com