ST STM32Cube Quick Start Manual

Specifications

Brand: ST
Category: Computer Hardware
Model: STM32Cube (Quick Start Manual)
File Type: PDF
File Size: —
Pages: 40

Read Online

Read the ST STM32Cube Quick Start Manual online using the built-in PDF viewer.

Text of the manual

Quick Start Guide

STM32Cube function pack for STEVAL- STWINKT1B evaluation kit for predictive maintenance application based on artificial intelligence (AI) (FP-AI-PREDMNT2) Version 1.0 (Oct 15, 2021)

Hardware and Software overview

3 Documents & Related Resources 4 STM32 Open Development Environment: Overview 2 2 Setup & Demo Examples

STWIN development kit - STEVAL-STWINKT1B

Hardware Overview STWIN - SensorTile Wireless Industrial Node The STWIN (STEVAL-STWINKT1B) is a development kit and reference design that simplifies prototyping and testing of advanced industrial IoT applications such as condition monitoring and predictive maintenance. The kit supports BLE wireless connectivity through an on-board module and Wi-Fi connectivity through a special plugin expansion board (STEVAL-STWINWFV1), wired RS485 and USB OTG connectivity. Key Features • Multi-sensing wireless platform implementing vibration monitoring and ultrasound detection • Updated version of STEVAL-STWINKT1, now including STSAFE-A110 populated, BlueNRG-M2S module and IMP23ABSU MEMS microphone • Ultra-low-power ARM Cortex-M4 MCU at 120 MHz with FPU, 2048 kbytes Flash memory (STM32L4R9) • Micro SD Card slot for standalone data logging applications • Option to implement Authentication and Brand protection secure solution with STSAFE-A110 • Wide range of industrial IoT sensors: ultra-wide bandwidth (up to 6 kHz), low-noise, 3-axis digital vibration sensor (IIS3DWB), 3D accelerometer + 3D Gyro iNEMO inertial measurement unit (ISM330DHCX) with machine learning core, ultra-low-power high performance MEMS motion sensor (IIS2DH), ultra-low-power 3-axis magnetometer (IIS2MDC), digital absolute pressure sensor (LPS22HH), relative humidity and temperature sensor (HTS221), low-voltage digital local temperature sensor (STTS751), industrial grade digital MEMS microphone (IMP34DT05), analog MEMS microphone with frequency response up to 80 kHz (IMP23ABSU) • Modular architecture, expandable via on-board connectors: STMOD+ and 40-pin flex general purpose expansions, 12-pin male plug for connectivity expansions, 12-pin female plug for sensing expansions • Other kit components: Li-Po battery 480 mAh, STLINK-V3MINI debugger with programming cable, Plastic box Latest info available at www.st.com/stwin

STWIN development kit - STEVAL-STWINWFV1

Hardware Overview Wi-Fi expansion for the SensorTile Wireless Industrial Node (STWIN) kit The STEVAL-STWINWFV1 expansion board adds 2.4 GHz Wi-Fi connectivity to the STEVAL-STWINKT1B. Application examples that take advantage of this expansion board can be found also in STSW-STWINKT01 firmware package as well as in the FP-IND-PREDMNT1 and FP-AI-PREDMNT2 Predictive Maintenance Function Pack. Key Features • Wi-Fi adapter for STEVAL-STWINKT1B • Plugs into STWIN core system board through dedicated 12-pin connector • Single 3.3 V power supply input • ISM43362-M3G-L44-E Wi-Fi module: • 802.11 b/g/n Compatible based on Broadcom MAC/Baseband/Radio device • Fully contained TCP/IP stack • Host interface: SPI up to 25 MHz • Network features ICMP ( Ping), ARP, DHCP,TCP, UDP • Low power operation (3.3 V supply) with built-in low power modes • Secure Wi-Fi authentication WEP-128, WPA-PSK (TKIP), WPA2-PSK • CE, FCC and IC certified • RoHS and China RoHS compliant • WEEE compliant Latest info available at www.st.com STEVAL-STWINWFV1

FP-AI-PREDMNT2 Software Description

