5.1. PRU ICSS Profinet Slave User Guide

5.1.1. Introduction

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


5.1.2. System Requirements

5.1.2.1. Supported Devices

  • AM64x EVM

5.1.2.2. Component Version

Component Version
Processor SDK for AM64X 1.0.0

5.1.4. Directory Structure

|   |--- docs
|       |---PROFINET_IRT_Slave_Datasheet.pdf
|       |---PRU-ICSS-Profinet_Slave_01.00.04_manifest.html
|   |--- examples
|       |--- board
|           | --- common
|           | --- evmAM64x
|           | --- include
|       |--- osal
|       |--- profinet_slave
|           | --- AM64x
|           | --- GSD
|           | --- snmp
|   |--- protocols
|       |--- common
|           |--- include
|           |--- source
|       |--- profinet_slave
|           |--- docs
|               |--- doxygen
|           |--- drivers
|           |--- firmware
|               |--- g_v1.0
|           |--- include
|               |--- IRT
|               |--- RT_MRP
|           |--- lib
|                |--- am64x
|                     |--- r5f
|                          |--- IRT
|                          |--- RT_MRP
|           |--- projects
|               |--- ccsproject_args
|       |--- snmp
|           |--- drivers
|           |--- include
|   |--- third_party
|       |--- protocols
|           |--- profinet_slave
|               |--- Docs
|               |--- include
|                    |--- IRT
|                    |--- RT_MRP
|               |--- source
|               |--- stack_lib
|                    |--- am64x
|                         |--- r5f
|                              |--- IRT
|                              |--- RT_MRP
|           |--- snmp
|               |--- snmp_core
|                    |--- source
|               |--- source
|               |--- stack_lib
|                    |--- am64x
|                         |--- r5f

Note

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


5.1.5. Generating Project files

5.1.5.1. Steps to generate Project files

  • Setup the environment variables

    • Edit the file [INSTALL-DIR]/protocols/profinet_slave/projects/projectCreate_core_sdk.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.1.1 is installed in default path, set it to “C:\ti\ccs1011\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.
      • 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_core_sdk.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/profinet_slave/projects

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

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

  • [SOC]
    • The valid values for first command line argument [SOC] are
      • AM64x - To generate a project specific to AM64x
  • [PROCESSOR]
    • The valid values for second command line argument [PROCESSOR] are
      • r5f - To generate a project specific to R5F 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 RT MRP application project
      • profinet_slave_IRT_library_mode - to generate project for Profinet slave IRT application in FWHAL library mode
      • profinet_slave_RT_MRP_library_mode - to generate project for Profinet slave RT MRP application in FWHAL library mode
      • profinet_slave_IRT_fwhal_lib - to generate project for Profinet slave IRT FWHAL library
      • profinet_slave_RT_MRP_fwhal_lib - to generate project for Profinet slave RT MRP FWHAL library
      • snmp_core_stack - to generate SNMP stack library project

Note

Ensure that the workspace provided in CCS_WORKSPACE_LOC variable is not open in Code Composer Studio when executing projectCreate_core_sdk.bat or projectCreate_core_sdk.sh. If it is open, the eclipsec may throw errors

  • Usage example 1 : projectCreate_core_sdk.bat AM64x r5f profinet_slave_IRT

    To generate the project files for Profinet slave IRT application for AM64x R5F core

  • Usage example 2 : projectCreate_core_sdk.bat AM64x r5f profinet_slave_RT_MRP

    To generate the project files for Profinet slave RT MRP application for AM64x R5F core

  • Usage example 3 : projectCreate_core_sdk.bat AM64x r5f profinet_slave_RT_MRP_library_mode

    To generate the project files for Profinet slave RT MRP application in FWHAL library mode for AM64x R5F core

  • Usage example 4 : projectCreate_core_sdk.bat AM64x r5f snmp_core_stack

    To generate the project files for SNMP stack for AM64x R5F core

Note

If the project create is successful, the generated project files will be found in [INSTALL-DIR]/protocols/profinet_slave/projects/[PROJECT_NAME]_[SOC]_[PROCESSOR]

Note

Default PRU-ICSSG instance used for Profinet is PRU-ICSSG1. For changing the PRU-ICSSG instance to be used, the PRUICSS_INSTANCE macro needs to be set accordingly in the [INSTALL-DIR]/examples/profinet_slave/pn_soc.h file.

5.1.5.1.1. FWHAL Library Mode Applications

profinet_slave_IRT and profinet_slave_RT_MRP projects include files for application, driver and firmware in the project. In order to remove inclusion of driver and firmware from the project, there is a separate application mode which includes only application files and links a FWHAL library consisting of firmware and driver sources. This FWHAL library is present in [INSTALL-DIR]/protocols/profinet_slave/lib/[SOC]/[PROCESSOR] folder. For creating applications with this mode, profinet_slave_IRT_library_mode or profinet_slave_RT_MRP_library_mode should be used for [PROJECT_NAME] while running projectCreate_core_sdk script. If you want to rebuild the FWHAL library, you can create the project using profinet_slave_IRT_fwhal_lib or profinet_slave_RT_MRP_fwhal_lib for [PROJECT_NAME]. Building it will automatically update the library in [INSTALL-DIR]/protocols/profinet_slave/lib/[SOC]/[PROCESSOR] folder.


5.1.6. Functional Details

Note

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

Note

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

5.1.6.1. PROFINET IRT

This example is a PROFINET I/O IRT Device(slave) application based on Molex 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 Interniche 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.

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.

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 at [INSTALL-DIR]/protocols/profinet_slave/docs/API_Documentation.html.

The application uses TEST_LED1 to show the connection status. The LED is on if the device is connected, off if the device is never connected, and blinking if device is not connected.


5.1.6.2. PROFINET RT/MRP

This example is a PROFINET I/O RT/MRP Device(slave) application based on Molex 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 Interniche 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.

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.

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 at [INSTALL-DIR]/protocols/profinet_slave/docs/API_Documentation.html.

The application uses TEST_LED1 to show the connection status. The LED is on if the device is connected, off if the device is never connected, and blinking if device is not connected.

5.1.6.3. Isochronous Mode Support

Isochronus mode support has been enabled on Profinet Slave 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 generated 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.

5.1.6.4. Building Full Feature SNMP stack

SNMP is provided as a library in the PRU-ICSS Profinet Slave 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 (please contact - https://www.hcc-embedded.com/embedded-snmp/ ) The stack version used is v3.3

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 Interniche 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.

../../../_images/E2e7.jpg

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