Skip to content

Commit 65f6a41

Browse files
committed
Multiport linux support
- See doc/multiple_ports.rst for information on how to configure and run a mulitport configuration - Verified on Raspberry Pi with additional USB ethernet interfaces
1 parent a6e54ac commit 65f6a41

26 files changed

+735
-321
lines changed

doc/multiple_ports.rst

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Multiple ports
22
==============
33
This section describes how to configure the p-net stack, sample application
44
and system for multiple network interfaces or ports.
5+
So far, multiple port has only been tested using the linux port.
56

67

78
Terminology
@@ -92,12 +93,40 @@ Run ``ifconfig`` to check that the bridge is up and its network interfaces are a
9293
TX packets 0 bytes 0 (0.0 B)
9394
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
9495

95-
Configuration of p-net stack and sample application (TBD)
96+
Configuration of p-net stack and sample application
9697
---------------------------------------------------------
9798
To run p-net and the sample application with multiple ports a couple
9899
of things need to be done:
99100

100-
* Reconfigure setting ``PNET_MAX_PORT`` to the actual number of physical ports available in the system.
101-
For this example ``PNET_MAX_PORT`` shall be set to 2.
102-
103-
* TBD - update this document when multiport support is implemented
101+
Reconfigure setting ``PNET_MAX_PORT`` to the actual number of physical ports available in the system.
102+
For this example ``PNET_MAX_PORT`` shall be set to 2.
103+
104+
Example of initial log when starting the demo application with a multi port configuration::
105+
106+
pi@pndevice-pi:~/profinet/build $ sudo ./pn_dev -v
107+
** Starting Profinet demo application **
108+
Number of slots: 5 (incl slot for DAP module)
109+
P-net log level: 0 (DEBUG=0, FATAL=4)
110+
App verbosity level: 1
111+
Nbr of ports: 2
112+
Network interfaces: br0,eth0,eth1
113+
Button1 file:
114+
Button2 file:
115+
Station name: rt-labs-dev
116+
Management port: br0 C2:38:F3:A6:0A:66
117+
Physical port [1]: eth0 B8:27:EB:67:14:8A
118+
Physical port [2]: eth1 58:EF:68:B5:11:0F
119+
Current hostname: pndevice-pi
120+
Current IP address: 192.168.0.50
121+
Current Netmask: 255.255.255.0
122+
Current Gateway: 192.168.0.1
123+
Storage directory: /home/pi/profinet/build
124+
125+
Update gsdml file
126+
-----------------
127+
The sample app gsdml file contains a commented out block that defines
128+
a second physical port. In the sample application gsdml file, search for "IDS_P2"
129+
and enable commented out lines as described in the gsdml file.
130+
131+
Note that you will have to the reload gsdml file in all tools you are using and
132+
also the Automated RT tester any time the file is changed.

sample_app/GSDML-V2.4-rtlabs-IODevice-20201211.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
<MAUTypeItem Value="16"/>
6060
</MAUTypeList>
6161
</PortSubmoduleItem>
62+
<!-- Enable to support additional port. (PNET_MAX_PORT == 2) -->
63+
<!-- Add additional PortSubmoduleItems to support additional ports -->
64+
<!--
65+
<PortSubmoduleItem ID="IDS_P2" SubmoduleIdentNumber="0x00008002" SubslotNumber="32770" TextId="IDT_NAME_PS2" MaxPortRxDelay="350" MaxPortTxDelay="160">
66+
<MAUTypeList>
67+
<MAUTypeItem Value="16"/>
68+
</MAUTypeList>
69+
</PortSubmoduleItem>
70+
-->
6271
</SystemDefinedSubmoduleList>
6372
</DeviceAccessPointItem>
6473
</DeviceAccessPointList>
@@ -195,6 +204,7 @@
195204
<Text TextId="IDT_CUSTOM_LOGBOOK_1" Value="Custom Logbook entry"/>
196205
<Text TextId="IDT_NAME_IS" Value="I"/>
197206
<Text TextId="IDT_NAME_PS1" Value="P1"/>
207+
<Text TextId="IDT_NAME_PS2" Value="P2"/>
198208
<!--module name-->
199209
<Text TextId="TOK_TextId_Module_I8" Value="8 bits I"/>
200210
<Text TextId="TOK_TextId_Module_O8" Value="8 bits O"/>

0 commit comments

Comments
 (0)