ST STM32 Nucleo User manual

Quick Start Guide
STM32Cube function pack for IoT node with BLE
connectivity, environmental and motion sensors
(FP-SNS-MOTENV1)
Version 2.9 (November 10, 2021)

Agenda
1Hardware and Software overview
3Documents & Related Resources
4STM32 Open Development Environment: Overview
2
2Setup & Demo Examples

1- Hardware and Software overview

Hardware Overview
4
Sample implementations are available for STM32 Nucleo development boards plugged on STM32
Nucleo expansion boards:
➢NUCLEO-F401RE (or NUCLEO-L476RG or NUCLEO-LO53R8) + X-NUCLEO-BNRG2A1 +
X-NUCLEO-IKS01A2 (or X-NUCLEO-IKS01A3)

Motion MEMS and environmental sensors expansion board
Hardware Overview (1/5)
5
Latest info available at www.st.com
X-NUCLEO-IKS01A2
Key Product 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)
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.
LPS22HB
HTS221
DIL 24-pin
Arduino UNO R3 connector
ST morpho connector**
LSM6DSL
LSM303AGR
** Connector for the STM32 Nucleo Board

Motion MEMS and environmental sensors expansion board
Hardware Overview (2/5)
Key Product on board
•LSM6DSO MEMS 3D accelerometer (±2/±4/±8/±16 g) + 3D gyroscope
(±125/±250/±500/±1000/±2000 dps)
•LIS2DW12 MEMS 3D accelerometer (±2/±4/±8/±16 g)
•LIS2MDL MEMS 3D magnetometer (±50 gauss)
•LPS22HH MEMS pressure sensor, 260-1260 hPa absolute digital output barometer
•HTS221: Capacitive digital relative humidity and temperature
•STTS751 Digital Temperature sensor
•DIL 24-pin Socket available for additional MEMS adapters and other sensors (UV index)
X-NUCLEO-IKS01A3 Hardware Description
•The X-NUCLEO-IKS01A3 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.
Latest info available at www.st.com
X-NUCLEO-IKS01A3
DIL 24-pin
Arduino UNO R3 connector
ST morpho connector**
HTS221
LPS22HH LSM6DSO
LIS2DW12
LIS2MDL STTS751
** Connector for the STM32 Nucleo Board
6

Bluetooth Low Energy Expansion Board
Hardware Overview (3/5)
Key Product on board
•BLUENRG-M2SP Bluetooth Low Energy, FCC and IC certified (FCC ID:
S9NBNRGM2SP, IC: B976C-BNRGM2SP), module based on Bluetooth® Low Energy
wireless network processor BlueNRG-2, BLE v5.0 compliant.
•BLUENRG-M2SP integrates a BALF-NRG-02D3 balun and a PCB antenna. It embeds
32 MHz crystal oscillator for the BlueNRG-2.
•M95640-RMC6TG 64-Kbit serial SPI bus EEPROM with high-speed clock interface
Hardware Description
•The X-NUCLEO-BNRG2A1 is a Bluetooth Low Energy (BLE) evaluation
and development board system, designed around ST’s BLUENRG-M2SP
Bluetooth Low Energy module based on BlueNRG-2.
•The BlueNRG-2 processor hosted in the BLUENRG-M2SP module
communicates with the STM32 microcontroller, hosted on the Nucleo
development board, through an SPI link available on the Arduino UNO
R3 connector.
7
Arduino UNO R3 connector
BLUENRG-M2SP M95640-RMC6TG
Latest info available at www.st.com
X-NUCLEO-BNRG2A1

Important Hardware Additional Information
Hardware Overview (4/5)
8
BlueNRG-2 library does not work with the stock firmware that is loaded in the BLE
module of X-NUCLEO-BNRG2A1 expansion board.
For this reason:
•first of all, it is needed to solder on X-NUCLEO-BNRG2A1, if it is not soldered, a
0 Ohm resistor at R117.
•Then you can use a standard ST-Link V2-1 with 5 jumper wires female-female
together with STSW-BNRGFLASHER software tool (currently available only for
Windows PC) in order to update the firmware of the BLE module of X-NUCLEO-
BNRG2A1.
You need to connect the J12 pins of the X-NUCLEO-BNRG2A1 to the pins of the
ST-Link V2-1 as shown in the picture and follow the steps show in the next slide.
In particular we have the following connections:
J12 ST-Link V2-1
Pin 1 1
Pin 2 9
Pin 3 12
Pin 4 7
Pin 5 15

