Trade Shows
Product Updates
          Home > News Center > Product Updates

Boosting the Power Industry: Notes on Porting the IEC61850 Protocol to the MYD-YF13X

2024-5-22   17:15:38     Click: 258

Part 1: Overview

IEC 61850 is an international standard for communication systems in Substation Automation Systems (SAS) and management of Decentralized Energy Resources (DER). Through the implementation of standards, it achieves standardized engineering operations for smart substations. This makes the engineering implementation of smart substations standardized, unified, and transparent, and it is widely used in power and energy storage systems.

This article is based on MYIRs MYD-YF13X STM32MP135 development board, porting and using the open-source libIEC61850 library on the Linux system. The project libIEC61850 provides server and client library for the IEC 61850/MMS, IEC 61850/GOOSE and IEC 61850-9-2/Sampled Values communication protocols written in C.

Know more about IEC61850 at:

Know more about the MYD-YF13X development board at:

Part 2: Build Configuration Environment

This chapter describes the process of configuring the compilation environment for the libIEC61850 library.

2.1. Installing the JAVA Environment

The ICD files in the IEC61850 library require a JAVA tool for conversion. Therefore, it is necessary to install the JAVA runtime environment first. The JDK installation package provided by MYIR is located in the "03-Tools" directory. Copy "jdk-8u191-linux-x64.tar.gz" to the Ubuntu working directory and unzip it.

# cd/JDK

# tar zxvf jdk-8u191-linux-x64.tar.gz

# cd jdk1.8.0_191

To configure the JAVA environment variables, modify the/etc/profile file, and add the following content inside, withrepresenting the user's working directory.

# vi /etc/profile

export JAVA_HOME=/JDK/jdk1.8.0_191

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export PATH=${JAVA_HOME}/bin:$PATH

After completing the modifications, save and exit. Use the following command to verify if the JAVA runtime environment is successfully installed:

# java -version

java version "1.8.0_191"

Java(TM) SE Runtime Environment (build 1.8.0_191-b12)

Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

2.2 Configure Cross Compilation Toolchain

Here, we directly use the cross compilation toolchain created by MYIR. Copy to the working directory of ubuntu from CD 04 Linux_source \ Toolchain \ arm myir linux-gnueabihf gcc.tar.gz. Set the cross compilation toolchain environment variables by following the steps below.

# mkdir arm-myir-linux-gnueabihf-gcc

# tar xvf arm-myir-linux-gnueabihf-gcc.tar.gz -C arm-myir-linux-gnueabihf-gcc # export ARCH=arm

# export CROSS_COMPILE=arm-myir-linux-gnueabihf-

# export PATH=$PATH://arm-myir-linux-gnueabihf-gcc/usr/bin

After setting up, use the following command to verify if the setting is successful.

# arm-myir-linux-gnueabihf-gcc -v

Using built-in specs

COLLECT_GCC=/home/qinlh/buildroot/buildroot-2019.02.2/output/host/bin/arm-myir-linux-gnueabihf-gcc.br_real COLLECT_LTO_WRAPPER=/home/qinlh/buildroot/buildroot-2019.02.2/output/host/libexec/gcc/arm-myir-linux-gnueabihf/7.4.0/




Theading Model: posix gcc

Version 7.4.0 (Buildroot 2019.02.2-g04eff54)

Part 3: Compile IEC61850 Library

This part describes the compilation process of the IEC61850 library and the MYIR IEC61850 demonstration program "myir_iec61850_server".

3.1 Obtain IEC61850 Source Code Package

MYIR provides the libIEC61850 source code in the directory /04 Linux_Source/IEC61850. You can copy the libiec61850-1.3.0.tar.gz file to your working directory in Ubuntu and extract it. Replacewith your actual user working directory.

# cp libiec61850-1.3.0.tar.gz/libiec61850

# cd/libiec61850

# tar zxvf libiec61850-1.3.0.tar.gz

