Introduction
This example is a PRP (Parallel Redundancy Protocol) Dual Attached Node demo application using LwIP stack.
PRP, like HSR, is a zero downtime industrial redundancy protocol that operate at Layer 2 and uses commercial off-the-shelf Ethernet communication chips and physical media. PRP is mainly used in the substation automation market and the target applications use IEC 61850 protocols. This application does not provide any IEC 61850 integrated examples but it’s easy to integrate one given the transparent nature of PRP implementation.
- The implementation consists of
- Firmware (provided as a binary)
- ENET (Ethernet Driver)
- LwIP TCP/IP networking stack
- HSR-PRP FWHAL
- Application
Steps to Run the Example
Build the example
- When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
- Import CCS project for the required platform from here
{IND_COMMS_SDK}\examples\industrial_comms\prp_1g_demo
- When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
gmake -s -C examples/industrial_comms/prp_1g_demo/am64x-evm/r5fss0-0_freertos/ti-arm-clang
HW Setup
- Note
- Make sure you have setup the EVM with cable connections as shown here, EVM Setup. In addition do below steps.
AM64X-EVM
- Connect an ethernet cable to the EVM from host PC as shown below
Ethernet cable for ICSS based ethernet
Run the example
- Attention
- If you need to reload and run the example again, EVM power-cycle is MUST.
- Launch a CCS debug session and run the example executable, see CCS Launch, Load and Run
- You will see logs in the UART terminal as shown in the next section.
- Note the IP address seen in the log, this is what we will use to communicate with the EVM.
Example Startup
Sample Output
==========================
ENET LWIP App
==========================
Enabling clocks!
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:1 From 4 To 1
Mdio_open:318
Open MAC port 1
EnetPhy_bindDriver:1873
Open MAC port 2
EnetPhy_bindDriver:1873
PHY 3 is alive
PHY 15 is alive
LRE: Initializing lre object
initQs() txFreePktInfoQ initialized with 16 pkts
initQs() Allocating packets for RX queue 0
initQs() rxFreeQ 0 initialized
initQs() Allocating packets for RX queue 1
initQs() rxFreeQ 1 initialized
LRE: Open driver call
LRE: Enable Host Offload
Initializing NodesTable (32 buckets, 8 entries/bucket)...
NodesTable initialized
LRE: Open driver call completed
Starting lwIP, local interface IP is dhcp-enabled
[LWIPIF_LWIP] NETIF INIT SUCCESS
Host MAC address-0 : f4:84:4c:fd:be:9b
[LWIPIF_LWIP] Enet has been started successfully
[0]status_callback==UP, local interface IP is 0.0.0.0
UDP server listening on port 5001
Icssg_handleLinkUp:2723
[0] link_callback==UP
5.194s : CPU load = 2.95 %
IP Configuration
- By default, the example starts off with DHCP enabled. The example can be modified and rebuilt to assign a static IP. Refer to the file at location
examples/industrial_comms/prp_1g_demo/lwipcfg.h, and uncomment following lines as suggested:
/* uncomment the next two lines for Static IP */
//#define USE_DHCP 0
//#define USE_AUTOIP 0
Communicate with the EVM using ethernet
- Firstly you can try to reach the EVM using ping as shown below, using a command shell on the host PC
> ping 192.168.1.200
Below can be observed from wireshark capture of ping test:
- Ping reply packets from the DUT will have PRP trailer inserted with incrementing sequence mumber.
- Packets sent from Port-1 have the Lan-ID field of the PRP trailer as 0xA and for port-2 it's 0xB.
- PRP supervision frames are seen every 2s.
Wireshark capture of PRP supervision frame and PRP trailer tagged ping reply
Troubleshooting issues
- If you see a valid MAC address and address and
link_callback==DOWN is seen then
- check the ethernet cable if it is properly connected
See Also
HSR-PRP FWHAL