P-Net Profinet Device Stack

repository·public·Indexed 20 days ago

https://github.com/rtlabs-com/p-net

A portable Profinet device stack written in C for embedded systems, supporting Linux, RTOS, and bare-metal environments. It supports Profinet v2.43 (Conformance Class A and B, Real Time Class 1) and includes features such as TCP/IP, LLDP, SNMP, and process IO data exchange. Designed for resource-constrained hardware, it requires the ability to send and receive raw Ethernet Layer 2 frames.

Tokens
642
Snippets
1
Records
4
Agent score
20%

What's inside P-Net

  1. Overview of P-Net Profinet device stack

    public

    P-Net is a Profinet device stack designed for embedded systems. It is written in C and is highly portable, supporting Linux, RTOS, or bare-metal environments. It is optimized for resource-constrained systems where efficiency is critical. While the stack is written in C, application development can also be done using any version of C++.

    Key Capabilities:

    • Profinet v2.43 Support: Includes Conformance Class A and B, and Real Time Class 1.
    • Hardware Support: Supports multiple Ethernet ports (currently Linux only) and shared device functionality (connection to multiple controllers).
    • Features: Includes TCP/IP, LLDP, SNMP, Address resolution, Parameterization, Process IO data exchange, and Alarm handling.
  2. Clone P-Net with submodules

    public

    To ensure all necessary components and dependencies are included, you must clone the repository using the --recurse-submodules flag. This is required because some platform-dependent parts are located in external repositories like osal and cmake-tools which are managed as submodules.

    git clone --recurse-submodules https://github.com/rtlabs-com/p-net.git
  3. System requirements for P-Net

    public

    The primary hardware requirement is that the platform must be able to send and receive raw Ethernet Layer 2 frames. The Ethernet driver must be capable of handling full-size frames and should ideally avoid data copying to maintain performance.

    Build Requirements:

    • cmake 3.14 or later

    Platform Specifics:

    • Linux: Requires gcc 4.6 or later. Refer to the documentation for improving Linux timing for real-time properties.
    • rt-kernel: Requires Workbench 2020.1 or later.

    Note on SNMP: For Conformance Class B, an SNMP implementation is required. On Linux, net-snmp is used.

  4. P-Net limitations and unsupported features

    public

    Before implementing, be aware of the following limitations in the current stack:

    • Role: This is a device stack only. It does not support the IO-controller/master/PLC side.
    • Redundancy & Sync: No media redundancy (MRP) support and no time synchronization support.
    • Network Protocols: No support for DHCP, RT_CLASS_UDP, or MC multicast device-to-device.
    • Connection Types: Supports only full connections; does not support the limited "DeviceAccess" connection type or shared inputs.
    • Profiles & Servers: No support for ProfiDrive, ProfiSafe, or iPar (parameter server).
    • Startup & Alarms: Legacy startup mode is not fully implemented, and there is no fast start-up support. Alarms use the default mechanism and do not support UDP frames.