FP-AI-PREDMNT2 is an STM32Cube function pack that programs the STWIN as an IoT Edge node, connected to the cloud, able to acquire sensor data, process them and send the results to the DSH-PREDMNT cloud dashboard. It includes dedicated algorithms for advanced time and frequency domain signal processing and analysis of 3D digital accelerometers with flat bandwidth up to 6 kHz. Key features • Compatible with NanoEdge™ AI Studio solution from Cartesiam, to enable AI- based solution (NanoEdge™ AI library generation is out of the scope of this function pack and must be generated using NanoEdge™ AI Studio) • Generic FFT library middleware to enable frequency domain analysis for any kind of sensor through Fast Fourier Transform (with programmable size, overlapping and windowing) • Motion TD library middleware for vibration analysis in time domain (speed RMS and acceleration peak) • Configurable alarm and warning thresholds for key parameters • Compatible with STBLESensor application for Android/iOS, to perform Wi-Fi configuration and secure certificate provisioning • Compatible with DSH-PREDMNT web-based predictive maintenance dashboard for monitoring sensor data and device status • Easy portability across different MCU families, thanks to STM32Cube • Firmware modular example based on eLooM (embedded Light object-oriented fraMework for STM32) to enable code re-usability at application level • Free, user-friendly license terms Overall Software Architecture Latest info available at www.st.com FP-AI-PREDMNT2

• 1x STEVAL-STWINKT1B development board

• 1x STEVAL-STWINWFV1 • Laptop/PC with Windows 7, 8 or 10 • 2x microUSB cables • 1 smartphone with ST BLESensor App • Wi-Fi Router or access to a Wi-Fi network MicroUSB Cable Setup & Demo Examples HW prerequisites STEVAL-STWINKT1B STEVAL-STWINWFV1 ST BLESensor App

Setup & Demo Examples

HW prerequisites 9 • How to re-program/debug the STWIN Assembled Kit Programming cable STLINK-V3MINI

Setup & Demo Examples

Software and Other prerequisites 10 • STM32CubeProgrammer Software • Download and install STM32CubeProgrammer • FP-AI-PREDMNT2 • Copy the .zip file content into a folder on your PC. The package will contain source code example (Keil, IAR, STM32CubeIDE) based on STEVAL-STWINKT1B • ST BLE Sensor Application for Android/iOS to download from Google Store / iTunes • ST DSH-PREDMNT Account FP-AI-PREDMNT2 is not the default firmware on STEVAL-STWINKT1B. To update the firmware, please follow the instructions available in slide 11

FP-AI-PREDMNT2 is not the default firmware on the STEVAL-

STWINKT1B, so it needs to be downloaded on the board by the user. The easiest way is to use the pre-compiled binary provided in the package in the folder Projects\STM32L4R9ZI- STWIN\Applications\PREDMNT2\Binary. To update the firmware: • Connect the STWIN core system board to the STLINK-V3MINI programmer. • Connect both the boards to a PC using micro USB cables. • Open STM32CubeProgrammer, select the proper binary file and download the firmware. For further details, see UM2937 Setup & Demo Examples Firmware update 11 STLink-V3MINI

Download & unpack

1 Select Function Pack: FP-AI-PREDMNT2 2 3 4 5 Configure the board through ST BLESensor app and monitor the application through the ST DSH-PREDMNT dashboard www.st.com/stm32ode-fp FP-AI-PREDMNT2 package structure Docs BSP, HAL, drivers BlueNRG, FreeRTOS, AI-Library, … Applications Projects\STM32L4R9ZI-STWIN\Applications\PREDMNT2\ 6

STWIN Power ON/OFF

• Battery only (no USB cable): • Power ON • Long-press the PWR button until the red led turns off (~1 sec) • Power OFF • Press the PWR button • Plugged mode (USB cable) • Power ON • When USB is plugged-in, the STWIN is always on. It doesn’t matter if the battery is present or not • Power OFF • Unplug the cable and, if the battery is connected, press the PWR button. PWR

• Once the firmware has been loaded, press the [Reset] black button on the STWIN core system. Then, open

STBLESensor app and connect to PM2_100 device. • Open the menu, select [Board configuration] and open [Certificate Request]. • Select [Predictive Maintenance] and sign in with your MyST credentials. Wi-fi configuration and certificate request

• Ask for a new certificate by tapping the + symbol placed at the bottom of the screen or retrieve the ones

already associated to your myST account. The certificates valid for your STWIN are highlighted in blue • Tap on the key to download the security certificates into the STWIN and tap on the Wi-Fi symbol to update Wi- Fi credentials. Wi-fi configuration and certificate request 16 Once the procedure ends correctly, the orange LED switches on. Now the STWIN is connected to the AWS PREDMNT dashboard and is ready to stream data.

• Set streaming times to reduce bandwidth according to the system dynamics

