STMicroelectronics FP-SNS-ALLMEMS1 User Manual
Anuncio
Anuncio
UM2059
User manual
Getting started with the STM32Cube function pack for IoT node with BLE connectivity, digital microphone, environmental and motion sensors
Introduction
FP-SNS-ALLMEMS1 is an STM32Cube function pack which lets you connect your IoT node to a smartphone via BLE and use a suitable Android™ or iOS™ application, like the STBLESensor app, to view real-time environmental sensor data, motion sensor data, digital microphone levels and battery level.
The package also enables advanced functions such as voice communication over BLE, sound source localization and acoustic beam forming using inputs from multiple microphones, as well as sensor data fusion and accelerometer-based real-time activity recognition, carry position, gesture recognition, motion intensity recognition, audio data logging and MEMS sensor data logging on SD card.
Moreover, it provides real-time information about the user current pose based on data from a device, working mode (sitting/ standing desk position), tilt angles of the device, the repetitions of various fitness activities performed and the vertical movement.
This package, together with the suggested combination of STM32 and ST devices, can be used to develop specific wearable applications, or smart things applications in general.
The software runs on the STM32 microcontroller and includes all the necessary drivers to recognize the devices on the STM32
Nucleo development board and expansion boards, as well as on the STEVAL-BCNKT01V1 , STEVAL-MKSBOX1V1 and
STEVAL-STLKT01V1 evaluation boards.
RELATED LINKS
Visit the STM32Cube ecosystem web page on www.st.com for further information
UM2059 - Rev 10 - June 2020
For further information contact your local STMicroelectronics sales office.
www.st.com
1
1.1
UM2059
FP-SNS-ALLMEMS1 software description
FP-SNS-ALLMEMS1 software description
Overview
•
•
The key features of the FP-SNS-ALLMEMS1 package are:
• Complete firmware to develop an IoT node with BLE connectivity, digital microphone, environmental and motion sensors
• Middleware libraries for sensor data fusion, accelerometer-based real-time activity recognition, carry position, gesture recognition, motion intensity recognition, user current pose recognition, working mode recognition, tilt angles evaluation, vertical movement detection, fitness activities quantity repetition, acoustic source localization and beam forming, audio processing and streaming over BLE communication profile, SD card data logging
•
•
Compatible with STBLESensor application for Android/iOS, to perform sensor data reading, audio and motion algorithm feature demo, and firmware update over the air (FOTA)
Sample implementation available for STEVAL-BCNKT01V1 , STEVAL-MKSBOX1V1 and STEVAL-
STLKT01V1 board and for X-NUCLEO-CCA02M2 , X-NUCLEO-IKS01A3 (or X-NUCLEO-IKS01A2 ) and X-
NUCLEO-BNRG2A1 connected to a NUCLEO-F446RE or NUCLEO-F401RE or NUCLEO-L476RG board
Easy portability across different MCU families, thanks to STM32Cube
Free, user-friendly license terms
UM2059 - Rev 10 page 2/87
UM2059 - Rev 10
UM2059
Overview
This software creates the following Bluetooth services:
1.
The first service exposes all the hardware and software characteristics:
– HW characteristics related to MEMS sensor devices:
◦
◦
◦
◦
◦
◦
Temperature
Pressure
Humidity
3D gyroscope, 3D magnetometer, 3D accelerometer
Microphones dB noise level.
Battery %, voltage and status (charging/discharging/low battery) for STEVAL-STLKT01V1 ,
STEVAL-MKSBOX1V1 and STEVAL-BCNKT01V1
– SW characteristics:
◦ quaternions generated by the MotionFX library in short precision
◦
◦ magnetic North direction (e-Compass) recognized activity using the MotionAR algorithm
◦
◦
•
• features not available for STEVAL-BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE :
• recognized carry position using the MotionCP algorithm
• count of repetitions for various fitness activities performed by a user using the MotionFA algorithm recognized gesture using the MotionGR algorithm recognized motion intensity using the MotionID algorithm
•
•
•
• recognized user current pose using the MotionPE algorithm recognized user working mode using the MotionSD algorithm tilt angles evaluation of the user device using the MotionTL algorithm recognized type of vertical movement using the MotionVC algorithm audio source localization using the AcousticSL algorithm (feature not available on the STEVAL-
STLKT01V1 and STEVAL-MKSBOX1V1 )
◦
◦ audio beam forming using the AcousticBF algorithm (feature available only on STEVAL-
BCNKT01V1 ) voice over Bluetooth low energy using the BlueVoiceADPCM algorithm (feature available on
STEVAL-BCNKT01V1 and STEVAL-STLKT01V1 )
◦ SD data logging (audio and MEMS data) using Generic FAT File System middleware (feature available on the STEVAL-STLKT01V1 and STEVAL-MKSBOX1V1 )
2.
The second service exposes the Console service with:
– stdin/stdout for bi-directional communication between client and server
– stderr for a mono-directional channel from the STM32 Nucleo board to an Android/iOS device
3.
The last service is for transmitting/resetting the calibration status and enabling the following expansion hardware features for LSM6DSL on an X-NUCLEO-IKS01A2 expansion board for STM32 Nucleo L4 only, for
LSM6DSO on an X-NUCLEO-IKS01A3 expansion board for STM32 Nucleo L4 only, for LSM6DSM on
STEVAL-BCNKT01V1 and STEVAL-STLKT01V1 or for LSM6DSOX for STEVAL-MKSBOX1V1 :
– Pedometer (not available on STEVAL-MKSBOX1V1 )
– Free Fall detection
– Single tap detection
– Double tap detection
– Wake up detection
– Tilt detection
– 3D orientation
– Multi Events detection (3D orientation, pedometer, single tap, double tap, free fall and tilt detection) not available on STEVAL-MKSBOX1V1 page 3/87
1.2
UM2059
Architecture
This software gathers:
• the temperature, humidity, pressure, audio and motion sensor drivers for the
MP34DT01-M, LSM6DSL and LSM303AGR devices if X-NUCLEO-IKS01A2 expansion board is mounted on
STM32 Nucleo
HTS221 , LPS22HB ,
•
• the temperature, humidity, pressure, audio and motion sensor drivers for the HTS221 , LPS22HH ,
MP34DT01-M, LSM6DSO and LIS2MDL devices if X-NUCLEO-IKS01A3 expansion board is mounted on
STM32 Nucleo the temperature, pressure, humidity, audio, motion sensor and Gas Gauge IC drivers for the LPS22HB ,
MP34DT01-M, LSM6DSM , LSM303AGR and STC3115 devices for STEVAL-STLKT01V1 running on STM32
Nucleo .
•
• the temperature, pressure, audio and motion sensor for the LPS22HB , MP34DT04-C1 and LSM6DSM ,
LSM303AGR devices for STEVAL-BCNKT01V1 running on STM32 Nucleo .
the temperature, pressure, humidity, audio and motion sensor for the HTS221 , LPS22HH , MP23ABS1 and
LSM6DSOX , LIS2MDL devices for STEVAL-MKSBOX1V1 running on STM32 Nucleo .
This package is compatible with the STBLESensor Android/iOS (Ver. 4.4.4 or higher) application, available at respective Play/iTunes stores, which can be used for displaying information sent via the Bluetooth low energy protocol and for Over-The-Air firmware updates.
Architecture
The STM32Cube function packs leverage the modularity and interoperability of STM32 Nucleo and expansion boards with STM32Cube and expansion software to create functional examples representing some of the most common use cases in each sphere of application.
These software function packs are designed to fully exploit the underlying STM32 ODE hardware and software components to best satisfy the final user application requirements.
Function packs may also include additional libraries and frameworks not present in the original expansion software packages, thus enabling new functions and creating more pertinent and usable systems for developers.
To access and use the sensor expansion board, the application software uses:
• STM32Cube HAL layer : provides a simple, generic and multi-instance set of generic and extension APIs
(application programming interfaces) to interact with the upper layer application, libraries and stacks. It is directly based on a generic architecture and allows the layers that are built on it, such as the middleware layer, to implement their functions without requiring the specific hardware configuration for a given microcontroller unit (MCU). This structure improves library code reusability and guarantees easy portability across other devices.
• Board support package (BSP) layer : supports the peripherals on the STM32 Nucleo board (except the
MCU) with a limited set of APIs providing a programming interface for certain board-specific peripherals like the LED, the user button, etc., and helps determine the specific board version. For the sensor expansion board, it provides the programming interface for various inertial and environmental sensors and support for initializing and reading sensor data.
UM2059 - Rev 10 page 4/87
UM2059 - Rev 10
UM2059
Architecture
Application
Figure 1. FP-SNS-ALLMEMS1 software architecture
FP-SNS-ALLMEMS1
Middleware
BLE
FatFs
AcousticSL/BF
USB Device
MotionAR/CP/FA/FX/GR
BlueVoiceADPCM
Audio PDM to PCM
MotionID/PE/SD/TL/VC
Meta Data Manager
STM32Cube Hardware Abstraction Layer (HAL)
Hardware
Abstraction
Hardware
STM32 Nucleo expansion boards
X-NUCLEO-BNRG2A1 (Connect)
X-NUCLEO-IKS01A2 (Sense)
X-NUCLEO-IKS01A3 (Sense)
X-NUCLEO-CCA02M2 (Sense)
STM32 Nucleo development board
STEVAL-BCNKT01V1
STEVAL-STLKT01V1
STEVAL-MKSBOX1V1 evaluation board
This software is based on the STM32CubeHAL. It extends STM32Cube by providing a board support package
(BSP) for the BlueNRG-MS and BlueNRG-2 , sensor expansion board and middleware components for communication with other Bluetooth low energy devices, for sensor data fusion, real-time audio library, voice communication over Bluetooth low energy and SD card data logging.
The package contains audio libraries (AcousticBF, AcousticSL and BlueVoiceADPCM) and and motion sensor libraries (MotionAR, MotionCP, MotionFA, FusionFX, MotionGR, MotionID, MotionPE, MotionSD, MotionTL,
MotionVC) useful for sensing applications based on BLE communication.
FP-SNS-ALLMEMS1 also contains FatFs generic FAT file system module which provides access to storage devices such as memory card and hard disk (feature available only for the STEVAL-STLCS01V1 and STEVAL-
MKSBOX1V1 evaluation boards).
The motion algorithms are managed through special software designed for mobile and wearable applications and are strictly limited to work with accelerometer and pressure data only, to facilitate low power consumption strategies commonly required in these applications, in compliance with Bluetooth specifications.
The provided drivers abstract low-level hardware details, so middleware components and applications can access the sensors in a hardware-independent manner.
The package includes a sample application to transmit the values read from all the sensors to a Bluetooth low energy-enabled device such as an Android™ or iOS™.
The STBLESensor Android/iOS application, available on the respective application stores, displays the values read from sensors. The application also allows firmware update over the air as well as displaying battery information.
The STEVAL-STLKT01V1 and STEVAL-MKSBOX1V1 boards go in shutdown mode if they are not connected to an Android/iOS device for a period longer than a fixed range time.
page 5/87
1.3
Folder structure
Figure 2. FP-SNS-ALLMEMS1 package folder structure
UM2059
Folder structure
1.4
The following folders are included in the software package:
• Documentation : contains a compiled HTML file generated from the source code, which details the software components and APIs.
•
•
Drivers : contains the HAL drivers, the board-specific drivers for each supported board or hardware platform
(including the on-board components), and the CMSIS vendor-independent hardware abstraction layer for the
Cortex-M processor series.
Middlewares : contains libraries and protocols for BlueNRG Bluetooth low energy, USB Device Library,
Generic FAT File System Module (FatFs), PDM signal decoding and audio signal reconstruction when connecting an ST MEMS, the Meta Data Manager, MotionAR activity-recognition library, MotionCP carryposition recognition library, MotionFA fitness activity library, MotionFX (iNEMOEngine PRO) sensor fusion library, MotionGR gesture recognition library, MotionID motion intensity detection library, MotionPE real-time pose estimation library, MotionSD standing vs sitting desk detection library, MotionTL tilt measurement library, MotionVC vertical context library, AcousticSL sound source localization library, AcousticBF beam forming and BlueVoiceADPCM half-duplex voice-over-Bluetooth low energy communication profile.
•
•
Projects : contains a sample application used for transmitting the output of the sensor data and of the
MotionFX sensor fusion and e-Compass, MotionAR activity-recognition, MotionCP carry-position, MotionGR gesture recognition, AcousticSL sound source localization, AcousticBF beam forming and BlueVoiceADPCM over Bluetooth low energy libraries by using the Bluetooth low energy protocol provided for the NUCLEO-
F446RE / NUCLEO-F401RE / NUCLEO-L476RG , STEVAL-BCNKT01V1 and STEVAL-STLKT01V1 platforms through the IAR Embedded Workbench for ARM, RealView Microcontroller Development Kit ( MDK-ARM ) and Integrated Development Environment for STM32 ( STM32CubeIDE ).
Utilities : contains the boot loader binary ready to be flashed for the STM32F446RE , STM32F401RE ,
STM32L4R9ZI and STM32L476RG Nucleo boards.
Flash management
Apart from storing code, FP-SNS-ALLMEMS1 uses the flash memory for Firmware-Over-The-Air updates. It is divided into the following regions (see figure below):
1.
the first region contains a custom boot loader
2.
the second region contains the FP-SNS-ALLMEMS1 firmware
3.
The third region is used for storing the FOTA before the update
Even if the STM32F446RE / STM32F401RE (512 KB), the STM32L476RG (1024 KB), STM32L4R9ZI (2048 KB) cache sizes and arrangements differ, we have used the same FLASH arrangement for both. The Meta Data
Manager is placed at the end of the flash (0x08007000 for STM32F446RE/STM32F401RE, 0x080FF000 for
STM32L476RG and 0x081FF000 for STM32L4R9ZI). For more information, refer to:
•
•
RM0390 Reference manual STM32F446xx advanced ARM
®
-based 32-bit MCUs
RM0368 Reference manual STM32F401xB/C and STM32F401xD/E advanced ARM ® -based 32-bit MCUs
UM2059 - Rev 10 page 6/87
•
•
RM0351 Reference manual STM32L4x6 advanced ARM ® -based 32-bit MCUs
RM0432 Reference manual STM32L4Rxxx advanced ARM ® -based 32-bit MCUs
Figure 3. FP-SNS-ALLMEMS1 flash structure (STM32F401/STM32F446)
UM2059
The boot process
1.5
The boot process
The FP-SNS-ALLMEMS1 cannot not be flashed at the beginning of the flash (address 0x08000000), and is therefore compiled to run from the beginning of the second flash region, at 0x08004000.
To enable this behavior, we set the vector table offset in Src/system_stm32f4xx.c (for STM32F401 and
STM32F446) and Src/system_stm32l4xx.c (for STM32L476 and STM32R9ZI) thus: #define
VECT_TAB_OFFSET 0x4000 .
UM2059 - Rev 10 page 7/87
UM2059 - Rev 10
UM2059
The boot process
We also changed the linker script. For example, the Linker script for FP-SNS-ALLMEMS1 running on
STM32F401RE and compiled using IAR Embedded Workbench for ARM is: define symbol __ICFEDIT_intvec_start__ = 0x08004000;
/*-Memory Regions-*/ define symbol __ICFEDIT_region_ROM_start__ = 0x08004000; define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF;
/*-Sizes-*/ define symbol __ICFEDIT_size_cstack__ = 0x8000; define symbol __ICFEDIT_size_heap__ = 0x800;
Using the above linker script, the maximum usable code size is fixed at 240 KB.
You must flash the appropriate bootloader binary for STM32F446RE, STM32F401RE, STM32L476RG or
STM32L4R9ZI, found in the Utilities\BootLoader folder, to the first flash region (address 0x08000000).
Figure 4. BootLoader folder content
On any board reset:
• If there is a FOTA in the third Flash region, the boot loader overwrites the second Flash region (with FP-
SNS-ALLMEMS1 firmware) and replaces its content with the FOTA and restarts the board.
• If there is no FOTA, the boot loader jumps to the FP-SNS-ALLMEMS1 firmware.
Figure 5. FP-SNS-ALLMEMS1 boot sequence page 8/87
UM2059
The installation process
1.6
Note:
Note:
The installation process
For each platform ( NUCLEO-F446RE , NUCLEO-F401RE , NUCLEO-L476RG , STEVAL-BCNKT01V1 , STEVAL-
MKSBOX1V1 , STEVAL-STLKT01V1 ), there is a package binary directory that contains:
• pre-compiled ALLMEMS1 firmware that may be flashed with ST-LINK to the correct memory address
(0x08004000) of a supported STM32 Nucleo development board or evaluation boards
This pre-compiled binary is compatible with the FOTA update procedure
• pre-compiled ALLMEMS1 plus BootLoader firmware that may be directly flashed to a supported
Nucleo development board or evaluation board with the ST-LINK or via a Drag & Drop operation ( STM32
Nucleo development boards only)
STM32
This pre-compiled binary is not compatible with the FOTA update procedure
Figure 6. Binary folder content for NUCLEO-F446RE
UM2059 - Rev 10 page 9/87
UM2059 - Rev 10
UM2059
The installation process
A batch script has been provided to simplify this operation by saving the firmware and the BootLoader to the right position; it is available for each platform ( NUCLEO-F446RE , NUCLEO-F401RE , NUCLEO-L476RG , STEVAL-
BCNKT01V1 , STEVAL-MKSBOX1V1 and STEVAL-STLKT01V1 ) and for each IDE (IAR/RealView/
STM32CubeIDE ):
• IAR toolchain Embedded Workbench V8.32.3:
– For NUCLEO-F446RE : CleanALLMEMS1_IAR_IKS01A3_F446.bat or
CleanALLMEMS1_IAR_IKS01A2_F446.bat
– For NUCLEO-F401RE : CleanALLMEMS1_IAR_IKS01A3_F401.bat or
CleanALLMEMS1_IAR_IKS01A2_F401.bat
– For NUCLEO-L476RG : CleanALLMEMS1_IAR_IKS01A3_L476.bat or
CleanALLMEMS1_IAR_IKS01A2_L476.bat
– For STEVAL-BCNKT01V1 : CleanALLMEMS1_IAR_BC.bat
– For STEVAL-STLKT01V1 : CleanALLMEMS1_IAR_ST.bat
– For STEVAL-MKSBOX1V1 : CleanALLMEMS1_IAR_ST.box.bat
•
•
Integrated Development Environment for STM32 ( STM32CubeIDE ) V1.3.1:
– For NUCLEO-F446RE : CleanALLMEMS1_SW4STM32_IKS01A3_F446.bat or
CleanALLMEMS1_SW4STM32_IKS01A2_F446.bat
– For NUCLEO-F401RE : CleanALLMEMS1_SW4STM32_IKS01A3_F401.bat or
CleanALLMEMS1_SW4STM32_IKS01A2_F401.bat
– For NUCLEO-L476RG : CleanALLMEMS1_SW4STM32_IKS01A3_L476.bat or
CleanALLMEMS1_SW4STM32_IKS01A2_L476.bat
– For STEVAL-BCNKT01V1 : CleanALLMEMS1_SW4STM32_BC.bat
– For STEVAL-STLKT01V1 : CleanALLMEMS1_SW4STM32_ST.bat
– For STEVAL-MKSBOX1V1 : CleanALLMEMS1_SW4STM32_ST.box.bat
µVision toolchain - MDK-ARM Professional V5.29.0:
– For NUCLEO-F446RE : CleanALLMEMS1_MDK_ARM_IKS01A3_F446.bat or
CleanALLMEMS1_MDK_ARM_IKS01A2_F446.bat
– For NUCLEO-F401RE : CleanALLMEMS1_MDK_ARM_IKS01A3_F401.bat or
CleanALLMEMS1_MDK_ARM_IKS01A2_F401.bat
– For NUCLEO-L476RG : CleanALLMEMS1_MDK_ARM_IKS01A3_L476.bat or
CleanALLMEMS1_MDK_ARM_IKS01A2_L476.bat
– For STEVAL-BCNKT01V1 : CleanALLMEMS1_MDK_ARM_BC.bat
– For STEVAL-STLKT01V1 : CleanALLMEMS1_MDK_ARM_ST.bat
– For STEVAL-MKSBOX1V1 : CleanALLMEMS1_MDK_ARM_ST.box.bat
Figure 7. Content of a project folder for NUCLEO-F446RE page 10/87
This script:
• performs a full Flash erase to start from a clean system
• flashes the BootLoader to the correct position (0x08000000)
• flashes the firmware to the correct position (0x08004000)
UM2059
The installation process
UM2059 - Rev 10 page 11/87
Figure 8. BootLoader and ALLMEMS1 installation
UM2059
The installation process
UM2059 - Rev 10 page 12/87
UM2059
The installation process
The script also dumps an image containing the BootLoader and the firmware. This image file can be directly flashed to the beginning of the Flash memory as the image provided in the Binary folder.
Figure 9. ALLMEMS1 Dump process
UM2059 - Rev 10
•
•
•
•
•
For the Linux or iOS operating systems, there is a similar script that uses OpenOCD instead of the ST-LINK command line. The script is available for each platform, but is included only in STM32CubeIDE :
CleanALLMEMS1_SW4STM32_IKS01A3_F446.sh or CleanALLMEMS1_SW4STM32_IKS01A2_F446.sh.
CleanALLMEMS1_SW4STM32_IKS01A3_F401.sh or CleanALLMEMS1_SW4STM32_IKS01A2_F401.sh.
CleanALLMEMS1_SW4STM32_IKS01A3_L476.sh or CleanALLMEMS1_SW4STM32_IKS01A2_L476.sh.
CleanALLMEMS1_SW4STM32_BC.sh.
CleanALLMEMS1_SW4STM32_ST.sh.
• CleanALLMEMS1_SW4STM32_ST.box.sh
page 13/87
1.7
1.8
1.9
UM2059
Firmware-Over-The-Air (FOTA) update
To function, the script must be modified with:
• the installation path for OpenOCD
• the installation path for STM32 OpenOCD scritps
• and the Library path for OpenOCD
The OpenOCD script section to be edited is the following one.
# 1) Set the Installation path for OpenOCD
# example:
#OpenOCD_DIR="C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.external
tools.openocd.win32_1.3.0.202002181050/tools"
OpenOCD_DIR=""
# 2) Set the installation path for stm32 OpenOCD scritps
# example:
#OpenOCD_CFC="C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.op
enocd_1.3.0.202002181050/resources/openocd/st_scripts"
OpenOCD_CFC=""
# 3) Only for Linux/iOS add openocd library path to _LIBRARY_PATH:
# For iOS example:
#export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${OpenOCD_DIR}"lib/"
# For Linux example:
#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OpenOCD_DIR}"lib/"
Firmware-Over-The-Air (FOTA) update
The FP-SNS-ALLMEMS1 firmware can be updated Over-The-Air (FOTA) through an Android/iOS device via
Bluetooth using the STBLESensor application (ver. 4.2.1 and above) available on their respective application market stores.
The application sends the update and associated CRC (cyclic-redundancy-check) value, which the FP-SNS-
ALLMEMS1 checks against the hardware cyclic redundancy check calculation unit on the STM32F446RE /
STM32F401RE / STM32L476RG / STM32L4R9ZI processor to ensure integrity. If the CRC calculation matches the
STBLESensor CRC value, the new firmware is written to the beginning of the third Flash region. A “magic number” setting signals the boot loader that a Firmware update has been received and checked, and is ready to replace the current FP-SNS-ALLMEMS1 firmware.
APIs
Detailed user-API technical information with full function and parameter descriptions is available in a compiled
HTML file in the package “Documentation” folder.
Sample application description
•
•
A sample application using:
• the X-NUCLEO-IKS01A3 or X-NUCLEO-IKS01A2 , X-NUCLEO-CCA02M2 and X-NUCLEO-BNRG2A1 expansion boards with the NUCLEO-F446RE or NUCLEO-F401RE or NUCLEO-L476RG board
• the the the
STEVAL-BCNKT01V1
STEVAL-STLKT01V1
evaluation board
evaluation board
STEVAL-MKSBOX1V1 evaluation board
Ready to build projects are available for multiple IDEs.
With the NUCLEO-F446RE , NUCLEO-F401RE and NUCLEO-L476RG boards, you can set up a terminal window
phase.
UM2059 - Rev 10 page 14/87
UM2059
Sample application description
Note:
Note:
When connecting the micro-USB port to a PC, with STEVAL-MKSBOX1V1 and STEVAL-STLKT01V1 evaluation boards, you can set up a terminal window for the appropriate UART communication port (as per
device, this is only possible when the STEVAL-MKSBOX1V1 (or STEVAL-STLKT01V1 ) starts initializing. In fact, a
5-second (10-second) delay has been added to the initialization phase to allow the user to monitor its progress.
Due to Flash size constraints, for the STEVAL-STLKT01V1 this feature is available only when the SD card data logging is not enabled.
You must modify the ALLMEMS1_config.h file by enabling the //#define ALLMEMS1_ENABLE_PRINTF line to enable this feature for the STEVAL-STLKT01V1 or STEVAL-MKSBOX1V1 , as it is disabled by default.
The SD card data logging is enabled by default. You must modify the ALLMEMS1_config.h file by disabling the
#define ALLMEMS1_ENABLE_SD_MEMS_RECORDING line to disable this feature for the STEVAL-STLKT01V1 or STEVAL-MKSBOX1V1 .
Figure 10. Terminal setting
UM2059 - Rev 10
•
•
•
•
•
•
When you first press the reset button, the application:
• starts initializing the UART interface
• writes whether the firmware is compiled for X-NUCLEO-IKS01A3 checks whether all the sensors are present and working determines if the BlueNRG expansion board ( board as well as the hardware and firmware version information
or
X-NUCLEO-BNRG2A1
X-NUCLEO-IKS01A2
) is connected to the STM32 Nucleo shows a random BLE MAC address initializes the BLE hardware service (adding the temperature, humidity, pressure, 3D gyroscope, 3D magnetometer, 3D accelerometer, microphone and Gas Gauge IC characteristics) and the BLE software service (adding the MotionFX, MotionAR, MotionCP, MotionFA, MotionGR, MotionID, MotionPE, MotionSD,
MotionVC, AcousticSL, AcousticBF and BlueVoiceADPCM) initializes the BLE console service adding the stdin/stdout and stderr characteristics initializes the BLE configuration service to enable the hardware features:
– for LSM6DSL mounted on the X-NUCLEO-IKS01A2 expansion board (for Nucleo L4 only)
– for LSM6DSO mounted on the X-NUCLEO-IKS01A3 expansion board (for Nucleo L4 only)
X-NUCLEO-IKS01A3 is mounted (for Nucleo L4 only), or if the X-NUCLEO-IKS01A2 is mounted (for Nucleo L4 only), it can generate an interrupt due to free fall, tilt, wake up, single tap, double tap, 6D position or pedometer events, transmitted over Bluetooth to the connected Android™/iOS™ device.
page 15/87
Figure 11. Initialization phase
UM2059
Sample application description
Note:
As shown in the console output above, the application sends:
•
•
•
•
3 short precision quaternions every 30 ms temperature/humidity/pressure data every 500 ms
3D accelerometer, 3D gyroscope and 3D magnetometer data every 50 ms signal noise microphone levels every 50 ms
You can change the transmission frequency of the sensor data via the STBLESensor Android/iOS application.
This application reads the accelerometer, magnetometer and gyroscope values at 100 samples/second. The
MotionFX (iNEMOEngine PRO) library combines these sensor values to produce and transmit 100 quaternions/ second to the client connected via Bluetooth low energy to reflect real motion using a vendor-specific BLE service.
The above also applies to the STEVAL-STLKT01V1 , STEVAL-MKSBOX1V1 and STEVAL-BCNKT01V1 evaluation boards.
UM2059 - Rev 10 page 16/87
UM2059
Sample application description
These definitions in ALLMEMS1_config.h control the number of quaternions sent by the application to the
Bluetooth client:
• QUAT_UPDATE_MUL_10MS : defines the transmission rate for each set of quaternions by multiple of 10 ms.
• SEND_N_QUATERNIONS : defines the number of quaternions sent to each Bluetooth package.
By default, the application sends 3 quaternions every 30 ms.
The same allmems1_config.h file also defines:
• ALLMEMS1_DEBUG_CONNECTION and ALLMEMS1_DEBUG_NOTIFY_TRAMISSION to enable some debugging information for BLE communication
The MotionFX (INEMOEngine PRO) library has an auto-calibrating procedure and the calibration status is transmitted via BLE to the client:
• on the NUCLEO-F446RE or NUCLEO-F401RE or NUCLEO-L476RG boards, you can press the user button to reset the library calibration status and force a new auto-calibration procedure.
• for the STEVAL-STLKT01V1 , STEVAL-MKSBOX1V1 and STEVAL-BCNKT01V1 evaluation boards, this procedure can be done only through the STBLESensor application.
•
•
•
•
The MotionAR library is able to recognize the following activities:
• stationary
• walking fast walking jogging biking driving
•
•
•
•
•
•
The MotionCP library recognizes and provides real-time information about how the user is carrying the board, which equates to the phone carry position (feature not available on STEVAL-BCNKT01V1 , NUCLEO-F446RE and
NUCLEO-F401RE ): on desk in hand near head shirt pocket trouser pocket arm swing
The MotionFA library is able to count the number of bicep curls, squats and push-ups performed by a user
(feature not available on STEVAL-BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE )
Important:
For NUCLEO-L476RG and STEVAL-STLKT01V1 boards, due to flash size constraints, the MotionCP and MotionFA features are not available together. As default the MotionFA is enabled.
You must modify the ALLMEMS1_config.h file by disabling the #define ALLMEMS1_MOTIONFA to disable the MotionFA and enable MotionCP.
•
•
The MotionGR library is able to recognize gestures like (feature not available on STEVAL-BCNKT01V1 ,
NUCLEO-F446RE and NUCLEO-F401RE ):
• pick up glance wake up in hand
The MotionID library is able to distinguish motion intensity in a range from 0 to 10 (according to the library indexes) corresponding to the following activities: on desk, hand on bed/couch/cushion, light movements, biking, typing/writing, high intensity typing/slow walking, washing hands/walking, fast walking/jogging, running/brushing teeth, sprinting (feature not available on STEVAL-BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE ).
UM2059 - Rev 10 page 17/87
UM2059 - Rev 10
UM2059
Sample application description
•
•
The MotionPE library is able to distinguish the poses like (feature not available on STEVAL-BCNKT01V1 ,
NUCLEO-F446RE and NUCLEO-F401RE ):
• sitting standing lying down.
The MotionSD library is able to distinguish the user working modes like (feature not available on STEVAL-
BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE ):
• sitting at the desk
• standing desk
•
•
•
•
•
The MotionTL library is able to provide real-time information about the tilt angles of the user device and it is also able to perform accelerometer 6-position calibration (feature not available on STEVAL-BCNKT01V1 , NUCLEO-
F446RE and NUCLEO-F401RE ).
The MotionVC library is able to distinguish the type of vertical movement like (feature not available on STEVAL-
BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE ): on floor up/down stairs elevator escalator
The AcousticSL library can localize audio sound sources using the data acquired from microphones (feature not available on the STEVAL-STLKT01V1 and STEVAL-MKSBOX1V1 ).
The AcousticBF library provides real-time beam forming software, using the audio signals acquired from two digital MEMS microphones, it creates a virtual directional microphone pointing to a fixed direction in space
(feature available only on the STEVAL-BCNKT01V1 ).
The BlueVoiceADPCM library implements a vendor-specific profile enabling voice communication with Bluetooth low energy (feature available on the STEVAL-BCNKT01V1 and STEVAL-STLKT01V1 ).
The FatFs library provides access to the storage devices for sensor data logging (feature available for STEVAL-
STLCS01V1 and STEVAL-MKSBOX1V1 ).
When an Android/iOS device is connected to the NUCLEO-F446RE , NUCLEO-F401RE , NUCLEO-L476RG ,
STEVAL-MKSBOX1V1 or STEVAL-STLKT01V1 (if the define #define ALLMEMS1_ENABLE_PRINTF is enabled) board, you can control data transmitted via the board.
page 18/87
UM2059
Sample application description
Figure 12. UART console output when a device is connected to the board
UM2059 - Rev 10
For the STEVAL-STLKT01V1 and STEVAL-MKSBOX1V1 , when the Android/iOS device is not connected for more than 20 seconds, the board enters in shutdown mode, which can be enabled or disabled by the macro
ENABLE_SHUT_DOWN_MODE .
The accelerometer events can be selected and used to wake the board up to connect it to Android/iOS again via the constant WakeupSource in the file main.c
. The Double Tap event is set as default.
page 19/87
UM2059
Android and iOS sample client application
1.10
1.10.1
Through the define #define RANGE_TIME_WITHOUT_CONNECTED in the main.h
file, it is possible to modify this time value.
Android and iOS sample client application
The FP-SNS-ALLMEMS1 software for STM32Cube is compatible with STBLESensor Android/iOS applications
(ver. 4.4.0 or higher) available at the respective Play/iOS stores.
The STBLESensor allows Over-The-Air firmware updates. Version 3.2.0 or higher is required to display battery information (remaining charge, voltage and charge status) for the STEVAL-BCNKT01V1 , STEVAL-MKSBOX1V1 or STEVAL-STLKT01V1 evaluation boards.
STBLESensor version 3.5.0 or higher is required to show the Source Localization and Beam Forming pages.
STBLESensor version 3.6.0 or higher is required to show the Multi Events detection and the battery information for STEVAL-BCNKT01V1 .
STBLESensor version 3.7.0 or higher is required to show the data logging setting on the SD card for the STEVAL-
STLKT01V1 .
STBLESensor version 4.4.0 or higher is required to show the MotionFA, MotionID, MotionPE, MotionSD,
MotionTL and MotionVC features for NUCLEO-L476RG and STEVAL-STLKT01V1 .
We will use the Android application for this demonstration.
Main page
Following connection, STBLESensor starts with the main page shown below, where the values of temperature, pressure and humidity are displayed.
Figure 13. STBLESensor (Android version) main page following BLE connection
UM2059 - Rev 10 page 20/87
UM2059
Android and iOS sample client application
1.10.2
MEMS sensor fusion
If the MotionFX sensor fusion library is enabled, the following page shows a cube that rotates with board movement.
Figure 14. STBLESensor (Android version) MotionFX sensor fusion page
UM2059 - Rev 10
On this page, there are two buttons along the bottom:
•
• the left one is for resetting the cube position.
the right one shows the calibration status of the MotionFX library (black for not calibrated, green for calibrated). Clicking it forces a magneto calibration.
When either button is pressed, the application pops up a window describing how to position the board for correct cube rotation and how to move the board to facilitate calibration (see figure below).
page 21/87
UM2059
Android and iOS sample client application
Figure 15. STBLESensor (Android version) popup windows
1.10.3
Plot data
On the next page to the left, you can plot any value from the sensor expansion boards.
UM2059 - Rev 10 page 22/87
UM2059
Android and iOS sample client application
Figure 16. STBLESensor (Android version) accelerometer plot
1.10.4
Settings, serial and debug console
•
•
In the option menu below, you can open:
• Settings
Serial or Debug (with stdin) console
Firmware upgrade
UM2059 - Rev 10 page 23/87
UM2059
Android and iOS sample client application
Figure 17. STBLESensor (Android version) menu selection
UM2059 - Rev 10
If Settings is selected, it is possible to change the node name using the node configuration, as shown below.
page 24/87
UM2059 - Rev 10
UM2059
Android and iOS sample client application
Figure 18. STBLESensor (Android version) Settings, Node Configuration, Local Name
If the Serial console is enabled, stdout/stderr is displayed, as shown below.
page 25/87
UM2059
Android and iOS sample client application
Figure 19. STBLESensor (Android version) Debug console (stdin/stdout/stderr)
UM2059 - Rev 10 page 26/87
UM2059
Android and iOS sample client application
1.10.4.1
Note:
1.10.5
You can change the transmission frequency of the sensor values through the debug console:
• for temperature/humidity/pressure with the command:
– @TM: the application sends environmental data every 5 s
•
– @TH: the application sends environmental data every 1 s
– @TL: the application sends environmental data every 100 ms
– @TD: the application sends environmental data at the default rate (500 ms) for 3D accelerometer, 3D gyroscope and 3D magnetometer with the command:
– @AM: the application sends the data every 5 s
– @AH: the application sends the data every 1 s
•
– @AL: the application sends the data every 100 ms
– @AD: the application sends the data at the default rate (50 ms) for signal noise microphone levels with the command:
– @MM: the application sends the data every 5 s
– @MH: the application sends the data every 1 s
– @ML: the application sends the data every 100 ms
– @MD: the application sends the data at the default rate (50 ms)
SD card data logging
SD data logging is available (for the STEVAL-STLKT01V1 (SensorTile) and STEVAL-MKSBOX1V1
(SensorTile.box) using Generic FAT File System middleware) for environmental (temperature, pressure, humidity), magnetometer, gyroscope, accelerometer and audio data.
•
•
The debug console commands to start the data logging are:
• Start : to start the data logging for enviromental, accelerometer, magnetometer and gyroscope data.
•
Stop : to stop the data logging for enviromental, accelerometer, magnetometer and gyroscope data.
AudioStart
AudioStop
: to start the data logging for audio data.
: to stop the data logging for audio data.
It is not possible to start the data logging for MEMS and audio data simultaneously.
When the data logging (audio or MEMS) starts, the other STBLESensor app functions are disabled and the data logging goes on even if the app is closed.
To stop the data logging, it is necessary to open the app.
•
Enable hardware features
•
•
There is another page where you can choose which hardware feature to enable (one at the time) and view the events (see following figures) on the same page from:
•
LSM6DSL
LSM6DSO
LSM6DSM
on
on
for
X-NUCLEO-IKS01A2
X-NUCLEO-IKS01A3
expansion board for
expansion board for
STEVAL-BCNKT01V1 and
NUCLEO-L476RG
NUCLEO-L476RG
STEVAL-STLKT01V1 board
board only
board only
LSM6DSOX for STEVAL-MKSBOX1V1 evaluation board
The orientation hardware feature is the default setting.
UM2059 - Rev 10 page 27/87
UM2059
Android and iOS sample client application
Figure 20. STBLESensor (Android version) orientation hardware feature
UM2059 - Rev 10
From the Accelerometer events menu, a single hardware feature can be selected.
page 28/87
UM2059
Android and iOS sample client application
Figure 21. STBLESensor (Android version) hardware feature menu
UM2059 - Rev 10 page 29/87
UM2059
Android and iOS sample client application
Figure 22. STBLESensor (Android version) hardware feature examples
UM2059 - Rev 10 page 30/87
UM2059
Android and iOS sample client application
Figure 23. STBLESensor (Android version) multiple hardware feature
1.10.6
Note:
•
•
Activity recognition
•
•
For the MotionAR algorithm, the page below is shown, signaling one of the following recognized activities:
• stationary
• walking fast walking jogging biking driving
As the algorithm has to collect data before recognizing any activity, all the images are shown in a lighter blue for few seconds after the demo starts.
UM2059 - Rev 10 page 31/87
UM2059
Android and iOS sample client application
Figure 24. STBLESensor (Android version) MotionAR activity recognition page
1.10.7
Note:
•
•
•
Carry position
•
•
For the MotionCP algorithm, the page below is shown, with information about how the user is carrying the board, which equates to phone carry positions (feature not available on STEVAL-BCNKT01V1 , NUCLEO-F446RE and
NUCLEO-F401RE ):
• on desk in hand near head shirt pocket trousers pocket arm swing
As the algorithm has to collect data before recognizing any activity, all the images are shown in grayscale for few seconds after the demo starts.
UM2059 - Rev 10 page 32/87
UM2059
Android and iOS sample client application
Important:
For NUCLEO-L476RG and STEVAL-STLKT01V1 boards, due to flash size constraints, the MotionCP and MotionFA features are not available together. As default the MotionFA is enabled.
You must modify the ALLMEMS1_config.h file by disabling the #define ALLMEMS1_MOTIONFA to disable the MotionFA and enable MotionCP.
Figure 25. STBLESensor (Android version) MotionCP carry position recognition page
1.10.8
Gesture recognition
If the MotionGR algorithm is enabled, the page shown below is available with gesture recognition information like
(feature not available on STEVAL-BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE ):
• glance: the user moves the device to look at the display (in our example, to look at the sensor)
UM2059 - Rev 10 page 33/87
UM2059
Android and iOS sample client application
•
• pick up: the user picks up the device wake up: the user shakes the device
Each time an event is detected, the icon animates and becomes colored. After three seconds, or when a new event arrives, the icon goes gray again.
Figure 26. STBLESensor (Android version) MotionGR gesture recognition page
1.10.9
Intensity detection
For the MotionID algorithm , the page below is shown (feature not available on STEVAL-BCNKT01V1 , NUCLEO-
F446RE and NUCLEO-F401RE ).
UM2059 - Rev 10 page 34/87
UM2059
Android and iOS sample client application
Figure 27. STBLESensor (Android version) Motion Intensity page
1.10.10
Motion algorithms
For the MotionPE, MotionSD and MotionVC algorithms, the Motion Algorithms page below is shown (feature not available on STEVAL-BCNKT01V1 , NUCLEO-F446RE and NUCLEO-F401RE ).
UM2059 - Rev 10 page 35/87
UM2059
Android and iOS sample client application
Figure 28. STBLESensor (Android version) Motion Algorithms page - menu
UM2059 - Rev 10
•
•
The MotionPE algorithm provides real-time information about the user current pose based on data from a device.
It is able to distinguish the following poses: sitting standing
• lying down page 36/87
UM2059 - Rev 10
UM2059
Android and iOS sample client application
Figure 29. STBLESensor (Android version) Motion Algorithms page - MotionPE algorithm
The MotionSD algorithm provides real-time information about the user working mode:
• sitting at the desk
• standing desk position page 37/87
UM2059
Android and iOS sample client application
Figure 30. STBLESensor (Android version) Motion Algorithms page - MotionSD algorithm
UM2059 - Rev 10
•
•
•
•
The MotionVC algorithm provides real-time information about vertical movement. The library is able to detect a change of altitude and distinguish the type of vertical movement: floor up/down stairs elevator
• escalator page 38/87
UM2059
Android and iOS sample client application
Figure 31. STBLESensor (Android version) Motion Algorithms page - MotionVC algorithm
1.10.11
Fitness activities
For the MotionFA algorithm, the page below is shown (feature not available on STEVAL-BCNKT01V1 , NUCLEO-
F446RE and NUCLEO-F401RE ).
It provides real-time information about the repetition quantity of various fitness activities performed by a user. It is able to count the number of bicep curls, squats and push-ups.
UM2059 - Rev 10 page 39/87
UM2059
Android and iOS sample client application
Important:
For NUCLEO-L476RG and STEVAL-STLKT01V1 boards, due to flash size constraints, the MotionCP and MotionFA features are not available together. As default the MotionFA is enabled.
You must modify the ALLMEMS1_config.h file by disabling the #define ALLMEMS1_MOTIONFA to disable the MotionFA and enable MotionCP.
Figure 32. ST BLE Sensor (Android version) Fitness Activities page - menu
UM2059 - Rev 10 page 40/87
UM2059
Android and iOS sample client application
Figure 33. ST BLE Sensor (Android version) Fitness Activities page - biceps curl, squat, push up)
1.10.12
Tilt measurement
For the MotionTL algorithm, the page below is shown (feature not available on STEVAL-BCNKT01V1 , NUCLEO-
F446RE and NUCLEO-F401RE ).
It provides real-time information about the tilt angles of the user device.
UM2059 - Rev 10 page 41/87
UM2059
Android and iOS sample client application
Figure 34. STBLESensor (Android version) level page
UM2059 - Rev 10
•
•
The library is also able to perform accelerometer 6-position calibration. In this case, the debug console must be used and send these commands:
TLcalibstart: to start the accelerometer 6-position calibration
TLcalibstop: to stop the calibration (the process fails)
When the command to start the calibration is sent, you must place the board at position 1 and send the command
"next" and so on for all the six positions.
In the end, when the calibration of position 6 is executed, the firmware gives a feedback whether the calibration has been performed or failed.
To obtain the accelerometer calibration you have to put the board in the correct sequence as shown below.
page 42/87
UM2059
Android and iOS sample client application
Figure 35. Accelerometer calibration sequence
1.10.13
E-compass
For the MotionFX sensor fusion library, the following page shows an e-compass that rotates with board movement.
Figure 36. STBLESensor (Android version) MotionFX page
UM2059 - Rev 10
On the page bottom, the right button shows the MotionFX library calibration status (black for not calibrated, green for calibrated). Clicking it forces a magneto calibration.
page 43/87
UM2059
Android and iOS sample client application
1.10.14
•
•
BlueVoiceADPCM voice
If the BlueVoiceADPCM voice over BLE library is enabled (feature available on STEVAL-BCNKT01V1 and
STEVAL-STLKT01V1 evaluation boards), the following page is available with the following functions:
• Play back the audio stream received from the ST device
Audio playback recording
Enable/disable beamforming (if available)
Figure 37. STBLESensor (Android version) BlueVoice page
1.10.14.1
The audio playback begins as soon as the streaming from the peripheral node starts. The volume can be adjusted using the slider or muted by clicking on the speaker icon.
Speech to text
If the BlueVoice library is enabled, the following page is also available. This page is dedicated to the cloud speech to text services.
UM2059 - Rev 10 page 44/87
UM2059
Android and iOS sample client application
Figure 38. STBLESensor (Android version) Speech to text page
1.10.15
RELATED LINKS
Visit STBLESensor applicaton web page on www.st.com for further information
Direction of Arrival
If the AcousticSL library is enabled, Direction of Arrival item is shown in the plot length menu (feature not available on the STEVAL-STLKT01V1 and STEVAL-MKSBOX1V1 ).
UM2059 - Rev 10 page 45/87
UM2059
Android and iOS sample client application
Figure 39. STBLESensor (Android version) Direction of Arrival menu selection
UM2059 - Rev 10
If the Direction of Arrival menu item is selected, the audio sound source localization algorithm is activated and the associated plot is shown.
page 46/87
UM2059
Android and iOS sample client application
Figure 40. STBLESensor (Android version) audio source localization plot example
UM2059 - Rev 10
Again, if the audio sound source localization algorithm is activated, the pages shown below are available.
page 47/87
UM2059
Android and iOS sample client application
Figure 41. STBLESensor (Android version) audio source localization BlueCoin Page
UM2059 - Rev 10 page 48/87
UM2059
Android and iOS sample client application
Figure 42. STBLESensor (Android version) audio source localization STM32 Nucleo Page
1.10.16
In a noisy environment, use low sensitivity.
Beam Forming
If the AcousticBF library is enabled, the pages shown below are available (feature available only on STEVAL-
BCNKT01V1 ):
UM2059 - Rev 10 page 49/87
UM2059
Android and iOS sample client application
Figure 43. STBLESensor (Android version) audio beam forming BlueCoin Page
1.10.17
The AcousticBF provides real-time beam forming software, using the audio signals acquired from two digital
MEMS microphones, it creates a virtual directional microphone pointing to a fixed direction in space.
From the STBLESensor beam forming page, you can set the direction in space to create microphone with a virtual direction.
SD Logging
This page shows SD Logging setting for STEVAL-STLKT01V1 and STEVAL-MKSBOX1V1 .
UM2059 - Rev 10 page 50/87
UM2059
Android and iOS sample client application
Figure 44. STBLESensor (Android version) SD Logging information
Note:
1.10.18
When the data logging starts, the other STBLESensor app functions are disabled and the data logging goes on even if the app is closed.
If the logging interval is more then 20 seconds (when the Android/iOS device is not connected and the logging has started), the board enters in shutdown mode.
Through the define #define RANGE_TIME_WITHOUT_CONNECTED in the main.h
file, it is possible to modify this time value.
The RTC alarm is used to wake the board up to log the selected data with the logging interval chosen.
The accelerometer events can be selected and used to wake the board up and connect it to the Android/iOS device to stop the logging.
The wakeup sorce accelerometer event can be selected by setting the constant WakeupSource in the main.c
file.
The Double Tap event is set as default.
Rssi and battery
This page shows RSSI of the Bluetooth signal strength and, for STEVAL-STLKT01V1 , STEVAL-MKSBOX1V1 and
STEVAL-BCNKT01V1 , if the battery is connected, the charge percentage, measured voltage and battery status
(charging/discharging/low battery).
UM2059 - Rev 10 page 51/87
UM2059
Firmware-Over-The-Air update with STBLESensor
Figure 45. STBLESensor (Android version) Battery and RSSI information
1.11
The RSSI value is updated every 0.5 seconds.
For STEVAL-BCNKT01V1 and STEVAL-MKSBOX1V1 the current value is not available.
Firmware-Over-The-Air update with STBLESensor
If the 'Firmware upgrade' option menu (see Figure 17. STBLESensor (Android version) menu selection
) is selected, the following page appears.
UM2059 - Rev 10 page 52/87
UM2059
Firmware-Over-The-Air update with STBLESensor
Figure 46. STBLESensor (Android version) firmware upgrade page
UM2059 - Rev 10
The STBLESensor application shows which version of the FP-SNS-ALLMEMS1 software is running and the board type. To apply an update, press the red button and choose the appropriate file.
page 53/87
UM2059 - Rev 10
UM2059
Firmware-Over-The-Air update with STBLESensor
Figure 47. STBLESensor (Android version) firmware update file selection
STBLESensor sends the FP-SNS-ALLMEMS1 a command communicating that it is going to send an update of a certain byte size and corresponding CRC value.
Figure 49. Terminal window feedback during FOTA shows the terminal window with the debug information
returned during FOTA for an STM32 Nucleo platform when we use a UART to control FP-SNS-ALLMEMS1 behavior.
STBLESensor displays a progress bar during the FOTA procedure, followed by the total upload time on completion.
page 54/87
UM2059
Firmware-Over-The-Air update with STBLESensor
Figure 48. STBLESensor (Android application) feedback during and after FOTA transmission
UM2059 - Rev 10
On completion of FOTA transmission, the STM32 uses the CRC hardware unit to compute the CRC value for the
FOTA received. If this CRC matches the expected CRC previously sent by the BlueMS application, FP-SNS-
ALLMEMS1 writes a code number to signal the BootLoader there is an OTA ready to be applied.
As the following figure shows, the BootLoader applies the OTA at the next board reboot and executes the new
FP-SNS-ALLMEMS1 firmware.
page 55/87
UM2059
Firmware-Over-The-Air update with STBLESensor
Figure 49. Terminal window feedback during FOTA
UM2059 - Rev 10 page 56/87
UM2059
System setup guide
2 System setup guide
2.1
2.1.1
Hardware description
STM32 Nucleo
STM32 Nucleo development boards provide an affordable and flexible way for users to test solutions and build prototypes with any STM32 microcontroller line.
The Arduino™ connectivity support and ST morpho connectors make it easy to expand the functionality of the
STM32 Nucleo open development platform with a wide range of specialized expansion boards to choose from.
The STM32 Nucleo board does not require separate probes as it integrates the ST-LINK/V2-1 debugger/ programmer.
The STM32 Nucleo board comes with the comprehensive STM32 software HAL library together with various packaged software examples for different IDEs (IAR EWARM, Keil MDK-ARM, STM32CubeIDE , mbed and GCC/
LLVM).
All STM32 Nucleo users have free access to the mbed online resources (compiler, C/C++ SDK and developer community) at www.mbed.org to easily build complete applications.
Figure 50. STM32 Nucleo board
2.1.2
Information regarding the STM32 Nucleo board is available at www.st.com/stm32nucleo
X-NUCLEO-CCA02M2 expansion board
The X-NUCLEO-CCA02M2 expansion board has been designed around MP34DT06J digital MEMS microphone.
It is compatible with the ST morpho connector layout and with digital microphone coupon boards such as
STEVAL-MIC001V1 , STEVAL-MIC002V1 and STEVAL-MIC003V1 .
The X-NUCLEO-CCA02M2 embeds two MP34DT06J microphones and allows synchronized acquisition and streaming of up to 4 microphones through I²S, SPI, DFSDM or SAI peripherals.
UM2059 - Rev 10 page 57/87
UM2059
Hardware description
It represents a quick and easy solution for the development of microphone-based applications as well as a starting point for audio algorithm implementation.
Figure 51. X-NUCLEO-CCA02M2 expansion board
2.1.3
X-NUCLEO-BNRG2A1 expansion board
The X-NUCLEO-BNRG2A1 expansion board provides Bluetooth low energy connectivity for developer applications and can be plugged onto an STM32 Nucleo development board (e.g., NUCLEO-L476RG with ultralow power STM32 microcontroller) through its Arduino UNO R3 connectors.
The expansion board features the Bluetooth
®
v5.0 compliant and FCC certified BlueNRG-M2SP application processor module based on the ST BlueNRG-2 System-on-Chip. This SoC manages the complete Bluetooth low energy stack and protocols on its Cortex-M0 core and programmable Flash, which can accommodate custom applications developed using the SDK. The BlueNRG-M2SP module supports master and slave modes, increased transfer rates with data length extension (DLE), and AES-128 security encryption.
The X-NUCLEO-BNRG2A1 interfaces with the STM32 Nucleo microcontroller via SPI connections and GPIO pins, some of which can be configured by the hardware.
UM2059 - Rev 10 page 58/87
Figure 52. X-NUCLEO-BNRG2A1 BLE expansion board
UM2059
Hardware description
2.1.4
Information about the X-NUCLEO-BNRG2A1 expansion board is available at http://www.st.com/x-nucleo .
X-NUCLEO-IKS01A2 expansion board
The X-NUCLEO-IKS01A2 is a motion MEMS and environmental sensor expansion board for STM32 Nucleo.
It is compatible with the Arduino UNO R3 connector layout, and is designed around the LSM6DSL 3D accelerometer and 3D gyroscope, the LSM303AGR 3D accelerometer and 3D magnetometer, the HTS221 humidity and temperature sensor and the LPS22HB pressure sensor.
The X-NUCLEO-IKS01A2 interfaces with the STM32 microcontroller via the I²C pin, and it is possible to change the default I²C port.
UM2059 - Rev 10 page 59/87
UM2059
Hardware description
Figure 53. X-NUCLEO-IKS01A2 MEMS and environmental sensor expansion board
2.1.5
X-NUCLEO-IKS01A3 expansion board
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 features the LSM6DSO 3-axis accelerometer + 3axis gyroscope, the LIS2MDL 3-axis magnetometer, the LIS2DW12 3-axis accelerometer, the HTS221 humidity and temperature sensor, the LPS22HH pressure sensor, and the STTS751 temperature sensor.
The X-NUCLEO-IKS01A3 interfaces with the STM32 microcontroller via the I²C pin, and it is possible to change the default I²C port.
Figure 54. X-NUCLEO-IKS01A3 MEMS and environmental sensor expansion board
UM2059 - Rev 10 page 60/87
2.1.6
2.1.6.1
2.1.6.2
UM2059
Hardware description
STEVAL-BCNKT01V1 BlueCoin development kit
Description
The STEVAL-BCNKT01V1 integrated development and prototyping platform for augmented acoustic and motion sensing for IoT applications builds on the listening and balancing capabilities of the human ear.
With the expanded capabilities of its starter kit, BlueCoin lets you explore advanced sensor fusion and signal processing functions for robotics and automation applications with a 4 digital MEMS microphone array, a highperformance 9-axis inertial and environmental sensor unit and time-of-flight ranging sensors.
A high-performance STM32F446 180 MHz MCU enables real-time implementation of the very advanced sensor fusion algorithms like adaptive beamforming and sound source localization, with ready-to-use, royalty-free building blocks.
The BlueCoin can connect via the on-board BLE link to any IoT and smart industry wireless sensor network.
To upload new firmware onto the BlueCoin an external SWD debugger (not included in the starter-kit) is needed. It is recommended to use the ST-Link V2.1 found on any "STM32 Nucleo-64” development board.
Features
•
•
•
•
Contains FCC ID: S9NBCOIN01
Contains module IC 8976C-BCOIN01 certified with PMN: STEVAL-BCNKT01V1 ; HVIN: STEVAL-
BCNCS01V1; HMN: STEVAL-BCNCR01V1; FVIN: bluenrg_7_2_c_Mode_2-32MHz-XO32K_4M.img
The development kit package includes:
– BlueCoin module (STEVAL-BCNCS01V1) with STM32F446, LSM6DSM , LSM303AGR , LPS22HB , 4x
MP34DT06J , BlueNRG-MS , BALF-NRG-01D3 , STBC03JR
– CoinStation (STEVAL-BCNST01V1) board
– BlueCoin Cradle (STEVAL-BCNCR01V1)
– 130 mAh Li-Po battery
– Plastic box for housing the BlueCoin cradle and the battery
– SWD programming cable
Software libraries and tools:
– STSW-BCNKT01 firmware package with raw sensor data streaming support via USB, data logging on
SD card, audio acquisition and audio streaming, time-of-flight example and BLE protocol to interface to a smartphone app
– FP-AUD-SMARTMIC1 : smart audio IN-OUT software expansion for STM32Cube
– FP-SNS-ALLMEMS1 and FP-SNS-ALLMEMS2 : STM32Cube function packs for BLE and sensors
– FP-AUD-BVLINK1 : BLE and microphones software expansion for STM32Cube
– BlueMS : iOS™ and Android™ demo apps
– BlueST-SDK : iOS and Android software development kit
– Compatible with STM32 ecosystem through STM32Cube support
UM2059 - Rev 10 page 61/87
UM2059
Hardware description
2.1.6.3
•
•
•
Content of the starter kit
STEVAL-BCNCS01V1 - BlueCoin Core System board features
• Very compact module for motion, audio and environmental sensing and Bluetooth low energy connectivity with a complete set of firmware examples
• Main components:
– STM32F446 – 32-bit high-performance MCU (ARM ® Cortex ® -M4 with FPU)
– 4x MP34DT06JTR – 64dB SNR Digital MEMS microphone
– LSM6DSM – iNEMO inertial module: 3D accelerometer and 3D gyroscope
– LSM303AGR – ultra-compact high-performance eCompass module: ultra-low power 3D accelerometer and 3D magnetometer
– LPS22HB – MEMS nano pressure sensor: 260-1260 hPa absolute digital output barometer
– BlueNRG-MS – Bluetooth low energy network processor
– BALF-NRG-01D3 – 50 Ω balun with integrated harmonic filter
– STBC03JR – linear battery charger with 150 mA LDO 3.0 V
External interfaces: UART, SPI, SAI (Serial Audio Interface), I²C, USB OTG, ADC, GPIOs, SDIO, CAN, I2S
SWD interface for debugging and programming capability
The Bluetooth radio power output is set by default to 0 dBm; the FCC and IC certifications refer to this operating value. The power output can be changed up to 8 dBm by reprogramming the device firmware, but this change will require an update of the FCC and IC certifications, with additional radio emission tests to be performed.
Figure 55. STEVAL-BCNCS01V1 - BlueCoin Core System
UM2059 - Rev 10
•
•
•
•
STEVAL-BCNCR01V1 - BlueCoin Cradle board features
• BlueCoin Cradle board with BlueCoin connectors
ST1S12XX – 3.3 V step down DC-DC converter
USBLC6-2P6 – very low capacitance ESD protection
USB type A to Mini-B USB connector for power supply and communication microSD card socket page 62/87
Figure 56. STEVAL-BCNCR01V1 - BlueCoin Cradle board
UM2059
Hardware description
•
•
•
•
•
•
STEVAL-BCNST01V1 - CoinStation board features
• CoinStation expansion board with BlueCoin connectors
•
LDK120M-R
Reset button
– 200 mA low quiescent current very low noise LDO
USBLC6-2P6 – very low capacitance ESD protection for USB
2x VL53L0X Time-of-Flight (ToF) ranging sensor
16-Bit, low-power stereo audio DAC and 3.5 mm jack socket
Micro-USB connector for power supply and communication
SWD connector for programming and debugging
Figure 57. STEVAL-BCNST01V1 - CoinStation board
2.1.7
STEVAL-MKSBOX1V1 evaluation kit
The STEVAL-MKSBOX1V1 (SensorTile.box) is a ready-to-use box kit with wireless IoT and wearable sensor platform to help you use and develop apps based on remote motion and environmental sensor data, regardless of your level of expertise.
The SensorTile.box board fits into a small plastic box with a long-life rechargeable battery, and the ST BLE
Sensor app on your smartphone connects via Bluetooth to the board and allows you to immediately begin using the wide range of default IoT and wearable sensor applications.
UM2059 - Rev 10 page 63/87
UM2059
Hardware description
In Expert Mode, you can build customs apps from your selection of SensorTile.box sensors, operating parameters, data and output types, and special functions and algorithms available. This multi sensor kit therefore allows you to design wireless IoT and wearable sensor applications quickly and easily, without performing any programming.
SensorTile.box includes a firmware programming and debugging interface that allows professional developers to engage in more complex firmware code development using the STM32 Open Development Environment (STM32
ODE), which includes a sensing AI function pack with neural network libraries.
Figure 58. STEVAL-MKSBOX1V1 evaluation kit
2.1.8
2.1.8.1
2.1.8.2
STEVAL-STLKT01V1 SensorTile development kit
Description
The STEVAL-STLKT01V1 is a comprehensive development kit designed to support and expand the capabilities of the SensorTile and comes with a set of cradle boards enabling hardware scalability. The development kit simplifies prototyping, evaluation and development of innovative solutions. It is complemented with software, firmware libraries and tools, including a dedicated mobile App.
The SensorTile is a tiny, square-shaped IoT module that packs powerful processing capabilities leveraging an 80
MHz STM32L476JG microcontroller and Bluetooth low energy connectivity based on BlueNRG-MS network processor as well as a wide spectrum of motion and environmental MEMS sensors, including a digital microphone.
SensorTile can fit snugly in your IoT hub or sensor network node and become the core of your solution.
To upload new firmware onto the SensorTile, an external
SWD debugger (not included in the kit) is needed. It is recommended to use ST-LINK/V2-1 found on any STM32
Nucleo-64 development board.
Features
• Included in the development kit package:
– SensorTile module (STEVAL-STLCS01V1) with STM32L476, LSM6DSM , LSM303AGR , LPS22HB ,
MP34DT04, BlueNRG-MS , BALF-NRG-01D3 and LD39115J18R
– SensorTile expansion Cradle board equipped with audio DAC, USB port, STM32 Nucleo, Arduino UNO
R3 and SWD connector
– SensorTile Cradle with battery charger, humidity and temperature sensor, SD memory card slot, USB port and breakaway SWD connector
– 100 mAh Li-Ion battery
– Plastic box
– SWD programming cable
UM2059 - Rev 10 page 64/87
UM2059
Hardware description
2.1.8.3
•
•
•
•
•
•
Software libraries and tools
– STSW-STLKT01 : SensorTile firmware package that supports sensors raw data streaming via USB, data logging on SDCard, audio acquisition and audio streaming.
– FP-SNS-ALLMEMS1 and FP-SNS-ALLMEMS2 : STM32Cube functional packs
– BlueMS : iOS and Android demo Apps
– BlueST-SDK : iOS and Android Software Development Kit
CE certified
RoHS and China RoHS compliant
FCC (ID: S9NSTILE01) certified
IC (IC: 8976C-STILE01) certified with PMN: STEVAL-STLKT01V1; HVIN: STEVAL-STLCS01V1; HMN:
STEVAL-STLCX01V1; FVIN: bluenrg_7_1_e_Mode_2-32MHz-XO32K_4M.img
TYPE certified (006-000482)
•
•
•
•
Boards included in the kit
STLCS01V1 SensorTile component board features
•
•
Very compact module for motion, audio and environmental sensing and Bluetooth low energy connectivity with a complete set of firmware examples
Supported by the STM32Cube and the STM32Cube functional packs FP-SNS-ALLMEMS1 and FP-SNS-
ALLMEMS2
Mobile connectivity via the ST BlueMS app, available for iOS and Android
Main components:
– STM32L476 – 32-bit ultra-low-power MCU with CortexM4F
– LSM6DSM – iNEMO inertial module: 3D accelerometer and 3D gyroscope
– LSM303AGR – Ultra-compact high-performance eCompass module: ultra-low power 3D accelerometer and 3D magnetometer
– LPS22HB – MEMS nano pressure sensor: 260-1260 hPa absolute digital output barometer
– MP34DT04 – 64dB SNR Digital MEMS Microphone
– BlueNRG-MS – Bluetooth low energy network processor
– BALF-NRG-01D3 – 50 Ω balun with integrated harmonic filter
– LD39115J18R – 150 mA low quiescent current low noise LDO 1.8 V
– 2 V-5.5 V power supply range
– External interfaces: UART, SPI, SAI (Serial Audio Interface), I²C, DFSDM, USB OTG, ADC, GPIOs
Pluggable or solderable interface
SWD interface for debugging and programming capability
UM2059 - Rev 10 page 65/87
Figure 59. STLCS01V1 board
UM2059
Hardware description
UM2059 - Rev 10
•
•
•
•
•
•
•
•
STLCS01V1 SensorTile component board description
STEVAL-STLCS01V1 (SensorTile) is a highly integrated reference design that can be plugged into form-factor prototypes to add sensing and connectivity capabilities to new designs through a smart hub solution. It can also easily support development of monitoring and tracking applications as standalone sensor node connected to iOS/
Android smartphone applications.
The SensorTile comes in a very small square shape 13.5 x 13.5 mm. All the electronic components are on the top side of the pcb, while the bottom side has a small connector through which it is possible to easily plug and unplug it from a motherboard. The connector pinout is also replicated on 18 pcb pads that render the SensorTile a solderable system on module as well.
The module comes with pre-loaded FP-SNS-ALLMEMS1 (former BLUEMICROSYSTEM2) software that initializes all the sensors and the Bluetooth low energy radio. The “ST BlueMS” app, available free of charge on Apple
Store™ and Google Play™, is the easiest and fastest way to start using the SensorTile board and to experience a real activity monitoring system.
The SensorTile firmware package STSW-STLKT01 , built on the STM32Cube software technology, includes all the low level drivers to manage the on-board devices and system-level interfaces. It has been designed in order to be easily extended and personalized as starting point for development and customization of new dedicated applications.
All the firmware packages are freely available on www.st.com.
The Bluetooth radio power output is set by default at 0 dBm. The FCC and IC certifications refer to this operating value. The power output can be changed up to 8 dBm by reprogramming the device firmware, but the change of this operating value will require an update of the FCC and IC certifications, with additional radio emission tests to be performed.
STLCR01V1 SensorTile component board features
• Sensortile Cradle board with SensorTile footprint (solderable)
STBC08PMR – 800 mA standalone linear Li-Ion battery charger
HTS221 – capacitive digital sensor for relative humidity and temperature
LDK120M-R – 200 mA low quiescent current very low noise LDO
STC3115 – Fuel gauge IC
USBLC6-2P6 – very low capacitance ESD protection
USB type A to Mini-B USB connector for power supply and communication microSD card socket
SWD connector for programming and debugging page 66/87
Figure 60. STLCR01V1 board
UM2059
Hardware description
UM2059 - Rev 10
•
•
•
•
•
•
•
•
STLCX01V1 SensorTile component board features
• Sensortile Cradle expansion board with SensorTile plug connector
Compatible with STM32 Nucleo boards through Arduino UNO R3 connector
LDK120M-R – 200 mA low quiescent current very low noise LDO
ST2378ETTR – 8-bit dual supply 1.71 V to 5.5 V level translator
USBLC6-2P6 – very low capacitance ESD protection
16-Bit, low-power stereo audio DAC
Micro-USB connector for power supply and communication
Reset button
SWD connector for programming and debugging page 67/87
Figure 61. STLCX01V1 board photo
UM2059
Hardware setup
2.2
2.3
Hardware setup
The following hardware components are required:
• for STM32 Nucleo expansion boards:
– One STM32 Nucleo board (order code: NUCLEO-F401RE , NUCLEO-F446RE or NUCLEO-L476RG )
– One microphone expansion board (order code: X-NUCLEO-CCA02M2 )
– One sensor expansion board (order code: X-NUCLEO-IKS01A3 or X-NUCLEO-IKS01A2 )
•
– One BlueNRG Bluetooth low energy expansion board (order code: X-NUCLEO-BNRG2A1 )
– One USB type A to Mini-B USB cable to connect the STM32 Nucleo to the PC for STEVAL-STLKT01V1 :
– STEVAL-STLKT01V1 development kit
– ST-LINK/V2-1 debugger/programmer integrated onto STM32 Nucleo board
– One USB type A to Mini-B USB cable to connect the STM32 Nucleo to the PC
•
•
– One USB type A to Micro-B USB cable to connect the STEVAL-STLKT01V1 to the PC for STEVAL-BCNKT01V1 :
– STEVAL-BCNKT01V1 development kit
– ST-LINK/V2-1 debugger/programmer integrated onto STM32 Nucleo board
– One USB type A to Mini-B USB cable to connect the STM32 Nucleo to the PC
– One USB type A to Micro-B USB cable to connect the STEVAL-BCNKT01V1 to the PC for STEVAL-MKSBOX1V1 :
– STEVAL-MKSBOX1V1 development kit
– ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32
– One USB type A to Mini-B USB cable to connect the ST-LINK/V2 in-circuit debugger/programmer to the PC
– One USB type A to Micro-B USB cable to connect the STEVAL-MKSBOX1V1 to the PC
Software setup
The following software components are needed to set up a suitable development environment for creating applications for the STM32 Nucleo equipped with the sensors, microphones and Bluetooth low energy expansion boards and for STEVAL-STLKT01V1 , STEVAL-MKSBOX1V1STEVAL-BCNKT01V1 :
UM2059 - Rev 10 page 68/87
UM2059
System setup
2.4
2.4.1
•
•
FP-SNS-ALLMEMS1 : Bluetooth low energy and sensors software for STM32Cube .
Development tool-chain and Compiler. The STM32Cube expansion software supports the three following environments:
– IAR Embedded Workbench for ARM ® (EWARM) toolchain + ST-LINK
– RealView Microcontroller Development Kit (MDK-ARM) toolchain + ST-LINK
– STM32CubeIDE for STM32 + ST-LINK
System setup
STM32 Nucleo and expansion board setup
The STM32 Nucleo development board integrates the ST-LINK/V2-1 debugger/programmer.
The X-NUCLEO-CCA02M2 sensor board is easily connected to the STM32 Nucleo development board through the morpho connectors, as shown below.
Figure 62. STM32 Nucleo plus X-NUCLEO-CCA02M2 boards
UM2059 - Rev 10
The X-NUCLEO-BNRG2A1 expansion board is connected to the X-NUCLEO-CCA02M2 board through the
Arduino UNO R3 extension connector, as shown below.
page 69/87
UM2059 - Rev 10
UM2059
System setup
Figure 63. STM32 Nucleo plus X-NUCLEO-CCA02M2 plus X-NUCLEO-BNRG2A1 boards
The X-NUCLEO-IKS01A2 or X-NUCLEO-IKS01A3 sensor board is then connected to the X-NUCLEO-BNRG2A1 expansion board through the Arduino UNO R3 extension connector, as shown below.
Figure 64. STM32 Nucleo plus X-NUCLEO-CCA02M2 plus X-NUCLEO-BNRG2A1 plus X-NUCLEO-IKS01A2 boards page 70/87
UM2059
System setup
Note:
2.4.2
The stacking sequence indicated above helps to optimize the performance of the BlueNRG-M2SP module on the X-NUCLEO-BNRG2A1 expansion board, reducing interference from its antenna.
STEVAL-BCNKT01V1 setup
The ST-LINK/V2-1 debugger/programmer integrated in the STM32 Nucleo board must be used to program the
STEVAL-BCNCS01V1 (BlueCoin).
To program the board, connect STEVAL-BCNCS01V1 (BlueCoin) on the STEVAL-STLCX01V1 BlueCoin
Coinstation board.
Use the SWD connector (a 5-pin flat cable is provided in the BlueCoin Kit package) to connect the BlueCoin
Coinstation board to ST-LINK/V2-1 debugger/programmer integrated on the STM32 Nucleo board for programming.
Be sure that CN2 Jumpers are OFF and connect your STM32 Nucleo board to the BlueCoin Coinstation through the provided cable paying attention to the polarity of the connectors. Pin 1 can be identified by a small circle on the STM32 Nucleo board and Coin Station PCB silkscreens or by the square shape of the soldering pad of the connector (SensorTile Cradle).
Figure 65. BlueCoin-STM32 Nucleo: SWD connections with 5-pin flat cable
2.4.3
2.4.4
STEVAL-MKSBOX1V1 setup
To program the STEVAL-MKSBOX1V1 (SensorTile.box) you need an ST-LINK/V2-1 debugger/programmer
(integrated in the B-L475E-IOT01A IoT Discovery kit node board).
Step 1.
Connect the STEVAL-MKSBOX1V1 to ST-LINK/V2-1 using the flat cable
Step 2.
Connect the ST-LINK/V2-1 to the PC using one USB type A to Mini-B USB cable
Step 3.
Power the STEVAL-MKSBOX1V1 by plugging the battery or using a USB type A Micro-B USB cable connected to the PC
STEVAL-STLKT01V1 setup
The ST-LINK/V2-1 debugger/programmer integrated in the STM32 Nucleo board must be used to program the
STEVAL-STLCS01V1 (SensorTile).
Connect STEVAL-STLCS01V1 (SensorTile) on the STEVAL-STLCR01V SensorTile Cradle board or on the
STEVAL-STLCX01V1 Sensortile Cradle Expansion board.
UM2059 - Rev 10 page 71/87
UM2059
System setup
Use the SWD connector to connect the Sensortile Cradle board to ST-LINK/V2-1 debugger/programmer integrated on the STM32 Nucleo board for programming.
Be sure that CN2 Jumpers are OFF and connect your STM32 Nucleo board to the SensorTile Cradle through the provided cable paying attention to the polarity of the connectors. Pin 1 can be identified by a little circle on the pcb silkscreen ( STM32 Nucleo board and SensorTile Cradle Expansion) or by the square shape of the soldering pad of the connector (SensorTile Cradle).
Figure 66. SensorTile Cradle expansion board and Sensor Tile Cradle board connected to ST-LINK/V2-1
2.4.5
X-NUCLEO-BNRG2A1 setup
The procedure described below is required to make the BlueNRG-2 library correctly work with the firmware embedded in the X-NUCLEO-BNRG2A1 BLE module.
Step 1.
Solder a 0 Ohm resistor to R117 on the X-NUCLEO-BNRG2A1 expansion board.
Step 2.
Update the X-NUCLEO-BNRG2A1 BLE module through the ST-LINK/V2-1 and the STSW-
BNRGFLASHER Flasher utility.
UM2059 - Rev 10 page 72/87
UM2059
System setup
Step 3.
Connect the X-NUCLEO-BNRG2A1 J12 pins to the ST-LINK/V2-1 pins through the 5-wire cable
included as shown in the picture below and detailed in Table 1 .
Figure 67. Connection between X-NUCLEO-BNRG2A1 expansion board and ST-LINK/V2-1
UM2059 - Rev 10
Table 1. X-NUCLEO-BNRG2A1 and ST-LINK/V2-1 pin connections
X-NUCLEO-BNRG2A1 J12 pin no.
3
4
1
2
5
ST-LINK/V2-1 pin no.
12
7
1
9
15
Step 4.
Install the STSW-BNRGFLASHER and open it.
page 73/87
Step 5.
Select the SWD tab.
Figure 68. STSW-BNRGFLASHER - SWD tab
UM2059
System setup
UM2059 - Rev 10 page 74/87
Step 6.
Erase the BlueNRG-2 chip Flash memory.
Figure 69. STSW-BNRGFLASHER - mass erase
UM2059
System setup
UM2059 - Rev 10
Step 7.
Download the Link Layer Only firmware for the BLE module.
page 75/87
UM2059
System setup
Step 8.
Load the Link Layer Only firmware into the STSW-BNRGFLASHER and press the [ Flash ] button.
Figure 70. STSW-BNRGFLASHER - Flash button
2.4.6
Step 9.
To restore the X-NUCLEO-BNRG2A1 BLE module embedded firmware, repeat the procedure using the following firmware image: DTM_Full.bin
.
In case of issues during the update process, close X-NUCLEO-BNRG2A1 J15 jumper before repeating the procedure.
Important additional hardware information
For F4xx STM32 Nucleo development board, there is an hardware conflict among the X-NUCLEO-IKS01A2 / X-
NUCLEO-IKS01A3 expansion boards and the X-NUCLEO-CCA02M2 expansion board through the Arduino UNO
R3 extension connector.
The hardware conflict is on pins 5, 6 and 7 of the CN9 Arduino connector.
UM2059 - Rev 10 page 76/87
UM2059
System setup
Note:
•
•
•
For X-NUCLEO-IKS01A2 :
– in pins 5 (SB27) and 6 (SB26) there are the interrupts INT1 and INT2 for LSM6DSL (used for the featured hardware)
– in pin 7 (SB25) there is the interrupt for LPS22HB component
For X-NUCLEO-IKS01A3 :
– in pins 5 (SB43) and 6 (SB45) there are the interrupts INT1 and INT2 for LSM6DSO (used for the featured hardware)
– in pin 7 (SB47) there is the interrupt for LPS22HB component
For X-NUCLEO-CCA02M2 :
– in pin 5 (SB7) there is the clock for the microphones
– in pin 6 (SB15) there is the clock x2 for the microphones
– in pin 7 (SB17) there is the connection for the microphone (solder bridge open as default)
For this reason the hardware features are not available for NUCLEO-F446RE (the related GPIO pin is not configured).
For NUCLEO-L476RG :
• before connecting the X-NUCLEO-CCA02M2 to the STM32 Nucleo L4-series development board through the ST morpho connector layout, on the X-NUCLEO-CCA02M2 board::
– close the solder bridges SB12, SB16 and open the solder bridges SB7, SB15 and SB17 (to enable the signal clock from STM32 Nucleo L4-series development board)
•
•
– if additional microphones are plugged to the board, close solder bridge SB17 before connecting the X-NUCLEO-IKS01A2 expansion board to the X-NUCLEO-CCA02M2 expansion board:
– remove the solder bridge SB25 if additional microphones are plugged to the X-NUCLEO-CCA02M2 board before connecting the X-NUCLEO-IKS01A3 expansion board to the X-NUCLEO-CCA02M2 expansion board:
– remove solder bridge SB47 if additional microphones are plugged to the X-NUCLEO-CCA02M2 board
For the NUCLEO-L476RG board only: before connecting the X-NUCLEO-CCA02M2 board to the STM32 Nucleo
L4-series development board through the ST morpho connector layout, on the X-NUCLEO-CCA02M2 board:
• close SB12 and SB16 solder bridges (in yellow in the figure below)
• open SB7, SB15 and SB17 solder bridges (in pink in the figure below)
UM2059 - Rev 10 page 77/87
UM2059
System setup
Figure 71. X-NUCLEO-CCA02M2 solder bridge configuration for the NUCLEO-L476RG board
UM2059 - Rev 10 page 78/87
UM2059
Revision history
Date
18-Apr-2016
02-Aug-2016
UM2059 - Rev 10
18-Oct-2016
21-Dec-2016
Table 2. Document revision history
Version
1
2
3
4
Changes
Initial release.
Text and formatting changes throughout document
Added STEVAL-STLKT01V1 board use details
Added Section 1.4: "Flash management"
Added Section 1.5: "The boot process"
Added Section 1.6: "Firmware-Over-The-Air (FOTA) update"
Added Section 1.10: "Firmware-Over-The-Air update with
BlueMS"
Added Section 2.1.6: "STEVAL-STLKT01V1 SensorTile development kit"
Added Section 2.3.3.2: "STEVAL-STLKT01V1 setup"
Throughout document:
- text, formatting and graphics enhancements
- added STEVAL-STLKT01V1 voice communication information
- added STEVAL-STLKT01V1 Gas Gauge information
Updated Section "Introduction"
Updated Section 1.1: "Overview"
Updated Figure 1: "FP-SNS-ALLMEMS1 software architecture"
Added Section 1.6: "The Installation process"
Throughout document:
- minor text and formatting changes
Added: Section 2.1.6: "X-NUCLEO-IKS01A2 expansion board" and Figure 41: "X-NUCLEO-IKS01A2 solder bridge configuration"
Updated: Figure 1: "FP-SNS-ALLMEMS1 software architecture",
Figure 6: "Binary folder content", Figure 7: "Content of a project folder", Figure 8: "BootLoader and ALLMEMS1 installation",
Figure 9: "ALLMEMS1 Dump process", Figure 11:
"Initialization phase", Figure 12: "UART console output when a device is connected to the board", Figure 22: "BlueMS (Android version) firmware upgrade page", Figure 23: "BlueMS (Android version) firmware update file selection", Figure 24: "BlueMS (Android application) feedback during and after FOTA transmission",
Figure
25: "Terminal window feedback during FOTA", Figure 40:
"XNUCLEO-
IKS01A1 solder bridge configuration", and Figure 42: page 79/87
UM2059 - Rev 10
Date
08-May-2017
26-Jul-2017
19-Oct-2017
01-Feb-2018
03-Oct-2019
UM2059
Version
5
6
7
8
9
Changes
"X-NUCLEO-CCA02M1 solder bridge configuration for the
NUCLEO-L476RG board"
Added references to STM32F446 processor throughout document. Updated: title, Section "Introduction", Section 1.1:
"Overview", Section 1.2: "Architecture", Section 1.3: "Folder structure", Section 1.4: "Flash management", Section 1.6:
"The installation process", Section 1.9: "Sample application description", Section 1.10.1: "Main page", Section 1.10.3:
"Plot data", Section 1.10.4: "Serial and debug console",
Section 1.10.5: "Enable hardware features", Section 1.10.13:
"Rssi and battery" and Section 1.11: "Firmware-Over-The-Air update with BlueMS".
Added: Section 1.10.2: "MEMS sensor fusion", Section 1.10.6:
"Activity recognition", Section 1.10.7: "Carry position", Section
1.10.8: "Gesture recognition", Section 1.10.9: "E-compass",
Section 1.10.11: "Direction of Arrival", Section 1.10.10:
"BlueVoiceADPCM", Section 1.10.10.1: "ASR language selection", Section 1.10.10.1.1: "Chinese ASR: iFlyTek MSC service", Section 1.10.10.1.2: "Alternative languages: Google
Speech API" and Section 1.10.10.2: "Google speech ASR
Key generation".
In Section 1.1: "Overview":
- added BlueMS version information associated with Source
Localization and Beam Forming.
In Section 1.4: "Flash management":
- added STM32F446RE Flash address information for the
Meta Data Manager
Updated Figure 4: "BootLoader folder content"
Updated Figure 46: "BlueMS (Android version) audio source localization STM32 Nucleo Page"
Updated Introduction, Section 1.1 Overview, Section 1.2
Architecture, Section 1.3 Folder structure,
Section 1.9 Sample application description, Section 1.10
Android and iOS sample client application,
Section 1.10.14 Rssi and battery, Section 1.11 Firmware-
Over-The-Air update with BlueMS and
Section 1.10.5 Enable hardware features.
Added Section 1.10.4.1 SD card data logging
Updated Section 1.1 Overview, Section 1.2 Architecture,
Section 1.9 Sample application description, Section 1.10
Android and iOS sample client application and Section 1.10.4
Settings, serial and debug console.
Added Section 1.10.17 SD Logging.
Updated Introduction, Section 1.1 Overview, Section 1.2
Architecture, Section 1.3 Folder structure, Section 1.4 Flash management, Section 1.6 The installation process, Section
1.9 Sample application description, Section 1.10 Android and iOS sample client application, Section 1.10.5 Enable hardware features, Section 2.2 Software description, Section
2.3.1 Hardware setup, Section 2.3.2 Software setup, Section
2.3.3.1 STM32 Nucleo and expansion boards setup and
Section 2.3.3.5 Important additional hardware information.
Added Section 1.10.9 Intensity detection, Section 1.10.10
Motion algorithms, Section 1.10.11 Fitness activities, Section
1.10.12 Tilt measurement, Section 2.1.5 X-NUCLEO-IKS01A3 expansion board and Section 2.1.7 STEVAL-MKSBOX1V1 evaluation kit.
page 80/87
Date
09-Jun-2020
UM2059
Version
10
Changes
,
Section 1.6 The installation process ,
Section 1.9 Sample application description
, Figure 13. STBLESensor (Android version) main page following BLE connection
,
Section 1.10.4 Settings, serial and debug console ,
1.10.5 Enable hardware features
(Android version) MotionAR activity recognition page
,
, Figure 26. STBLESensor (Android version) MotionGR gesture recognition page
,
Figure 34. STBLESensor (Android version) level page ,
Figure 36. STBLESensor (Android version) MotionFX page
,
Section 1.10.14 BlueVoiceADPCM voice
,
1.10.15 Direction of Arrival ,
Section 1.10.16 Beam Forming ,
Figure 45. STBLESensor (Android version) Battery and RSSI information
,
Section 1.11 Firmware-Over-The-Air update with
Section 2.4.1 STM32 Nucleo and expansion board setup
and
Section 2.4.6 Important additional hardware information
.
Added
Section 1.10.14.1 Speech to text ,
NUCLEO-CCA02M2 expansion board
,
NUCLEO-BNRG2A1 expansion board and
.
UM2059 - Rev 10 page 81/87
UM2059
Contents
Contents
UM2059 - Rev 10 page 82/87
UM2059
Contents
UM2059 - Rev 10 page 83/87
UM2059
List of tables
List of tables
UM2059 - Rev 10 page 84/87
UM2059
List of figures
List of figures
UM2059 - Rev 10 page 85/87
UM2059
List of figures
UM2059 - Rev 10 page 86/87
UM2059
IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of
Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks . All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2020 STMicroelectronics – All rights reserved
UM2059 - Rev 10 page 87/87
Descargar
Anuncio