Important Hardware Additional Information
STM32 Nucleo with Expansion boards - Hardware Overview (5/5)
9
1. install the ST BlueNRG-1_2 Flasher Utility and open it,
then select the SWD tab
2. Erase the flash memory of the BlueNRG-2 chip
3. Download the Link Layer Only firmware for the BLE
module from the following link DTM_LLOnly.bin
4. Load the Link Layer Only firmware in the ST
BlueNRG-1_2 Flasher Utility and then press the
"Flash" button
5. If you need to restore the stock firmware of the BLE
module of X-NUCLEO-BNRG2A1, you can repeat the
procedure using this firmware image DTM_Full.bin
6. If you should find some issues during the update
process, you can try to repeat the procedure closing
the J15 jumper on the X-NUCLEO-BNRG2A1
expansion board.

FP-SNS-MOTENV1
Software Overview
10
Software Description
•FP-SNS-MOTENV1 is an STM32Cube function pack, which lets you connect your IoT node to a
smartphone via BLE and uses a suitable Android™ or iOS™ application, such as the ST BLE
Sensor app, to view real-time motion and environmental (such as temperature, relative humidity,
pressure) and sensor data.
•This package also enables advanced functions such as the sensor data fusion and accelerometer-
based real-time activity recognition, carry position, gesture recognition, motion intensity recognition
and real-time information about the number of steps and cadence which the user just performed
with the device, i.e. cell phone.
•Together with the suggested combination of STM32 and ST devices, it can be used to develop
specific wearable and environmental monitoring applications, or smart things applications in
general.
Key features
•Complete firmware to develop an IoT node with BLE connectivity, environmental and motion
sensors.
•Middleware libraries for sensor data fusion and acelerometer-based real-time activity recognition,
carry position, gesture recognition, motion intensity recognition and pedometer
•Compatible with ST BLE Sensor applications for Android/iOS, to perform sensor data reading,
motion algorithm features demo and firmware update (FOTA)
•Easy portability across different MCU families, thanks to the STM32Cube
•Free, user-friendly license terms Latest info available at www.st.com
FP-SNS-MOTENV1
Overall Software Architecture

2- Setup & Demo Examples

Setup & Demo Examples
Software and Other prerequisites
12
•STSW-LINK004
•STM32 ST-LINK Utility (STSW-LINK004)is a full-featured software interface for programming STM32
microcontrollers
•FP-SNS-MOTENV1
•Copy the .zip file content of the firmware package into a folder on your PC.
•The package contains source code example (Keil, IAR, STM32CubeIDE) compatible with NUCLEO-F401RE,
NUCLEO-L476RG, NUCLEO-L053R8
•ST BLE Sensor Application for Android/iOS to download from Google Play Store / iTunes

2.1- Setup Overview: STM32 Nucleo
with Expansion boards

Setup Overview
HW prerequisites
14
Mini USB
NUCLEO-F401RE
NUCLEO-L476RG
NUCLEO-L053R8
X-NUCLEO-IKS01A2 X-NUCLEO-IKS01A3
•1x Bluetooth Low Energy Expansion Board (X-NUCLEO-
BNRG2A1)
•1x Motion MEMS and Environmental Sensor Expansion Board
(X-NUCLEO-IKS01A2 or X-NUCLEO-IKS01A3)
•1x STM32 Nucleo Development Board (NUCLEO-F401RE or
NUCLEO-L476RG or NUCLEO-L053R8)
•1x Android™ or iOS™ device
•1x PC with Windows 7 and above
•1x USB type A to Mini-B USB cable
For optimizing the performances of the SPBTLE-RF module
present on X-NUCLEO-IDB05A1 expansion board, it is necessary
to follow this sequence of boards stack
X-NUCLEO-BNRG2A1

Setup Overview
Start coding in just a few minutes (1/3)
15
1
23
4
5
6
Select Function Pack:
FP-SNS-MOTENV1
www.st.com/stm32ode
Android™/iOS™ smartphone and
ST BLE Sensor application
(V4.13.0/4.11.0 or higher)
Use the pre-compiled binaries for registering your device, or alternative
re-compile the code adding your device certificate
Download & unpack
FP-SNS-ALLMEMS1 package structure
Docs
BSP, HAL and drivers
BlueNRG-2, Motion Libs
Application example
Boot loader binary
.\Projects\STM32F401RE-Nucleo\Applications\IKS01A2\MOTENV1
.\Projects\STM32F401RE-Nucleo\Applications\IKS01A3\MOTENV1
.\Projects\STM32L053R8-Nucleo\Applications\IKS01A2\MOTENV1
.\Projects\STM32L053R8-Nucleo\Applications\IKS01A3\MOTENV1
.\Projects\STM32L476RG-Nucleo\Applications\IKS01A2\MOTENV1
.\Projects\STM32L476RG-Nucleo\Applications\IKS01A3\MOTENV1

