STMicroelectronics STM32 MPU User Manual

STM32MP157C-DK2 rev. C01
STEVAL-IDP004V1
sensor nodes
STEVAL-BFA001V1B
IoT Cloud Application
AWS IoT Greengrass
Serial
Interface
WireST
SDK
EdgeST
SDK
PredMnt application
X-LINUX-PREDMNT
DSH-PREDMNT dashboard
Predictive Maintenance
Cloud application
UM2639
User manual
How to use the STM32 MPU OpenSTLinux Expansion Pack for Predictive
Maintenance

Introduction

The STM32 MPU OpenSTLinux Expansion Pack for Predictive Maintenance enables the development of Edge processing applications. It forms an end-to-end solution with corresponding hardware to allow environmental and inertial data from industrial equipment to be sent to an IoT application with dedicated dashboard for data analysis and identification of conditions that might require immediate or future maintenance intervention.
The application helps users manage many of the critical aspects of ef such as registering remote devices, configuring gateways, and connecting to IoT cloud services. In particular, it interfaces with the Amazon AWS IoT cloud and uses the AWS IoT Greengrass Edge Computing service on the gateway to run local logic and transmit data seamlessly, even under conditions of intermittent Internet connectivity.
The development hardware for the application includes a vibration kit with motors, STEVAL-BFA001V1B IO-Link sensor boards with inertial measurement unit, various environmental sensors plus on-board MCU for sensor data computation and management, and the STEVAL-IDP004V1 IO-Link master board. A gateway node is set up with the STM32MP157C-DK2 Discovery board featuring various wired and wireless connectivity solutions, SD card data storage, LCD touch screen interface and appropriate high performance STM32MP1 Series microprocessor.
The edge gateway collects environmental and FFT data from accelerometer sensors, which are then sent via MQTT over Ethernet or Wi-Fi to a dashboard based on the AWS infrastructure.
fective condition monitoring with remote IoT sensor nodes,
Figure 1. Condition monitoring and Edge to Cloud: from sensors to gateway to cloud dashboard
UM2639 - Rev 3 - September 2020
For further information contact your local STMicroelectronics sales of
fice.
www.st.com

1 Edge processing application overview

For the edge processing application setup, you need the following elements:
Gateway node:
STM32MP157C-DK2 Discovery board with a minimum 4GB SD card
Smart sensors and Master hardware:
master board: STEVAL-IDP004V1
sensor boards: STEVAL-BFA001V1B kit
myST.com account for the Edge Processing Application dashboard.
PC with the STM32 ST-LINK Utility and ST-LINK Programmer (standalone or integrated in STM32 Nucleo boards).
Internet connection with no proxy nor firewall.
The figure below shows a demo which integrates all the components required to monitor two motors that can be driven at different speeds. The two motors can be balanced with different weights, and the dashboard shows the time, environmental and frequency data of both, allowing the observer to easily identify which motor is not performing appropriately.
UM2639
Edge processing application overview
Figure 2. Integrated demo with smart sensor nodes installed on two motors
UM2639 - Rev 3
page 2/31
DEPLOY
END
GATEWAY
(2)
GATEWAY
START
VISUALIZE DATA
Gateway
GREENGRASS
START
THE EDGE GATEWAY
INSTALL
EDGE GATEWAY
ASSIGN DEVICES TO
GREENGRASS
CONFIGURE THE
VIBRATION SETUP
STOP
THE APPLICATION
DEACTIVATE
REGISTER
IOT DEVICES
REGISTER AN
CREDENTIALS
Vibration setup Dashboard
DEVICE
(3.2)
PROVISIONING
INSTALL
CREDENTIALS
(3.3)
(4)
DEPLOYMENT
APPLICATION
START
(5)
CONDITION
MONITORING
(6)
STOP
APPLICATION
Legenda
BEGIN
MASTERBOARD
INSTALL
(3) APPLICATION SETUP
FLASH THE
STOP THE
ST SDKS
SENSORS
GREENGRASS
INSTALL
(3.1)
VIBRATION SETUP
SETUP
(1)
SENSORS AND
MASTERBOARD SETUP
APPLICATION
ACTIVATE
FLASH THE
START
GREENGRASS
Edge Processing Application setup and operation

