Boosting the Power Industry: Notes on Porting the IEC61850 Protocol to the MYD-YF13X
2024-05-22
805
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 MYIR’s 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:
http://libiec61850.com/libiec61850/
Know more about the MYD-YF13X development board at:
https://en.myir.cn/d/STM32MP135/65.html
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/
lto-wrapper
...
...
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
# make TARGET=LINUX-ARM
...
...
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 examplesmyir_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
-I/WORKIR>/arm-myir-linux-gnueabihf-gcc/usr/rm-myir-linux-gnueabihf/sysroot/usr/include/libxml2
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
# make TARGET=LINUX-ARM
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
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-c0AGn2s5XN,guid=d6544df82962d617c2dc37805c2c2d68
DBUS_SESSION_BUS_PID=5649
# 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 192.168.x.xxx 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.
Top-view of MYD-YF13X Development Board
Bottom-view of MYD-YF13X Development Board
2024-09-23
Ethernet Driver Porting Guide Based on MYIR's NXP i.MX.93 Development Board
Ethernet Driver Porting Guide Based on MYIR's NXP i.MX.93 Development Board MYD-LMX9X
2024-08-16
QT Development Guide for NXP i.MX 93 Development Board by MYIR
1. OverviewQt is a cross-platform graphical application development framework that is applied to devices and platforms of different sizes, while providing different license versions for users to choos
2024-06-16
Application Notes | Setting up OTA Functionality on MYIR's NXP i.MX 93 Development Board
1. OverviewOver-the-Air Technology (OTA) is a technology that enables remote management of mobile terminal equipment and SIM card data via the air interface of mobile communication. In this article, O
2024-06-13
Ubuntu System Porting Guide for Renesas RZ/G2L-based Remi Pi
1. OverviewLinux system platform has a variety of open source system building frameworks, which facilitate the developer in building and customizing embedded systems. Currently, some of the more commo
2023-12-07
Developing AIGC using DNN through MYIR's Renesas RZ/G2L based Board
This evaluation report is provided by developer "ALSET" from MYIR’s forum. This article will introduce how to develop AIGC image using Deep Neural Networks (DNN) through MYIR’s Renesas RZ/G2
2023-10-31
How to Select MYIR's STM32MP1 based SOMs?
Choosing a suitable processor is a difficult problem that every engineer may face in the early stage of development. How do you choose a processor that fits into product development? Today, we will an
2023-10-18
Bring up the STM32MP135x - ST Training Course based on MYD-YF13X (Ⅲ)
This article will take MYIR’s MYD-YF13X and STM32MP135F-DK as examples, and continue to explain how to use STM32CubeMX combined with the developer package to implement the booting of the minimal syste
2023-09-26
Bring up the STM32MP135x - ST Training Course based on MYD-YF13X (II)
This article will take MYIR’s MYD-YF13X and STM32MP135F-DK as examples, and continue to explain how to use STM32CubeMX combined with the developer package to implement the booting of the minimal syste
2023-09-21
Take Great Advantages of SemiDrive's Super Powerful D9-Pro Processor
MYIR has launched the MYC-JD9360 System-On-Module and MYD-JD9360 development board based on SemiDrive’s D9-Pro processor in August. The D9-Pro is a super powerful MPU with six Arm Cortex-A55 cores (up