Setup Overview
Start coding in just a few minutes (2/3)
16
1. How to install the pre-compiled binary:
•For each applications, there is inside the package one folder called “Binary”
➢For NUCLEO-F401RE and NUCLEO-L476RG:
•pre-compiled FP-SNS-MOTENV1 FW that could be flashed to a supported STM32 Nucleo (for X-NUCLEO-IKS01A2 and for X-NUCLEO-IKS01A3) using the ST-Link at
the right position (0x08004000)
oImportant Note: this pre-compiled binary is compatible with the FOTA update procedure
•pre-compiled FP-SNS-MOTENV1 + BootLoader FW that could be directly flashed to a supported STM32 Nucleo (for X-NUCLEO-IKS01A2 and for X-NUCLEO-IKS01A3)
using the ST-Link or by doing “Drag &Drop”
oImportant Note: this pre-compiled binary is not compatible with the FOTA update procedure
➢For NUCLEO-L053R8:
•pre-compiled FP-SNS-MOTENV1 could be directly flashed to a supported STM32 Nucleo (for X-NUCLEO-IKS01A2 and for X-NUCLEO-IKS01A3) using the ST-Link or by
doing “Drag &Drop”.

Setup Overview
Start coding in just a few minutes (3/3)
17
2. How Install the code after compiling the project (excluding NUCLEO-L053R8) :
•Compile the project with your preferred IDE
•On Windows: for each IDE and for each platform there is one batch script:
•IAR toolchain Embedded Workbench V8.50.9:
•CleanMOTENV1_IAR_IKS01A2.bat
•CleanMOTENV1_IAR_IKS01A3.bat
•STM32CubeIDE Version 1.7.0:
•CleanMOTENV1_STM32CubeIDE_IKS01A2.bat
•CleanMOTENV1_STM32CubeIDE_IKS01A3.bat
•Keil µVision 5 toolchain - MDK-ARM Professional Version: 5.32.0:
•CleanMOTENV1_MDK-ARM_IKS01A2.bat
•CleanMOTENV1_MDK-ARM_IKS01A3.bat
•For Linux/iOS: only for STM32CubeIDE and for each platform there is one for STM32CubeProgrammer :
•CleanMOTENV1_STM32CubeIDE_IKS01A2.sh
•CleanMOTENV1_STM32CubeIDE_IKS01A3.sh
It’s necessary to edit this file for setting the right installation of the STM32CubeProgrammer
•These scripts perform the following steps:
•Full Flash Erase
•Flash the right BootLoader at the right position (0x08000000)
•Flash the MOTENV1 firmware at the right position (0x08004000)
➢This is the firmware that was compiled with the IDE
➢This firmware is compatible with the FOTA update procedure
•Save a complete Binary FW that includes both MOTENV1 and the BootLoader
➢This binary can be directly flashed to a supported STM32 board using the ST-Link or by doing “Drag & Drop”
➢Important Note: this additional pre-compiled binary is not compatible with the FOTA update procedure

Setup Overview
Flash Management and Boot Process
18
Flash Structure for STM32F401RE

Setup Overview
Bluetooth low energy and sensors software
19
FP-SNS-MOTENV1 for NUCLEO-F401RE / NUCLEO-L476RG - Serial line monitor (e.g.Tera Term)
•Pressing the RESET User button on
STM32 Nucleo board. You could see
the initialization phase
•When the boards are connected to an
Android or iOS device, you can see
what is transmitted via BLE
Configure the serial line monitor (speed, LF)

2.4- Demo Examples
ST BLE Sensor Application Overview
Other manuals for STM32 Nucleo
19
Table of contents
Other ST Motherboard manuals

ST
ST STEVAL-ISC005V1 Administrator Guide

ST
ST SPC58NHADPT386S User manual

ST
ST STLINK-V3SET User manual

ST
ST EVAL-L99MOD5xXP User manual

ST
ST STEVAL-IPC002V1 User manual

ST
ST eMotion STEVAL-MKI109V1 User manual

ST
ST STEVAL-LLL014V1 User manual

ST
ST AEKD-AICAR1 User manual

ST
ST STM32H7B3I-EVAL User manual

ST
ST SPC572L-DISP User manual

ST
ST EVSPIN32G4-DUAL User manual

ST
ST SPC58NG-DISP User manual

ST
ST STM32L152RCT6 Discovery kit User manual

ST
ST SPC564A-DISP Installation and operating instructions

ST
ST X-NUCLEO-CCA02M1 User manual

ST
ST STEVAL-BTDP2 User manual

ST
ST STM32373C-EVAL User manual

ST
ST STEVAL-1PS03A User manual

ST
ST STM8L1528-EVAL User manual

ST
ST UM1461 User manual