2 Edge Processing Application setup and operation

The flow chart below provides an overview of the procedure involved in setting up and running the application.
Figure 3. Setup and operation
UM2639
UM2639 - Rev 3
page 3/31

2.1 Sensor and master board setup

Follow the procedure below to flash the sensor board and the master board with the latest firmware.
Step 1. Download the binary files for the sensor and master boards from the following locations on the ST
website:
Sensor node: STSW-BFA001V1
Master board: STSW-IDP4PREDMNT
Step 2. Flash the relevant binaries onto the STEVAL-IDP004V1 IO-Link master board and STEVAL-
BFA001V1B IO-Link sensor boards.
Use the STM32 ST-LINK (STSW-LINK004) Utility and an appropriate ST-LINK programmer/debugger device (standalone or integrated in STM32 Nucleo boards).

2.2 Gateway setup

To set up an STM32MP157C-DK2 Discovery kit as the Edge gateway for your Predictive Maintenance Platform, you can either:
Flash a pre-configured image by ST:
X-LINUX-PREDMNT
Create and flash a custom image
UM2639
Sensor and master board setup
Figure 4. STM32MP157C-DK2 Discovery kit
STM32 MPU with dual-core Cortex-A7 CPU, 533 MHz GPU and Cortex-M4 MCU Secure Boot and cryptography, LCD, Wi-Fi, Bluetooth Low Energy
Important: Set the micro-switches to OFF before flashing and to ON just after.
RELATED LINKS
You can use this free tool to master your binary images onto an SD card
isit the STM32 MPU wiki page for relevant guides and resources regarding the STM32 MPU
V
UM2639 - Rev 3
page 4/31

2.2.1 How to create an image for the STM32MP1 Discovery kit