How to use DSH-PREDMNT dashboard Configure periodic update time 19 Configure transmission periods 1 2 Drag balloons

• Configure the measures to take under control and set thresholds for warning and alerts

How to use DSH-PREDMNT dashboard Configure measures and condition monitoring thresholds 20 1 2 3 Threshold configuration Measures domains Configure alarms

• Once devices are selected in

the live dashbaord, a new cardbox will be showed and, if your physical device is transmitting, you will see live data monitoring refreshing. • Data showed are customized according to the FW release of the device, they are: • Environmental Analysis • Vibration Analysis in Time Domain • Vibration Analysis in Frequency Domain • Sound Emission Analysis How to use DSH-PREDMNT dashboard Add a device to live monitoring 21 Select your device for live monitoring

• The Dashboard recognizes the device, update the device shadow (that will be used for other

purposes also) and adapt the visualization How to use DSH-PREDMNT dashboard Hand Shaking Device – Flexible visualization 22 Environmental domain Vibration (FFT) domain Vibration (TDM) domain Acoustic domain

Setup a NanoEdge™ AI library into FP-AI-PREDMNT2

25 Capture data Label data Build NanoEdge Lib Embed NanoEdge Lib Process new data Accelerometer Normal Anomaly Modeling Results NanoEdge implementation Real-time learning 1 2 3 4 5 NanoEdge integration Embed into FP-AI- PREDMNT2 Generating contextual data using FP-SNS-DATALOG1 Build library using NanoEdge™AI Studio Use with DSH-PREDMNT

Capture data and create a labelled dataset

Generating contextual data using FP-SNS-DATALOG1 Regular signals file.csv Abnormal signals file.csv Label Data 2 normalDataFull.csv abnormalDataFull.csv Data log Generate data set 1 Serial SDCard • Flash STWIN board with HSDatalog firmware • Acquire training data onto SDCard • Extract and convert logs using hsdatalog_to_cartesiam.py Python script

Use NanoEdge AI Studio tool

27 3 Building and Export Library file 1. Libneai.a 2. NanoEdgeAI.h Build library using NanoEdge™AI Studio • Generate a Machine Learning library with NanoEdge™AI Studio based on the provided data • Download the library from the NanoEdge™AI Studio

Integration in the FP

Embed into FP-AI-PREDMNT2 • Replace the provided stub in the function pack by the newly generated library • Rebuild the firmware • Program the STWIN with the new firmware Re-compile the FP 4 NanoEdgeAI.h Libneai.a 5 Integrate Lib files into the project

Running and Learning

29 7 Run the demo: NanoEdgeAI execute 6 NanoEdge Learn NanoEdgeAI_learn() NanoEdgeAI_execute() Use FP-AI-PREDMNT2 with DSH-PREDMNT • Learn the normal modes on the edge

Running and Re-training

30 Analyze and decide if new training should be launched 7 8 Run the demo again Use FP-AI-PREDMNT2 with DSH-PREDMNT • Monitor anomalies in detection • Go back to learn mode to improve the learning or to add new normal modes

• DSH-PREDMNT allow you to configure

and setup your custom NanoEdge™ AI library A. Click on the Configuration tab B. Select the symbol of the desired STWIN board C. Click on Anomaly detection Send a command to NanoEdge™ AI library A B C

• The settings tab allow to setup the sensitivity and the threshold parameters

• The commands tab allow to chose either train or detect command. The result of the train command is the training of the neai library for the time interval set in the “phase duration” form. The detect command will trigger the anomaly detection phase in the application in according with the generated library Send a command to NanoEdge™ AI library D E F G

• If the detect command is set, in according with the custom NanoEdge™ AI library, an

anomaly event is sent to the dashboard and an event will be shown in the EVENTS panel of the dashboard. • For further details on how NanoEdge™ AI libraries work, read the detailed documentation of NanoEdge™ AI Studio. Detection phase of NanoEdge™ AI library Start detection Alarm sent Orange led is blinking 1 2

Documents & Related Resources

