STEVAL-STLKT01V1 User manual Getting started with the software package for Bluetooth low energy and sensors in BLUEMICROSYSTEM2 Introduction The BLUEMICROSYSTEM2 expansion software package for STM32Cube lets you read and display real-time environmental sensor data, digital microphone levels and acoustic source localization information with a dedicated Android™/iOS™ application.
Contents STEVAL-STLKT01V1 Contents 1 2 BLUEMICROSYSTEM2 software description ................................ 5 1.1 Overview ........................................................................................... 5 1.2 Architecture ....................................................................................... 6 1.3 Folder structure ................................................................................. 7 1.4 APIs .............................................................
STDK-STILECS01V1 List of tables List of tables Table 1: Document revision history ..........................................................................................................
List of figures STEVAL-STLKT01V1 List of figures Figure 1: BLUEMICROSYSTEM2 software architecture ............................................................................ 7 Figure 2: BLUEMICROSYSTEM2 package folder structure ....................................................................... 7 Figure 3: Terminal setting ........................................................................................................................... 8 Figure 4: Initialization phase .......................
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description 1 BLUEMICROSYSTEM2 software description 1.
BLUEMICROSYSTEM2 software description STEVAL-STLKT01V1 Free Fall detection Single tap detection Double tap detection Wake up detection Tilt detection 3D orientation This software gathers the temperature, humidity, pressure, audio and motion sensors drivers for the HTS221, LPS25H, MP34DT01-M, LSM6DS0 (or LSM6DS3) and LIS3MDL devices, running on STM32. This package is compatible with the BlueMS Android/iOS (Version 2.0.
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description Figure 1: BLUEMICROSYSTEM2 software architecture 1.3 Folder structure This section provides an overview of the package folders structure. The next figure outlines the architecture of the package Figure 2: BLUEMICROSYSTEM2 package folder structure 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.
BLUEMICROSYSTEM2 software description 1.4 STEVAL-STLKT01V1 Middlewares: contains libraries and protocols for BlueNRG Bluetooth low energy, osx.MotionFX (iNEMOEngine PRO) sensors fusion library, osx.MotionAR (iNEMOEngine PRO) activity-recognition library, osx.MotionCP (iNEMOEngine PRO) carry-position recognition library, osx.MotionGR (iNEMOEngine PRO) gesture recognition library and osx.AcousticSL sound source localization library.
STDK-STILECS01V1 BLUEMICROSYSTEM2 software description initializes the BLE SW service adding the osx.MotionFX, osx.MotionAR, osx.MotionCP, osx.MotionGR and osx.AcousticSL libraries. initializes the BLE console service adding the stdin/stdout and stderr characteristics initializes the BLE config service transmitting/resetting the calibration status and enabling the LSM6DS3 DIL24 hardware features (if present). checks whether the LSM6DS3 DIL24 extension is present.
BLUEMICROSYSTEM2 software description STEVAL-STLKT01V1 These definitions in osx_bms_config.h control how many quaternions the application sends 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 how many quaternions are sent on each Bluetooth package. By default, the application sends 3 quaternions every 30 ms. The same osx_bms_config.
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description The osxMotionGR can be enabled via the OSX_BMS_MOTIONGR define in osx_bms_config.h. The osxAcousticSL library is able to localize the audio sound source using the data acquired from the microphones. It can be enabled via the OSX_BMS_ACOUSTIC_MIC_ANGLE define in osx_bms_config.h. When an Android/iOS device is connected to the board, it is possible to control what the board transmit (see the following figure).
BLUEMICROSYSTEM2 software description STEVAL-STLKT01V1 Following connection, BlueMS starts with the main page shown below, where the values of temperature, pressure and humidity are displayed.
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description As shown below, the next page depicts the osxMotionFX sensor fusion library output with a cube that rotates with board movement. Figure 7: BlueMS (Android version) osxMotionFX sensor fusion page On this page there are two buttons along the bottom: the left is for resetting the cube position. the right shows the calibration status of the osxMotionFX Library (black for not calibrated, green for calibrated). Clicking it forces a magneto calibration.
BLUEMICROSYSTEM2 software description STEVAL-STLKT01V1 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 below) Figure 8: BlueMS (Android version) popup windows 14/37 DocID029208 Rev 2
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description On the next left page, you can plot sensor data from the sensors expansion boards, as shown in the following figures.
BLUEMICROSYSTEM2 software description Figure 10: BlueMS (Android version) accelerometer plot 16/37 DocID029208 Rev 2 STEVAL-STLKT01V1
STDK-STILECS01V1 BLUEMICROSYSTEM2 software description In the option menu below, you can enable the Serial or Debug (with stdin) console.
BLUEMICROSYSTEM2 software description If the Serial console is enabled, stdout/stderr is displayed, as shown below.
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description If the Debug console is enabled, stdin is displayed and any message written in the Debug console triggers a relpy with the same message, as shown below.
BLUEMICROSYSTEM2 software description STEVAL-STLKT01V1 If the LSM6DS3 DIL24 is present, there is another page where you can choose which hardware feature to enable (one at the time) and view the events from the LSM6DS3 DIL24 (see following figures) on the same page.
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software desc Figure 15: BlueMS (Android version) LSM6DS3 DIL24 examples: pedometer, wake up, orientation, double tap.
BLUEMICROSYSTEM2 software description STEVAL-STLKT01V1 If the osxMotionAR algorithm is enabled, the page shown below is available, signaling one of the following recognized activities: Stationary Walking Fast walking Jogging Biking Driving Figure 16: BlueMS (Android version) osxMotionAR activity recognition page 22/37 DocID029208 Rev 2
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description If the osxMotionCP algorithm is enabled, the page shown below is available, with information about how the user is carrying the board, which equates to phone carry positions: on desk in hand near head shirt pocket trousers pocket arm swing Figure 17: BlueMS (Android version) osxMotionCP carry position recognition page DocID029208 Rev 2 23/37
BLUEMICROSYSTEM2 software description If the osxMotionGR algorithm is the page shown below is available, with gesture recognition information like: pick up glance wake up in hand Figure 18: BlueMS (Android version) osxMotionGR gesture recognition page 24/37 DocID029208 Rev 2 STEVAL-STLKT01V1
STEVAL-STLKT01V1 BLUEMICROSYSTEM2 software description If the osxAcousticSL algorithm is enabled, the page shown below is available, with audio sound source localization.
System setup guide STEVAL-STLKT01V1 2 System setup guide 2.1 Hardware description This section describes the hardware components needed for developing a sensors based application. 2.1.1 STM32 Nucleo platform The STM32 Nucleo boards provide an affordable and flexible way for users to try out new ideas and build prototypes with any STM32 microcontroller lines.
STEVAL-STLKT01V1 System setup guide soldered onto board and it offers the possibility to plug in additional microphones using MP32DT01-based coupon evaluation boards (e.g. STEVAL-MKI129V3). The X-NUCLEO-CCA02M1 allows the acquisition of up to two microphones using the I²S bus and up to four coupon microphones using I²S and SPI together. In addition, it offers a USB output for the STM32 Nucleo board.
System setup guide STEVAL-STLKT01V1 Figure 22: X-NUCLEO-IDB04A1 expansion board Information regarding the X-NUCLEO-IDB04A1 expansion board is available on www.st.com at http://www.st.com/x-nucleo. 2.1.4 X-NUCLEO-IDB05A1 expansion board The X-NUCLEO-IDB05A1 is a Bluetooth low energy evaluation board based on the SPBTLE-RF BlueNRG-MS RF module to allow expansion of the STM32 Nucleo boards. The SPBTLE-RF module is FCC (FCC ID: S9NSPBTLERF) and IC certified (IC: 8976CSPBTLERF).
STEVAL-STLKT01V1 System setup guide Figure 23: X-NUCLEO-IDB05A1 expansion board Information about the X-NUCLEO-IDB05A1 expansion board is available on www.st.com at http://www.st.com/x-nucleo 2.1.5 X-NUCLEO-IKS01A1 expansion board The X-NUCLEO-IKS01A1 figured below is a sensor expansion board for use with the STM32 Nucleo system.
System setup guide STEVAL-STLKT01V1 Figure 24: X-NUCLEO-IKS01A1 board Information about the X-NUCLEO-IKS01A1 expansion board is available on www.st.com at: http://www.st.com/x-nucleo. The LSM6DS3 DIL24 adapter board in the figure below can be plugged on top of the XNUCLEO-IKS01A1 expansion board. Figure 25: LSM6DS3 DIL24 adapter board 2.
STEVAL-STLKT01V1 2.3 System setup guide BLUEMICROSYSTEM2: Bluetooth low energy and sensors software for STM32Cube. BLUEMICROSYSTEM2 firmware and related documentation is available on www.st.com. Development tool-chain and Compiler.
System setup guide STEVAL-STLKT01V1 Figure 26: STM32 Nucleo plus X-NUCLEO-CCA02M1 boards The X-NUCLEO-IDB04A1 or X-NUCLEO-IDB05A1 BlueNRG BLE expansion board is easily connected to the X-NUCLEO-CCA02M1 board through the Arduino UNO R3 extension connector, as shown below.
STEVAL-STLKT01V1 System setup guide Figure 28: STM32 Nucleo plus X-NUCLEO-CCA02M1 plus X-NUCLEO-IDB04A1 plus XNUCLEO-IKS01A1 plus LSM6DS3 DIL24 boards The stacking sequence shown above is necessary to optimize the performance of the SPBTLE-RF module on the X-NUCLEO-IDB05A1 expansion board, and to reduce interference from its antenna DocID029208 Rev 2 33/37
System setup guide 2.3.3.
STEVAL-STLKT01V1 System setup guide For the NUCLEO-L476RG board only: before connecting the X-NUCLEO-CCA02M1 board to the STM32 Nucleo board morpho connectors, close these solder bridges: SB12 SB16 SB17 (if additional microphones are connected) Figure 30: Solder bridges to close on X-NUCLEO-CCA02M1 board (when using NUCLEOL476RG board) DocID029208 Rev 2 35/37
Revision history 3 STEVAL-STLKT01V1 Revision history Table 1: Document revision history 36/37 Date Version Changes 12-Apr-2016 1 Initial release. 06-May-2016 2 Minor text edits.
STEVAL-STLKT01V1 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.
FCC ID:S9NSTILE01 This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. Notice: Any changes or modifications not expressly approved by the party responsible for compliance could void your authority to operate the equipment.
IC: 8976C-STILE01 This device complies with Industry Canada licence-exempt RSS standard(s). Operation is subject to the following two conditions: (1) this device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. This Class B digital apparatus complies with Canadian ICES-0003. Le présent appareil est conforme aux CNR d'Industrie Canada applicables aux appareils radio exempts de licence.