AM243x INDUSTRIAL COMMUNICATIONS SDK  11.00.00
HSR 1G

Introduction

This example is an HSR (High Availability Seamless Redundancy) Dual Attached Node demo application using LwIP stack.

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. HSR has a header attached to it that makes it incompatible with standard switches and routers. HSR 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 HSR implementation.

Steps to Run the Example

Patch the ENET Ethernet Driver

Note
Follow the below steps to update enet driver before building the HSR example.
  • By default ICSDK installation path (IND_COMMS_SDK) will be /c/ti/ind_comms_sdk_$SOC_$VERSION_NUM
  • Move inside ENET directory: cd IND_COMMS_SDK/mcu_plus_sdk/source/networking/enet/core
  • Apply enet patch: git apply IND_COMMS_SDK/source/industrial_comms/hsr_prp_1g/patch/enet_lre.patch
  • Move inside MCU-SDK installation directory: cd IND_COMMS_SDK/mcu_plus_sdk
  • Rebuild enet lib:

    gmake -s -f makefile.am243x enet-icssg_r5f.ti-arm-clang PROFILE=release gmake -s -f makefile.am243x enet-icssg_r5f.ti-arm-clang PROFILE=debug

Build the example

  • Make sure the enet driver is patched and rebuilt as specified above before building the HSR 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).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)

HW Setup

Note
Make sure you have setup the EVM with cable connections as shown here, EVM Setup. In addition do below steps.

AM243X-EVM

  • Connect an ethernet cable to the EVM from host PC as shown below

Ethernet cable for ICSS based ethernet

AM243X-LP

Note
AM243X-LP has two ethernet Ports which can be configured as both CPSW/ICSS ports.
  • Connect a ethernet cable to the AM243X-LP 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
Icssg_ioctl_handler_ICSSG_ENABLE_PROTOCOL_SPECIFIC_TAG_IOCTL:5055
LRE: ERROR: Error enabling Host Offload
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/hsr_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.10
    

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 (High-availability seamless Redundancy/Parallel Redundancy Protocol) 1G Driver