AM263Px INDUSTRIAL COMMUNICATIONS SDK  2026.00.00
IO-Link Master FWHAL

Introduction

This software is designed for TI SoCs with PRU-ICSS IP to enable IO-Link Master functionality. The FWHAL (Firmware Hardware Abstraction Layer) provides an interface between the IO-Link Master stack and the PRU-ICSS firmware.

The FWHAL module handles:

  • PRU firmware loading and initialization
  • Port mode configuration
  • Data transfer operations
  • Cycle timer management
  • Wake-up sequence handling
Software Architecture

PRU-ICSS IO-Link Master Firmware

Features Supported

  • 8-port IO-Link Master support
  • IO-Link communication modes:
    • COM1 (4.8 kbaud)
    • COM2 (38.4 kbaud)
    • COM3 (230.4 kbaud)
  • SIO (Standard I/O) modes:
    • SIO Inactive
    • SIO Digital Input (DI)
    • SIO Digital Output (DO)
  • Cycle timer with configurable period
  • Wake-up sequence generation
  • Transfer status reporting (parity, framing, overrun errors)
  • Firmware supports the following clock configurations (set via SysConfig):
    • Configuration 1:
      • PRU-ICSS Core Clock Frequency: 200 MHz
      • IEP Clock Frequency: 200 MHz
    • Configuration 2:
      • PRU-ICSS Core Clock Frequency: 225 MHz
      • IEP Clock Frequency: 250 MHz

Important Files and Directory Structure

Folder/Files Description
${SDK_INSTALL_PATH}/examples/industrial_comms
iolink_master_demo IO-Link Master Example Application
${SDK_INSTALL_PATH}/source/industrial_comms/iolink
icss_fwhal/firmware Firmware binaries for the PRU cores in PRU-ICSS
icss_fwhal/lib/ FWHAL library for IO-Link Master
icss_fwhal/iolfw.h FWHAL public API header
icss_fwhal/iolfw.c FWHAL implementation
icss_fwhal/iolfw_internal.h FWHAL internal definitions
stack IO-Link Master stack header files and library

Terms and Abbreviations

Abbreviation Expansion
PRU-ICSS Programmable Real-Time Unit Industrial Communication Subsystem
FWHAL Firmware Hardware Abstraction Layer
SDCI Single-drop Digital Communication Interface (IO-Link mode)
SIO Standard Input/Output (legacy digital I/O mode)
COM1 IO-Link baud rate 4.8 kbaud
COM2 IO-Link baud rate 38.4 kbaud
COM3 IO-Link baud rate 230.4 kbaud
T_A Time for device response (max response time)
IEP Industrial Ethernet Peripheral (timer unit in PRU-ICSS)

API Documentation

Please see IO-Link FWHAL for API documentation. It is recommended to use these FWHAL APIs in the stack porting layer.

Using the IO-Link Master FWHAL

The FWHAL provides a hardware abstraction layer that allows third-party IO-Link Master stacks to interface with TI PRU-ICSS hardware. This section describes the initialization sequence and key APIs for integrating any IO-Link Master stack with the FWHAL.

Initialization Sequence

  1. Register callback functions (must be done before IOLFW_init()):

    Each registration API requires a function pointer that FWHAL will call when the corresponding event occurs:

    • IOLFW_registerSetModeCallback(func) - Register a function that FWHAL calls to notify the application when a port mode change is required. The registered function should perform the actual hardware configuration (GPIO settings, transceiver mode, etc.) for the requested mode.
    • IOLFW_registerGetPortCfgCallback(func) - Register a function that FWHAL calls to retrieve port hardware configuration. The registered function must return the GPIO pin assignments for TX, RX, TxEn, and PwrEn signals for the specified port.
    • IOLFW_registerRxErrEventCallback(func) - Register a function that will be called by FWHAL when receive errors occur on a port (e.g., response received without a request).
    • IOLFW_registerTransferIndCallback(func) - Register a function that will be called by FWHAL when an IO-Link transfer (TX/RX) completes. The registered function receives transfer status and received data.
    • IOLFW_registerStartupCmplCallback(func) - Register a function that will be called by FWHAL when the wake-up sequence completes on a port. The registered function receives wake-up status (success/no response).
  2. Initialize the FWHAL using IOLFW_init():
    • Internally opens the PRU-ICSS subsystem via PRUICSS_open()
    • Loads PRU firmware for both cores (PRU0/PRU1 for frame handler and cycle timer)
    • Configures interrupt handlers for transfer completion and wake-up events
    • Sets up PRU memory maps for control and data transfer
  3. Configure ports using IOLFW_setPortMode():
    • Set each port to desired mode: IOLFW_ePortMode_Sdci (IO-Link), IOLFW_ePortMode_SioInactive, etc.
  4. Initiate communication using IOLFW_wakeUp():
    • Starts IO-Link wake-up sequence for a port
    • Wake-up completion is signaled via the registered startup completion callback
  5. Configure cycle timer for each active port (after wake-up completes):
    • Call IOLFW_configCycleTime(pInstance, port, timeUs) to set the periodic cycle time for IO-Link transfers. The cycle timer triggers data exchange at the specified interval (e.g., 2000 microseconds for a 2ms cycle).
    • Optionally call IOLFW_setMaxRespTime(pInstance, port, taRespTime) to configure the maximum response timeout (T_A). This value is specified in TBIT units (bit times) and defines how long the master waits for a device response. If not set explicitly, a default value is used. Typically, T_A is calculated based on cycle time, message sequence time, and the current baud rate.
  6. Handle ongoing operations:
    • Process registered callbacks for transfers, errors, and events
    • Use IOLFW_transferPrepare() to queue TX data before each transfer
    • Receive data and status via transfer completion callback

Cycle Timer Configuration

The IOLFW_configCycleTime(pInstance, port, timeUs) API is the primary interface for configuring the cycle timer. It automatically manages timer state and provides a simplified interface:

Parameters:

  • pInstance - FWHAL instance handle
  • port - Port number (0-7)
  • timeUs - Cycle time in microseconds (0 to disable)

Internal behavior:

This single API eliminates the need to manually track timer state or call multiple configuration functions.

Interrupts

IO-Link firmware generates the following interrupts:

Name Host Interrupt Callback Registration Description
Wake-up Complete PRU_EVTOUT0 IOLFW_registerStartupCmplCallback() Notifies host when wake-up sequence completes on a port
Transfer Complete PRU_EVTOUT1 IOLFW_registerTransferIndCallback() Notifies host when an IO-Link transfer (TX/RX) completes

See also