FP-AI-PREDMNT2: • DB4566: STM32Cube function pack for STEVAL-STWINKT1B evaluation kit for predictive maintenance application based on artificial intelligence (AI) – databrief • UM2937: Getting started with the STM32Cube function pack for STEVAL-STWINKT1B evaluation kit for predictive maintenance application based on artificial intelligence (AI) – user manual • Software setup file STEVAL-STWINKT1B: • Gerber files, BOM, Schematic • DB4345: STWIN SensorTile Wireless Industrial Node development kit and reference design for industrial IoT applications – databrief • UM2777: How to use the STEVAL-STWINKT1B SensorTile Wireless Industrial Node for condition monitoring and predictive maintenance applications – user manual STEVAL-STWINWFV1: • Gerber files, BOM, Schematic • DB3971: Wi-Fi expansion for the SensorTile Wireless Industrial Node (STWIN) kit – databrief 35 All documents are available in the DESIGN tab of the related products webpage Consult www.st.com for the complete list

Documents & Related Resources

DSH-PREDMNT: • Cloud based web application for condition monitoring and predictive maintenance To build up your custom NanoEdge AI library: NanoEdge AI Studio: • Automated Machine Learning (ML) tool for STM32 developers FP-SNS-DATALOG1: • STM32Cube High Speed Datalog function pack for STWIN evaluation kits 36 All documents are available in the DESIGN tab of the related products webpage Consult www.st.com for the complete list

FAST, AFFORDABLE PROTOTYPING AND

DEVELOPMENT The STM32 Open Development Environment (ODE) is an open, flexible, easy and affordable way to develop innovative devices and applications based on the STM32 32-bit microcontroller family combined with other state-of-the-art ST components connected via expansion boards. It enables fast prototyping with leading-edge components that can quickly be transformed into final designs. The STM32 ODE includes the following five elements: o STM32 Nucleo development boards. A comprehensive range of affordable development boards for all STM32 microcontroller series, with unlimited unified expansion capability, and with integrated debugger/programmer o STM32 Nucleo expansion boards. Boards with additional functionality to add sensing, control, connectivity, power, audio or other functions as needed. The expansion boards are plugged on top of the STM32 Nucleo development boards. More complex functionalities can be achieved by stacking additional expansion boards o STM32Cube software. A set of free-of-charge tools and embedded software bricks to enable fast and easy development on the STM32, including a Hardware Abstraction Layer, middleware and the STM32CubeMX PC-based configurator and code generator o STM32Cube expansion software. Expansion software provided free of charge for use with STM32 Nucleo expansion boards, and compatible with the STM32Cube software framework o STM32Cube Function Packs. Set of function examples for some of the most common application cases built by leveraging the modularity and interoperability of STM32 Nucleo development boards and expansions, with STM32Cube software and expansions. The STM32 Open Development Environment is compatible with a number of IDEs including IAR EWARM, Keil MDK, mbed and GCC-based environments. STM32 ODE Ecosystem Function Packs STM32 Nucleo development boards STM32Cube development boards STM32 Nucleo expansion boards (X-NUCLEO) STM32Cube expansion software (X-CUBE)

The combination of a broad range of expandable boards based

on leading-edge commercial products and modular software, from driver to application level, enables fast prototyping of ideas that can be smoothly transformed into final designs. To start your design: • Choose the appropriate STM32 Nucleo development board (MCU) and expansion (X-NUCLEO) boards (sensors, connectivity, audio, motor control etc.) for the functionality you need • Select your development environment (IAR EWARM, Keil MDK, and GCC-based IDEs) and use the free STM32Cube tools and software. • Download all the necessary software to run the functionality on the selected STM32 Nucleo expansion boards. • Compile your design and upload it to the STM32 Nucleo development board. • Then start developing and testing your application. Software developed on the STM32 Open Development Environment prototyping hardware can be directly used in an advanced prototyping board or in and end product design using the same commercial ST components, or components from the same family as those found on the STM32 Nucleo boards. STM32 Open Development Environment: all that you need 39 The building blocks Your need Our answer Move Connect Power Sense Process Inertial modules, magnetometer Proximity, microphone Pressure, temperature, humidity Bluetooth LE Sub-GHz radio NFC, GNSS IO-Link Energy management & battery USB General-purpose microcontrollers Stepper motor driver DC & BLDC motor driver COLLECT TRANSMIT ACCESS ACTUATE POWER PROCESS Software Secure microcontrollers Touch controller LED drivers Accelerometer, gyroscope HMI Industrial input / output Power supply through USB or external source Integrated debugging and programming ST-LINK probe STM32 microcontroller Complete product range from ultra-low power to high-performance ST morpho extension header Arduino™ UNO R3 extension headers

© STMicroelectronics - All rights reserved.

The STMicroelectronics corporate logo is a registered trademark of the STMicroelectronics group of companies. All other names are the property of their respective owners. Thank you

Other Computer Hardware Manuals