Follow the instructions below to configure an STM32MP157C-DK2 Discovery kit as a Linux gateway
Note: The instructions apply to the STM32MP1 DK2 C01 and C2 releases only.
Step 1. Set up your host environment according to the PC prerequisites page at the STM32 MPU wiki page:
https://wiki.st.com/stm32mpu/wiki/PC_prerequisites
Step 2. If this is the first use of the Discovery board, install the Starter Package and flash the image to an
empty SD card so that all the partitions are created:
https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package
Important: Set the micro-switches to OFF before flashing and to ON just after.
Step 3. Get the distribution package as described in the following wiki page:
https://wiki.st.com/stm32mpu/wiki/STM32MP1_Distribution_Package
Step 4. Follow the instructions up to and including the command to build the image:
bitbake st-image-weston
The image file is included in the distribution package.
UM2639
Gateway setup
.
Step 5. Move to the <layers> directory and install the meta-predmnt layer
, available here:
https://github.com/STMicroelectronics/meta-predmnt
This layer contains the recipes to install the Predictive Maintenance application, the Amazon AWS IoT Greengrass service for edge computing (https://aws.amazon.com/it/greengrass/), and other required Python packages (view meta-predmnt/conf/layer.conf file for further details):
cd <path-to>/openstlinux-<version>/layers
git clone https://github.com/STMicroelectronics/meta-predmnt
cd <path-to>/openstlinux-<version>/build-openstlinuxweston-stm32mp1/conf/
Step 6. Copy and paste the following line into the bblayers.conf file, just before the BBLA
definition, and check that the BBLAYERS token contains the FRAMEWORKLAYERS token, otherwise add it:
FRAMEWORKLAYERS += "${@'${OEROOT}/layers/meta-predmnt' if os.path.isfile('${OEROOT}/ layers/meta-predmnt/conf/layer.conf') else ''}"
YERS token
UM2639 - Rev 3
page 5/31
UM2639
Gateway setup
Step 7. Move to the <openstlinux> directory
cd <path-to>/openstlinux-<version>
bitbake virtual/kernel -c menuconfig
Step 7a. Navigate to [Device Drivers] and to [USB support].
Step 7b. Place a check on the following entry by pressing the
character appears and then press enter:
USB Serial Converter support
Step 7c. Place a check on the following entries by pressing the
character appears and then press enter:
USB Serial Console device support
USB Generic Serial Driver
USB Serial Simple Driver
USB FTDI Single Port Serial Driver
Step 7d. Save and exit:
, enable the USB support in the kernel, and build:
[Space] key until an asterix (*)
[Space] key until an asterix (*)
bitbake virtual/kernel
Step 8. Move to the <openstlinux> directory
, and build the image (same instructions described in the
Distribution Package page):
cd <path-to>/openstlinux-<version>
DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh
bitbake st-image-weston
Step 9. Move to the <image> directory
, and flash the image (same instructions described in the Starter
Package page):
Important: Set the micro-switches to OFF before flashing and to ON just after.
cd <path-to>/openstlinux-<version>/build-openstlinuxweston-stm32mp1/tmp-glibc/ deploy/images/stm32mp1
STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/ FlashLayout_sdcard_stm32mp157c-dk2-trusted.tsv
UM2639 - Rev 3
page 6/31

2.2.2 How to configure the gateway

Important: Set the micro-switches to ON before turning the gateway on.
UM2639
Gateway setup
Step 1. Turn the gateway ON and wait for the Main GUI to appear
Figure 5. Gateway Main GUI
The Main GUI can also be started via the following command:
/home/root/start_pmp.sh --gui
.
Step 2. Complete the gateway setup by clicking on the [SETUP GATEWAY] button .
The following panel appears to allow you configure and connect the gateway to a Wi-Fi network or to the Internet through an Ethernet cable.
Figure 6. Gateway GUI setup
UM2639 - Rev 3
page 7/31
Step 3. Click on the [Update] button to install or update the following libraries:
Amazon AWS IoT Python SDK: https://github.com/aws/aws-iot-device-sdk-python
WireSTSDK: https://github.com/STMicroelectronics/WireSTSDK_Python
EdgeSTSDK: https://github.com/STMicroelectronics/EdgeSTSDK_Python
Other Python packages (pyserial, futures, enum34)

2.2.3 How to connect to the gateway via SSH

Once the gateway is connected to a network:
Step 1. Retrieve its IP address from a terminal on the gateway with the command below:
ifconfig
Step 2. Connect to the gateway from another device via SSH by running the following command (you have to
use “root” for the user on the “openstlinux” distribution):
ssh <user>@<IP-ADDRESS>

2.2.4 How to reboot and turn the gateway off

Step 1. T
o reboot the gateway, run the following command as super user:
UM2639
Gateway setup
Step 2. T
reboot
o safely turn the gateway off, run the following command as super user:
shutdown 0
UM2639 - Rev 3
page 8/31

2.3 Application setup

UM2639
Application setup
From the Main GUI, click on the [SETUP APPLICA procedure.
Figure 7. GUI application setup
TION] button (see Figure 5) to start the guided configuration
Step 1. Log in to the dashboard.
Step 2. Configure your devices and copy the *.zip credentials to a USB key
Step 3. Configure your edge gateway and copy the *.zip credentials to the USB key.
Step 4. Assign the devices to the edge gateway.
Step 5. Plug the USB key into the gateway and install the credentials.
Step 6. Deploy the solution from the dashboard to the gateway.
.
UM2639 - Rev 3
page 9/31

2.3.1 Log in to the dashboard

Important: You need a valid myST.com account to launch the dashboard and register devices.
UM2639
Application setup
Step 1. Open the dashboard and log in with myST
https://dsh-predmnt.st.com/

2.3.2 How to configure devices

Step 1. Click on [Register a new device] and then on [DEVICES] panel.
Step 2. Click [Add Device] and register two devices with an appropriate name and optional information.
.com credentials:
Figure 8. Predictive Maintenance Platform main screen
Figure 9. Add Device page
UM2639 - Rev 3
page 10/31
Loading...
+ 21 hidden pages