# cd libiec61850-1.3.0

Compile the IEC61850 library




arm-myir-linux-gnueabihf-ar: creating ./build-arm/libiec61850.a

arm-myir-linux-gnueabihf-ranlib ./build-arm/libiec61850.a

The MYIR-IEC61850 demo program uses some external libraries, and it is necessary to modify the Makefile located in the
examples\myir_iec61850_server\ directory to specify the paths of the external libraries. You should replace `` with the actual working path of the user:

CFLAGS +=-I./ \

-I/WORKIR>/arm-myir-linux-gnueabihf-gcc/usr/arm-myir-linux-gnueabihf/sysroot/usr/include/glib-2.0/ \

-I/WORKIR>/arm-myir-linux-gnueabihf-gcc/usr/arm-myir-linux-gnueabihf/sysroot/usr/lib/glib-2.0/include/ \

-I/WORKIR>/arm-myir-linux-gnueabihf-gcc/usr/arm-myir-linux-gnueabihf/sysroot/usr/include/cjson/ \

-I/WORKIR>/arm-myir-linux-gnueabihf-gcc/usr/arm-myir-linux-gnueabihf/sysroot/usr/include \


LDFLAGS += -lpthread -ldbus-1 -lxml2 -lcjson \

-L /WORKIR>/arm-myir-linux-gnueabihf-gcc/usr/arm-myir-linux-gnueabihf/sysroot/usr/lib

If the above compilation process reports errors, please check if there are any issues with the cross compilation toolchain settings.

Compile ICD file:

# cd examples/myir_iec61850_server

# make model

java -jar ../../tools/model_generator/genmodel.jar myir_iec61850_server.icd

Select ICD File myir_iec61850_server.icd

parse data type templates ...

parse IED section ...

parse communication section ...

Found connectedAP ap1 for IED MYIR1

print report instance 01

print report instance 02

If the above process reports an error, please check if the JAVA runtime environment has been successfully set up.

Compile MYIR IEC61850 demo program:

# cd examples/myir_iec61850_server


Part 4: Run and Verify the IEC61850 Applications

4.1 Running Applications

After compilation, the MYIR IEC61850 application is located in the directory of examples/myir_iec61850_server. Copy myir_iec61850_server to the development board, and the running process is as follows.

# dbus-launch



# export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-c0AGn2s5XN

# ./myir_iec61850_server

# Using libIEC61850 version 1.3.0

4.2 Program Verification

The installation package can be obtained in the directory 03-Tools/IEDSScout. zip.

Test verification:

Enter the IEC61850 application interface and open the IEDScout software on PC.

Click the Discover IED button under the IECScout interface, then enter the IP address of the development board network port, and click the Discover button after input.

Upon entering the Browser page, you can see the IED device model named MYIR1.

Click on Data Models ->LD1->GGIO1 under the IED device model to enter the general I/O control interface.

Double click on the LED1 data object under GGIO1 to see the Switch data property, and then click the Write button on the menu bar above to control LED1.

Select false in the Value column, then click the Write button. At this time, the LED heartbeat light on the development board will be lit, indicating successful communication.

MYIR’s MYD-YF13X Development Board based on STM32MP135

The MYD-YF13X development board provided by MYIR is based on STM32MP135 Arm Cortex-A7 processor. It adopts a 12V/2A DC power supply and features two Gigabit Ethernet interfaces, a 4G module interface with a USB2.0 protocol MINI PCIE socket, an RGB display interface, an audio input/output interface, two USB HOST Type A ports, a USB OTG Type-C port, and a Micro SD card slot. The development board comes with abundant software resources and documentation to help developers succeed in their projects.

MYD-YF13X Development Board Top-view

MYD-YF13X Development Board Bottom-view

Prev:  MYIR Introduces New SOM Featuring AMD/Xilinx Artix-7 XC7A100T FPGA Next:  MYIR Launches i.MX 93 based SOM for Industrial Applications