Version 2.4 (September 05, 2018)
Quick Start GuideSTM32Cube function pack for IoT node with Wi-Fi, NFC and sensors for
vibration analysis, connected to IBM Watson IoT cloud
(FP-CLD-WATSON1)
Quick Start Guide Contents2
FP-CLD-WATSON1: STM32Cube function pack for IoT node with Wi-Fi,
NFC and sensors for vibration analysis, connected to IBM Watson IoT
cloud
Setup & Demo Examples
Documents & Related Resources
STM32 Open Development Environment: Overview
Key products on board
LSM6DSL
MEMS 3D accelerometer (±2/±4/±8/±16 g) + 3D
gyroscope (±125/±245/±500/±1000/±2000 dps)
LSM303AGR
MEMS 3D magnetometer (±50 gauss) + MEMS 3D
accelerometer (±2/±4/±8/±16 g)
LPS22HB
MEMS pressure sensor, 260-1260 hPa absolute digital
output barometer
HTS221
Capacitive digital relative humidity and temperature
DIL 24-pin
Socket available for additional MEMS adapters and
other sensors (UV index)
DIL 24-pin
Motion MEMS and environmental sensor expansion board
(X-NUCLEO-IKS01A2)
Hardware overview (1/4)3
X-NUCLEO-IKS01A2 Hardware description
• The X-NUCLEO-IKS01A2 is a motion MEMS and
environmental sensor evaluation board system.
• It is compatible with the Arduino UNO R3 connector
layout, and is designed around ST’s latest sensors.
Arduino UNO R3 connector
ST morpho connector**
** Connector for the STM32 Nucleo Board
HTS221
LPS22HB
LSM6DSL
LSM303AGR
Latest info available at www.st.com
X-NUCLEO-IKS01A2
Dynamic NFC tag expansion board
Hardware Overview (2/4) 4
NUCLEO-F429ZI board
Hardware Overview (3/4) 5
NUCLEO-144 Hardware Description
The STM32 Nucleo-144 boards (NUCLEO-F207ZG, NUCLEO-
F303ZE, NUCLEO-F412ZG, NUCLEO-F413ZH, NUCLEO-F429ZI,
NUCLEO-F446ZE, NUCLEO-F722ZE, NUCLEOF746ZG, NUCLEO-
F767ZI and NUCLEO-H743ZI) provide an affordable and flexible
way for users to try out new concepts and build prototypes, by
choosing from the various combinations of performance and power
consumption features provided by the STM32 microcontroller.
Key Product on board
• 2 types of extension resources:
• ST Zio connector including: support for Arduino™ Uno V3
connectivity (A0 to A5,D0 to D15) and additional signals exposing
a wide range of peripherals
• ST morpho extension pin header footprints for full access to all
STM32 I/Os
• USB OTG or full-speed device with Micro-AB connector (depending
on STM32 support)
• IEEE-802.3-2002 compliant Ethernet connector
• Flexible board power supply:
• 5 V from ST-LINK/V2-1 USB VBUS
• External power sources: 3.3 V and 7 - 12 V on ST Zio or ST
morpho connectors, 5 V on ST morpho connector
• On-board ST-LINK/V2-1 debugger/programmer with SWD connector
Latest info available at www.st.com
NUCLEO-F429ZI
STM32L4 Discovery Board for IoT node (B-L475E-IOT01A)
Hardware Overview (4/4) 6
STM32L4 Discovery Board for IoT node (B-L475E-IOT01A)
Hardware Description
The STM32L4 Discovery kit for the IoT node (B-L475E-IOT01A) allows users to
develop applications with direct connection to cloud servers. The STM32L4 Discovery
kit enables a wide diversity of applications by exploiting low-power multilink
communication (BLE, Sub- GHz), multiway sensing (detection, environmental
awareness) and ARM® Cortex®-M4 core-based STM32L4 Series features. Arduino™
Uno V3 and PMOD connectivity provide unlimited expansion capabilities with a large
choice of specialized add-on boards.
Key Product on board
• Ultra-low-power STM32L4 Series MCUs based on ARM® Cortex® -M4 core with 1
Mbyte of Flash memory and 128 Kbytes of SRAM, in LQFP100 package
• Bluetooth® V4.1 module (SPBTLE-RF)
• Sub-GHz (868 or 915 MHz) low-power-programmable RF module (SPSGRF-868 or
SPSGRF-915)
• Wi-Fi® module Inventek ISM43362-M3G-L44 (802.11 b/g/n compliant)
• Dynamic NFC tag based on M24SR with its printed NFC antenna
• 2 digital omnidirectional microphones (MP34DT01)
• Capacitive digital sensor for relative humidity and temperature (HTS221)
• High-performance 3-axis magnetometer (LIS3MDL), 3D accelerometer and 3D
gyroscope (LSM6DSL), 260-1260 hPa absolute digital output barometer (LPS22HB),
Time-of-Flight and gesture-detection sensor (VL53L0X)
• USB OTG FS with Micro-AB connector
• Expansion connectors: Arduino™ Uno V3, PMOD
• Flexible power-supply options: ST LINK USB VBUS or external sources
• On-board ST-LINK/V2-1 debugger/programmer with USB re-enumeration capability:
mass storage, virtual COM port and debug port
Latest info available at www.st.com
B-L475E-IOT01A
FP-CLD-WATSON1
Software Overview 7
FP-CLD-WATSON1 Software Description
FP-CLD-WATSON1 is an STM32Cube function pack. It can
connect an IoT node based on the STM32L4 Discovery kit IoT
node (B-L475E-IOT01A) or theNUCLEOF429ZI to IBM Watson
IoT, transmit sensor data and receive commands from remote
applications. This package lets you jump-start end-to-end IoT
development so that you can focus on adding desired functions..
Key features
• Complete middleware to build applications based on Wi-
Fi/Ethernet connectivity, inertial and environmental sensors, and
to connect an STM32 Nucleo-144 development board with
STM32F429ZI MCU, or an STM32L4 Discovery kit IoT node (B-
L475E-IOT01A) to IBM Watson IoT Cloud.
• Provide software interface to access temperature and humidity
sensor (HTS221), pressure sensor (LPS25HB), motion sensors
(LIS3MDL, LSM303AGR, LSM6DS0, LSM6DSL) and to write
and read the RFID/NFC tag (ST25DV04K)
• Integrated mbedTLS and MQTT protocol middleware
• Integrated Fast Fourier Transform (FFT) algorithm for vibration
analysis
• Sample implementation based on Wi-Fi connectivity available
for STM32L4 Discovery kit IoT node (B-L475E-IOT01A), based
on Ethernet connectivity available for X-NUCLEO-IKS01A2, and
X-NUCLEO-NFC04A1, when both connected to a NUCLEO-
F429ZI
• Easy access to IBM Watson IoT Cloud services for sensors
data visualization and processing.
Overall Software Architecture
FP-CLD-WATSON1
Latest SW available at www.st.com
Quick Start Guide Contents8
FP-CLD-WATSON1: STM32Cube function pack for IoT node with Wi-Fi,
NFC and sensors for vibration analysis, connected to IBM Watson IoT
cloud
Setup & Demo Examples
Documents & Related Resources
STM32 Open Development Environment: Overview
Setup & Demo Examples
HW prerequisites (1/2) 9
• 1x Motion MEMS and environmental sensor expansion board for STM32 Nucleo (X-NUCLEO-
IKS01A2)
• Note: the vibration analysis application is available only when using the X-NUCLEO-
IKS01A2 board
• 1x Dynamic NFC tag expansion board expansion board for STM32 Nucleo (X-NUCLEO-
NFC04A1) (optional)
• 1x STM32 Nucleo development board (NUCLEO-F429ZI)
• NFC-enabled Android™ device (optional)
• Windows 7 or higher - Laptop/PC
• Ethernet port for connectivity supporting DHCP
• 1 x micro USB cable
X-NUCLEO-NFC04A1
(optional)
NUCLEO-F429ZI
Micro USB Cable X-NUCLEO-IKS01A2
Setup & Application ExamplesHW prerequisites for Nucleo and expansion
board with Ethernet connectivity (2/2)10
X-NUCLEO-IKS01A2
X-NUCLEO-NFC04A1
NUCLEO-F429ZI
STM32 Nucleo-144
Sensors
Dynamic NFC
+ +
Setup & Application Examples (Azure_Sns_DM)HW prerequisites for B-L475E-IOT01A 11
• 1x B-L475E-IOT01A development board
• NFC-enabled Android™ device (optional)
• Laptop/PC with Windows 7, 8 or 10
• 1 x microUSB cable
• Wi-Fi Router or access to a Wi-Fi network
B-L475E-IOT01AMicroUSB Cable
Setup & Demo Examples
SW prerequisites 12
• STSW-LINK009
• ST-LINK/V2-1 USB driver
• STSW-LINK007:
• ST-LINK/V2-1 firmware upgrade
• FP-CLD-WATSON1
• Copy the .zip file content into a folder on your PC. The package will contain source code example (Keil, IAR, System Workbench) based only on NUCLEO-F429ZI
• Serial line terminal (e.g. TeraTerm, https://ttssh2.osdn.jp/ )
• A mobile application for Android/iOS capable to read/write NFC tag (i.e. ST25 NFC
https://play.google.com/store/apps/details?id=com.st.demo)
FP-CLD-WATSON1
Wi-Fi, NFC and sensors software for Cloud connectivity 13
Download & unpack
www.st.com
1
FP-CLD-WATSON1
Select Function Pack:
23
FP-CLD-WATSON1 package structure
Docs
BSP, HAL and drivers
FFT, NDEF, MQTT, Wi-Fi lib.
IBM Quickstart sample
application
4
5
Compile/Flash and
Run the project
6
www.st.com/stm32ode-fp
.\Projects\Multi\Applications\MQTT_IBM
NFC-enabled
smartphone
Visualize sensors data
Chrome
Web browser
Quickstart mode configuration
14
FP-CLD-WATSON1
Configure IBM Cloud Configuration Parameters
via serial interface(1/2)15
1. Configure a serial terminal with the following parameters to view log messages and write AP
parameters. Tested with Teraterm version 4.96
• BaudRate : 115200
• Data : 8 bit
• Parity : none
• Stop : 1 bit
2. B-L475E-IOT01A requires Wi-Fi connectivity, provide Wi-Fi Credentials using terminal. This
step is not needed for Nucleo-F429ZI based configuration:
• Flow Control : none
• NewLine RX AUTO
• NewLine TX : CR+LF
• Local echo: Enabled
FP-CLD-WATSON1
Configure IBM Cloud Configuration Parameters
via serial interface(1/2) 16
3. Configure a serial terminal with the following parameters to view log messages and write AP
parameters. Tested with Teraterm version 4.96
• BaudRate : 115200
• Data : 8 bit
• Parity : none
• Stop : 1 bit
4. Press RESET (Black) button on STM32 Nucleo to trigger initialization phase. Enter the root
CA when firmware asks for it:
• (copy-paste from Projects\Common\Bluemix\comodo_bluemix.pem):
• Flow Control : none
• NewLine RX AUTO
• NewLine TX : CR+LF
• Local echo: Enabled
FP-CLD-WATSON1
Configure IBM Cloud Configuration Parameters
via serial interface(2/2)17
3. Enter Registration mode.
4. Enter Bluemix Configuration String.
5. Device will start streaming sensor data to IBM Watson IoT platform service.
FP-CLD-WATSON1
Provision of device credentials using NFC (optional)(1/2)18
This feature is only available for NUCLEO-F429ZI based configuration. NFC Usage for device credential provisioning is optional. And it requires usage of the X-NUCLEO-NFC04A1 expansion board.
1. Write Bluemix Configuration parameters to X-NUCLEO-NFC04A1 using a mobile
application. E.g. with ST25 NFC mobile application for Android devices:
2. 7
Bring Android phone near
NFC tag
FP-CLD-WATSON1
Provision of device credentials using NFC (optional) (2/2)
2. Format of configuration string passed in step #5 above:
• ibmmode=q;DeviceType=your_device_type;DeviceId=id1
19
FP-CLD-WATSON1Quickstart URL to visualize sensors data 20
• Paste Quickstart URL in Chrome web browser Paste the URL in
the web browser
One set of sensors
data are visualized at
a time, selected from
the list below i.e.
FFT_max_f
List of sensors
Data received
Registered mode configuration
Create dashboard in IBM Cloud
21
• “Registered mode” enables to connect your STM32 Nucleo and expansion
boards to IBM Cloud and build scalable IoT applications based IBM Watson
IoT platform
• Create a free account at IBM cloud by following instructions at
https://console.bluemix.net/registration/
• Once you have an IBM cloud user account, use your credentials to create
Internet of Things Platform Starter cloud foundry app
FP-CLD-WATSON1: Registered mode
Create Watson IoT Platform IBM Cloud
• Click on the xxxx-iotf-service link in your IBM cloud dashboard
23
FP-CLD-WATSON1: Registered mode
Launch Watson IoT Platform (1/2)
• Click on Launch to open IBM Watson IoT platform service
24
FP-CLD-WATSON1: Registered mode
Launch Watson IoT Platform (2/2)
FP-CLD-WATSON1: Registered mode
Create a device type (1/2)
• Click on Device then Device Types
FP-CLD-WATSON1: Registered mode
Create a device type (2/2)
• Select Device as Device Type, enter Device Type name then click on
Next
• Select BroweDevices in left side bar, then add your device by clicking
on Add Device
• Please note that you might have to create a device type first
27
FP-CLD-WATSON1: Registered mode
Add a device (1/4)
FP-CLD-WATSON1: Registered mode
Add a device (2/4)
• Select Auto-generated authentication token, then click on Next
FP-CLD-WATSON1: Registered mode
Add a device (3/4)
• Select Device Type, enter your Device ID, then click on Next
FP-CLD-WATSON1: Simple Registration mode
Add a device (4/4)
• Take note of device credentials generated for your device
FP-CLD-WATSON1: Simple Registration mode
Provision credentials to STM32 Nucleo
• Reboot the STM32 Nucleo board. When requested select Registered
mode. Enter device credentials as shown below
Simple Registeration Mode = 2
32
This feature is only available for Nucoe-F429ZI based configuration. NFC Usage for
device credential provisioning is optional. And it requires usage of X-NUCLEO-
NFC04A1 expansion board.
• Device credentials can also be written to device via NFC by using a mobile application. E.g. with ST25
NFC app:
Bring Android phone near
NFC tag
FP-CLD-WATSON1: Registered mode
Provision of device credentials using NFC (optional)(1/2)
• Format of configuration string passed in step #5 on last slide:
• OrgId=yuzagl;DeviceType=f429zi;DeviceId=i1;Token=hdd1hdd1
33
FP-CLD-WATSON1: Registered mode
Provision of device credentials using NFC (optional) (2/2)
FP-CLD-WATSON1: Registered mode
Visualize messages received from STM32 Nucleo
• Browse devices, select your device ID, then click on Recent Events
tab
FP-CLD-WATSON1: Registered mode
Create dashboard to visualize data (1/4)
• Click on Boards in left bar, then Create New Board
FP-CLD-WATSON1: Registered mode
Create dashboard to visualize data (2/4)
• Name your board, then click on Add New Card
FP-CLD-WATSON1: Registered mode
Create dashboard to visualize data (3/4)
• Select Card Type, click on your device ID, then click on Connect data set.
• Select status as Event; select one among data set available in the
messages received, select type and unit of the data set, then click Next
FP-CLD-WATSON1: Registered mode
Create dashboard to visualize data (4/4)
• For each data set contained in the messages generated by STM32
Nucleo (Temperature, Humidity, etc.), a different card can be added
Registered mode configuration
Connect device to a NodeRED
application
39
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• Node-RED is a flow-based development tool for wiring together
hardware devices, APIs and online services (nodered.org)
• Node-RED is pre-integrated in Watson IoT Platform
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• Before connecting your devices to Node-RED, you have to generate
API keys in IBM Watson IoT dashboard
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• Select Standard Application, then click on Generate Key
• Note down API Key and Authentication token
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• Go back to your IBM Cloud dashboard and click on your app URL to
open Node-RED flow editor. It is optional to secure it using a
username/password
44
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• In Node-RED flow editor, select Manage Palette from menu option, click on install tab
and install node-red-dashboard in your Node-RED palette
• Select Import to import the flow described in file FFTSensorFlow.json that can be found
inside folder STM32CubeFunctionPack_WATSON1_F4_V2.1.1/Utilities/NodeRED
• Copy and paste the content of the JSON file to clipboard
45
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• Configure the Watson IoT platform node using following parameters:
• API key and authentication token
• Device Type
• Device ID
46
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• In order to visualize the sensor data received from STM32 Nucleo in
Node-RED dashboard:
• Click on the Deploy button on top-right of the Node-RED application page
• Click launch icon in dashboard tab
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
• A web based dashboard will appear. Sensor data from STM32
Nucleo is visualized in real time
FP-CLD-WATSON1: Registered mode
Connect device to Node-RED application
Application scenario
FP-CLD-WATSON1 - Condition monitoring data Wi-Fi to Cloud
Condition Monitoring Sensor to CloudPre-Integrated Application Packages 51
Vibration data pushed to IBM cloud over WIFI.
Condition levels for motor: “OK, Warning, Failure”Demo kit mounted on top of Motor/Pump/Fan
• Condition monitoring and preventive maintenance
• Vibration monitoring of motors, fans and pumps
• Identification of load unbalance and misalignment
• Alarming of equipment failures
Typical Use Case of Monitoring Industrial Motor52
Imbalance Looseness Output shaftGear Mesh
(or Gearbox)
t
• Displacement
• Speed
• Acceleration
• Acoustic noise
• Angular speed
• Torque
Mechanical vibration
Vibration
Capture
Connectivity
Processing
Secure
Connections
Functionality
Quick Start Guide Contents53
FP-CLD-WATSON1: STM32Cube function pack for IoT node with Wi-Fi,
NFC and sensors for vibration analysis, connected to IBM Watson IoT
cloud
Setup & Demo Examples
Documents & Related Resources
STM32 Open Development Environment: Overview
STM32 Open Development Environment
Fast, affordable Prototyping and Development 54
• The STM32 Open Development Environment (ODE) consists of a set of stackable boards
and a modular open SW environment designed around the STM32 microcontroller family.
www.st.com/stm32ode
Function Packs
(FP)
STM32Cube
development software
STM32 Nucleo
expansion boards
(X-NUCLEO)
STM32 Nucleo
development boards
STM32Cube
expansion software
(X-CUBE)
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
STM32 Nucleo
Development Boards (NUCLEO)
• A comprehensive range of affordable development boards for all the STM32
microcontroller series, with unlimited unified expansion capabilities and integrated
debugger/programmer functionality.
55
www.st.com/stm32nucleo
Arduino™ UNO R3 extension headers
Move/ActuatePower InteractConnect
Sense
STM32 Nucleo
Expansion Boards (X-NUCLEO)
• Boards with additional functionality that can be plugged directly on top of the STM32
Nucleo development board directly or stacked on another expansion board.
56
DIL24 support for
new devices
Motion MEMS sensors
Environmental sensors
www.st.com/x-nucleo
Example of STM32 expansion board (X-NUCLEO-IKS01A1)
STM32 Open Development Environment
Software components
• STM32Cube software (CUBE) - A set
of free tools and embedded software bricks
to enable fast and easy development on
the STM32, including a Hardware
Abstraction Layer and middleware bricks.
• STM32Cube expansion software
(X-CUBE) - Expansion software provided
free for use with the STM32 Nucleo
expansion board and fully compatible with
the STM32Cube software framework. It
provides abstracted access to expansion
board functionality through high-level APIs
and sample applications.
57
www.st.com/x-cube
• Compatibility with multiple Development Environments - The STM32 Open Development
Environment is compatible with a number of IDEs including IAR EWARM, Keil MDK, and GCC-based
environments. Users can choose from three IDEs from leading vendors, which are free of charge and
deployed in close cooperation with ST. These include Eclipse-based IDEs such as Ac6 System
Workbench for STM32 and the MDK-ARM environment.
Tools & IDEs
Application examples(e.g. basedonSTOpenSoftwareX)
Hardware
SampleapplicationsApplications
IAREWARM,Keil MDK-ARM,GCC-basedIDEs(e.g. Ac6System Workbenchfor STM32)
STM32CubeHardware Abstraction Layer (HAL)
STM32Cubemiddleware
Upper level middleware(e.g. STOpenSoftwareX)
Middleware
HardwareAbstraction
STM32Cubeexpansion middleware
STM32 Nucleo expansion boards (X-NUCLEO)
STM32 Nucleo developer boards
OPEN LICENSE MODELS: STM32Cube software and sample applications are covered by a
mix of fully open source BSD license and ST licenses with very permissive terms.
www.st.com/stm32cube
STM32 Open Development Environment
Building block approach 58
The building blocks Your need Our answer
Move /
Actuate
Connect
Power
Sense
Process
Inertial modules, magnetometer
Proximity, microphone
Pressure, temperature, humidity
Bluetooth LE, Sub-GHz radio
NFC, Wi-Fi, GNSS
Energy management & battery
General-purpose microcontrollers
Stepper motor driver
DC & BLDC motor driver
Audio amplifier
COLLECT
TRANSMIT
ACCESS
CREATE
POWER
PROCESS
Software
Secure microcontrollers
Touch controller
Operation Amplifier
Accelerometer, gyroscope
Translate
Industrial input / output
www.st.com/stm32ode