Getting started with the software package for Bluetooth low energy

Getting started with the software package for Bluetooth low energy
UM1991
User manual
Getting started with the software package for Bluetooth low energy,
sensor and NFC tag software in BLUEMICROSYSTEM3
Introduction
This document describes how to get started with the BLUEMICROSYSTEM3 software.
BLUEMICROSYSTEM3 provides software which runs on the STM32 microcontroller to read the values
from different sensors and use the ST BlueNRG Bluetooth low energy protocol to communicate with
external devices.
The package includes osxMotionFX (iNEMOEngine PRO under OPEN.MEMS license), which uses
advanced algorithms to intelligently integrate outputs from multiple MEMS sensors, independent of
ambient conditions, to optimize performance.
The package also includes the osxMotionAR (iNEMOEngine PRO under OPEN.MEMS license) realtime activity-recognition algorithm and the osxMotionCP (iNEMOEngine PRO under OPEN.MEMS
license) carry-position recognition algorithm both based only on accelerometer data.
It uses the NDEF protocol to write the information necessary for easy and secure Bluetooth pairing,
storing the BLE MAC address and the PIN on the NFC tag. This application only accepts secure
connections, with the BLE MAC address and the PIN randomly regenerated at each board reset.
The software provides a sample application for STM32 Nucleo boards (NUCLEO-F401RE or NUCLEOL476RG) equipped with:




an X-NUCLEO-NFC01A1 expansion board featuring the M24SR64-Y Dynamic NFC/RFID tag
an X-NUCLEO-IDB04A1 (or X-NUCLEO-IDB05A1) expansion board enabling communication with
the Bluetooth Low-Energy protocol
an X-NUCLEO-IKS01A1 featuring temperature, humidity, pressure and motion MEMS sensors
an X-NUCLEO-6180XA1 expansion board using the VL6180X proximity and ambient light sensing
module
The software is based on the STM32Cube technology.
Information regarding STM32Cube is available on www.st.com at: http://www.st.com/stm32cube.
January 2016
DocID028666 Rev 2
1/35
www.st.com
Contents
UM1991
Contents
1
Acronyms and abbreviations ......................................................... 4
2
BLUEMICROSYSTEM3 software description ................................ 5
3
2.1
Overview ........................................................................................... 5
2.2
Architecture ....................................................................................... 6
2.3
Folder structure ................................................................................. 7
2.4
APIs .................................................................................................. 8
2.5
Sample application description.......................................................... 8
2.6
Android and iOS sample client application ...................................... 13
System setup guide....................................................................... 24
3.1
4
2/35
Hardware description ...................................................................... 24
3.1.1
STM32 Nucleo platform .................................................................... 24
3.1.2
X-NUCLEO-IDB04A1 expansion board............................................ 24
3.1.3
X-NUCLEO-IDB05A1 expansion board............................................ 25
3.1.4
X-NUCLEO-NFC01A1 expansion board .......................................... 27
3.1.5
X-NUCLEO-IKS01A1 expansion board ............................................ 28
3.1.6
X-NUCLEO-6180XA1 expansion board ........................................... 30
3.2
Software description ........................................................................ 32
3.3
Hardware and software setup ......................................................... 32
3.3.1
Hardware setup ................................................................................ 32
3.3.2
Software setup .................................................................................. 33
3.3.3
System setup guide .......................................................................... 33
Revision history ............................................................................ 34
DocID028666 Rev 2
UM1991
List of figures
List of figures
Figure 1: BLUEMICROSYSTEM3 software architecture ............................................................................ 7
Figure 2: BLUEMICROSYSTEM3 package folder structure ....................................................................... 7
Figure 3: Terminal settings ......................................................................................................................... 8
Figure 4: Initialization phase ....................................................................................................................... 9
Figure 5: UART console output when the BLE services are started ........................................................ 10
Figure 6: UART console output when device first connects with the board ............................................. 12
Figure 7: UART console output when a device is already trusted ............................................................ 13
Figure 8: BlueMS (Android version) start page following BLE connection ............................................... 14
Figure 9: BlueMS (Android version) osxMotionFX sensor fusion page .................................................... 15
Figure 10: BlueMS (Android version) callibration (1 of 2) ......................................................................... 16
Figure 11: BlueMS (Android version) callibration (2 of 2) ......................................................................... 16
Figure 12: BlueMS (Android version) example plot .................................................................................. 17
Figure 13: BlueMS (Android version) menu selection .............................................................................. 18
Figure 14: BlueMS (Android version) serial console (stdout/stderr) ......................................................... 19
Figure 15: BlueMS (Android version) debug console (stdin/stdout/stderr) ............................................... 20
Figure 16: BlueMS (Android version) osxMotionAR activity recognition page ......................................... 21
Figure 17: BlueMS (Android version) osxMotionCP carry position recognition page ............................... 22
Figure 18: BlueMS (Android version) gesture recognition page ............................................................... 23
Figure 19: STM32 Nucleo board ............................................................................................................... 24
Figure 20: X-NUCLEO-IDB04A1 BLE expansion board ........................................................................... 25
Figure 21: X-NUCLEO-IDB04A1 expansion plugged on STM32 Nucleo board ....................................... 25
Figure 22: X-NUCLEO-IDB05A1 expansion board ................................................................................... 26
Figure 23: X-NUCLEO-IDB05A1 plugged on STM32 Nucleo board ........................................................ 27
Figure 24: X-NUCLEO-NFC01A1 M24SR64-Y dynamic NFC tag expansion board ............................... 28
Figure 25: STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 stack ................................. 28
Figure 26: X-NUCLEO-IKS01A1 sensor expansion board without (left) and with (right) DIL24 LSM6DS3
.................................................................................................................................................................. 29
Figure 27: STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 + X-NUCLEO-IKS01A1
stack .......................................................................................................................................................... 30
Figure 28: X-NUCLEO-6180XA1 expansion board .................................................................................. 31
Figure 29: STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 + X-NUCLEO-IKS01A1 + XNUCLEO-6180XA1 stack ......................................................................................................................... 32
DocID028666 Rev 2
3/35
Acronyms and abbreviations
1
UM1991
Acronyms and abbreviations
Table 1: List of acronyms
Acronym
BLE
Bluetooth low energy
NFC
Near field communication
NDEF
4/35
Description
NFC data exchange format
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
2
BLUEMICROSYSTEM3 software description
2.1
Overview
The key features of the BLUEMICROSYSTEM3 package include:











Complete drivers to build applications with the M24SR64-Y Dynamic NFC/RFID tag
using the NDEF standard
osxMotionFX (iNEMOEngine PRO) real-time motion-sensor data fusion (under
OPEN.MEMS license) that combines the output from multiple MEMS sensors.
osxMotionAR activity recognition middleware (iNEMOEngine PRO) under open.MEMS
license)
osxMotionCP carry position recognition middleware (iNEMOEngine PRO) under
open.MEMS license)
Gesture recognition middleware
A very low power Bluetooth low energy (BlueNRG) single-mode network processor,
compliant with Bluetooth specifications core 4.0 (X-NUCLEO-IDB04A1) or 4.1 (XNUCLEO-IDB05A1) for transmitting information to a client
Complete drivers to build applications using temperature and humidity sensors
(HTS221), pressure sensor (LPS25HB) and motion sensors (LIS3MDL and
LSM6DS0)
Compatible with the motion sensor LSM6DS3 DIL24 expansion component
Complete drivers to build applications using VL6180X proximity and ambient light
sensing module
Easy portability across different MCU families, thanks to STM32Cube
Sample application for X-NUCLEO-NFC01A1, X-NUCLEO-IKS01A1, X-NUCLEO6180XA1 and X-NUCLEO-IDB04A1 (or X-NUCLEO-IDB05A1) boards when plugged
onto a NUCLEO-F401RE or NUCLEO-L476RG board.
This software creates four Bluetooth services:
The first service exposes all the HW features and contains the following characteristics:






temperature
pressure
humidity
lux
proximity
3D gyroscope, 3D magnetometer, 3D accelerometer.
The second service exposes all the software features and contains the following
characteristics:



Quaternions produced by osxMotionFX algorithm in short and floating precision
The activity recognized by the osxMotionAR algorithm, among:

stationary

walking

fast walking

jogging

biking

driving
The carried position recognized by osxMotionCP algorithm, among:

on desk

in hand

near head
DocID028666 Rev 2
5/35
BLUEMICROSYSTEM3 software description
UM1991

shirt pocket

trousers pocket

arm swing
The gesture recognized by the gesture recognition middleware, which can be:

single tap (from top to bottom)

swipe from left to right

swipe from right to left
The third service is the console service with two characteristics:


stdin/stdout to implement bi-directional communication between client and server
stderr to implement a mono-directional channel from the STM32 Nucleo board to
an Android/iOS device
The last service is the configuration service used for communicating and controlling the
status of the magneto calibration.
This package is compatible with the BlueMS Android/iOS application (Version 2.1.0 and
above) available at Play store/iTunes, respectively. This application can be used to display
information sent with the Bluetooth low energy protocol.
2.2
Architecture
The software is based on the STM32CubeHAL hardware abstraction layer for the STM32
microcontroller.
The package provides a Board Support Package (BSP) for the sensor expansion board
and some middleware components for serial communication with a PC.
The software layers used by the application software to access and use the sensor
expansion boards are:


6/35
STM32Cube HAL Layer: consists of a set of simple, generic, multi-instance APIs
(application programming interfaces) which interact with the upper layer applications,
libraries and stacks. These generic and extension APIs are based on a common
framework which allows any layers they built on, such as the middleware layer, to
implement their functions without requiring specific hardware information for a given
microcontroller unit (MCU). This structure improves library code reusability and
guarantees easy portability across other devices.
Board Support Package (BSP) Layer: provides software support for the STM32
Nucleo board peripherals, excluding the MCU. These specific APIs provide a
programming interface for certain board specific peripherals like LEDs, user buttons,
etc., and can also be used to fetch individual board version information. It also
provides support for initializing, configuring and reading data.
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 1: BLUEMICROSYSTEM3 software architecture
2.3
Folder structure
Figure 2: BLUEMICROSYSTEM3 package folder structure
The following folders are included in the software package:



Documentation: contains a compiled HTML file generated from the source code with
software component and API details.
Drivers: this folder contains the HAL drivers, the board specific drivers for each
supported board or hardware platform, including the on-board components ones and
the CMSIS layer which is a vendor-independent hardware abstraction layer for the
Cortex-M processor series.
Middlewares: this folder contains the BlueNRG Bluetooth low energy protocols and the
libraries for NDEF, osxMotionFX sensor fusion, for the osxMotionAR activity
recognition algorithm, for the osxMotionCP carry position recognition algorithm, and
for the gesture recognition algorithm.
DocID028666 Rev 2
7/35
BLUEMICROSYSTEM3 software description

2.4
UM1991
Projects: this folder contains a sample application used for transmitting the sensors
values and the output of osxMotionFX, osxMotionAR, osxMotionCP and gesture
recognition algorithms by using the Bluetooth low energy protocol, provided for the
NUCLEO-F401RE/NUCLEO-L476RG platforms with three development environments
(IAR Embedded Workbench for ARM, RealView Microcontroller Development Kit
(MDK-ARM), System Workbench for STM32).
APIs
Detailed technical information about the APIs available to the user can be found in a
compiled HTML file located inside the “Documentation” folder of the software package,
where all the functions and parameters are fully described.
2.5
Sample application description
A sample application using the X-NUCLEO-NFC01A1, X-NUCLEO-IKS01A1, X-NUCLEO6180XA1 and X-NUCLEO-IDB04A1 (or X-NUCLEO-IDB05A1) expansion boards with the
NUCLEO-F401RE or NUCELO-L476RG board is provided in the “Projects” directory.
Ready to be built projects are available for multiple IDEs.
The user can control all application behavior via UART by launching a terminal application
and setting the UART port to:




Baud rate = 460800
Data = 8 bit
Parity = none
Stop = 1 bit.
Figure 3: Terminal settings
Initially, when the user presses the reset button, the application begins initializing the UART
and the I²C interfaces and, using the NDEF standard, writes the URI
http://www.st.com/bluemicrosystem on the M24SR64-Y dynamic NFC tag on the XNUCLEO-NFC01A1 expansion board (see Figure 4: "Initialization phase"). So, when an
Android device reads the content of the NFC tag, the browser automatically launches and
tries to connect to this URI.
8/35
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 4: Initialization phase
When the user presses the blue user button (see Figure 5: "UART console output when the
BLE services are started"), the program:







initializes the SPI interface used for communicating with the BlueNRG expansion
board
identifies which BlueNRG expansion board (X-NUCLEO-IDB04A1 or X-NUCLEOIDB05A1) is connected to the STM32 Nucleo and the corresponding hardware and
firmware version
creates a random BLE MAC address and PIN necessary for establishing the
connection
initializes all the BLE services
changes the content of the M24SR64-Y dynamic NFC tag (always using the NDEF
standard) for writing all the necessary information to automatically run the BlueMS
Android application (application name, BLE advertise data, BLE MAC address and
BLE connection PIN).
checks whether the osxMotionFX, osxMotionAR, and osxMotionCP library are
initialized properly, with valid licenses.
initializes the sensors on the 6180X expansion board, including satellites.
Therefore, when an Android device with the BlueMS application reads the NFC content, it
can automatically launch the BlueMS application and form a connection with the STM32
Nucleo board, without any manual intervention.
iOS does not allow using NFC for this purpose, so you need to manually launch the
application, scan for the STM32 Nucleo board and add the connection PIN.
There is a define called OSX_BMS_SECURE_CONNECTION in the
Projects\Multi\Applications\BLUEMICROSYSTEM3\Inc\osx_bms_config.h file that can
control whether the STM32 Nucleo board only accepts secure connections (default setting)
or accepts any connection (define is commented out). In the latter case, you do not need a
BLE connection PIN to connect a device to the STM32 Nucleo board.
DocID028666 Rev 2
9/35
BLUEMICROSYSTEM3 software description
UM1991
Figure 5: UART console output when the BLE services are started
As displayed in the console output, the application sends:





every 30 ms - three quaternions in short precision
every 500 ms - the temperature/humidity/pressure and lux values
every 100 ms - the 3D accelerometer, 3D gyroscope and 3D magnetometer values
every 50 ms - the proximity value
every 10 ms - the gesture code result of the gesture recognition
This application reads the sensor data values from the accelerometer, magnetometer and
gyroscope at a frequency of 100 samples/s. The osxMotionFX (iNEMOEngine PRO) library
combines these data sensor values to produce quaternions at the same 100 quaternions/s
rate, which are transmitted to the client via the Bluetooth low energy protocol to display real
motion data using a vendor-specific BLE service. There are two definitions in the
osx_bms_config.h file which control how many quaternions the application sends to the
Bluetooth client:


10/35
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 in each Bluetooth
packet.
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
By default, the application sends three quaternions every 30 ms. In the same
osx_bms_config.h file, there are the following other defines:






ENV_UPDATE_MUL_10MS - transmission rate for temperature/pressure and
humidity/lux
ACC_GYRO_MAG_UPDATE_MUL_10MS - transmission rate for accelerometer/gyroscope
and magnetometer values
OSX_BMS_DEBUG_CONNECTION and OSX_BMS_DEBUG_NOTIFY_TRAMISSION - to
enable some debugging information for BLE communication
OSX_BMS_MOTIONAR - to enable the osxMotionAR activity recognition algorithm
OSX_BMS_MOTIONCP - to enable the osxMotionCP carry position recognition
algorithm
OSX_BMS_GESTURE - to enable the gestures recognition algorithm
The osxMotionFX (iNEMOEngine PRO) library has an auto-calibrating procedure, with the
calibration status transmitted by BLE to the client. By pressing the user button on the
NUCLEO-F401RE (or NUCLEO-L476RG) board, you can reset the library calibration status
to force a new auto-calibration procedure.
The osxMotionAR (iNEMOEngine PRO) library can recognize the following activities:






stationary
walking
fast walking
jogging
biking
driving
The osxMotionAR can be enabled by defining the OSX_BMS_MOTIONAR define in
osx_bms_config.h.
The osxMotionCP (INEMOEngine PRO) library recognizes and provides real-time
information about how the user is carrying the board; i.e., the phone carry position:






on desk
in hand
near head
shirt pocket
trouser pocket
arm swing
The osxMotionCP can be enabled by defining the OSX_BMS_MOTIONCP define in
osx_bms_config.h.
The gesture recognition can be enabled by defining the OSX_BMS_GESTURE define in
osx_bms_config. The algorithm is able to recognize single tap (moving hand from top to
bottom) and bi-directional swipes (moving hand from left to right and right to left).
When an Android/iOS device wants to connect to the STM32 Nucleo board, it starts the
secure pairing procedure and sends ping information to the stdout console BLE
characteristics (see Figure 6: "UART console output when device first connects with the
board").
DocID028666 Rev 2
11/35
BLUEMICROSYSTEM3 software description
UM1991
Figure 6: UART console output when device first connects with the board
The application has a whitelist of one element, so the next time that the same device wants
to make a connection, it is not necessary to trust it again (see Figure 7: "UART console
output when a device is already trusted").
12/35
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 7: UART console output when a device is already trusted
2.6
Android and iOS sample client application
The BLUEMICROSYSTEM3 software for STM32Cube is compatible with the BlueMS
Android/iOS applications (Version 2.1.0 or above) available at the respective Android
Play/Apple iOS stores. This section illustrates how the Android application works.
DocID028666 Rev 2
13/35
BLUEMICROSYSTEM3 software description
UM1991
After connection, BlueMS opens the main page (Figure 8: "BlueMS (Android version) start
page following BLE connection") which displays the temperature, luminosity, pressure and
humidity values.
Figure 8: BlueMS (Android version) start page following BLE connection
The following page (Figure 9: "BlueMS (Android version) osxMotionFX sensor fusion
page") shows the output of the osxMotionFX sensor fusion library with a cube that rotates
according to board movements.
14/35
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 9: BlueMS (Android version) osxMotionFX sensor fusion page
There are three buttons on this page:



The central button enables or disables the proximity sensor, which triggers the cube
zooming out/in as a function of the proximity measured by the X-NUCLEO-6180XA1
expansion board.
The left button resets the cube position
The right button shows the calibration status of the osxMotionFX library (black/green
for not calibrated/calibrated). When pressed, it forces a fresh magnetometer
calibration.
When the left or right button is pressed, the application shows a popup window advising
how to position the board for correct cube rotation and how to move the board to facilitate
calibration (See BlueMScal_1 and Figure 11: "BlueMS (Android version) calibration (2 of
2)")
DocID028666 Rev 2
15/35
BLUEMICROSYSTEM3 software description
UM1991
Figure 10: BlueMS (Android version) calibration (1 of 2)
Figure 11: BlueMS (Android version) calibration (2 of 2)
Moving to the next page (Figure 12: "BlueMS (Android version) example plot"), you can plot
data read from the sensor expansion boards.
16/35
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 12: BlueMS (Android version) example plot
By selecting the option menu (Figure 13: "BlueMS (Android version) menu selection") you
can enable the serial console (to display the stdout/stderr) or the debug console (to also
display the stdin). If you write something to the debug console, the board will return the
same test message (Figure 14: "BlueMS (Android version) serial console (stdout/stderr)"
and BlueMS_debug).
DocID028666 Rev 2
17/35
BLUEMICROSYSTEM3 software description
Figure 13: BlueMS (Android version) menu selection
18/35
DocID028666 Rev 2
UM1991
UM1991
BLUEMICROSYSTEM3 software description
Figure 14: BlueMS (Android version) serial console (stdout/stderr)
DocID028666 Rev 2
19/35
BLUEMICROSYSTEM3 software description
UM1991
Figure 15: BlueMS (Android version) debug console (stdin/stdout/stderr)
If the osxMotionAR algorithm is enabled (OSX_BMS_MOTIONAR define in
osx_bms_config.h) another page is available to display one of the following activities:






20/35
stationary
walking
fast walking
jogging
biking
driving
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 16: BlueMS (Android version) osxMotionAR activity recognition page
If the osxMotionCP algorithm is enabled (OSX_BMS_MOTIONCP define in
osx_bms_config.h), another page is available to display the information about how the user
is carrying the board; i.e., the phone carry position:






on desk
in hand
near head
shirt pocket
trouser pocket
arm swing
DocID028666 Rev 2
21/35
BLUEMICROSYSTEM3 software description
UM1991
Figure 17: BlueMS (Android version) osxMotionCP carry position recognition page
If gesture recognition is enabled, a separate page (shown below) displays the results of the
detected gestures, which can be a single tap (indicated by the circular symbol) or
directional swipes (indicated by the double arrows).
22/35
DocID028666 Rev 2
UM1991
BLUEMICROSYSTEM3 software description
Figure 18: BlueMS (Android version) gesture recognition page
DocID028666 Rev 2
23/35
System setup guide
UM1991
3
System setup guide
3.1
Hardware description
This section describes the hardware components needed for developing a sensor-based
application.
The individual components are described below.
3.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. The Arduino™
connectivity support and ST morpho headers make it easy to expand the functionality of
the STM32 Nucleo open development platform with a wide choice of specialized expansion
boards. The STM32 Nucleo board does not require any separate probe as it integrates the
ST-LINK/V2-1 debugger/programmer. The STM32 Nucleo board comes with the STM32
comprehensive software HAL library together with various packaged software examples.
Information about the STM32 Nucleo boards is available on www.st.com at
http://www.st.com/stm32nucleo
Figure 19: STM32 Nucleo board
3.1.2
X-NUCLEO-IDB04A1 expansion board
The X-NUCLEO-IDB04A1 is a Bluetooth BlueNRG expansion board usable with the
STM32 Nucleo system. The BlueNRG is a very low power Bluetooth low energy (BLE)
single-mode network processor, compliant with Bluetooth specifications core 4.0.
24/35
DocID028666 Rev 2
UM1991
System setup guide
Figure 20: X-NUCLEO-IDB04A1 BLE expansion board
Figure 21: X-NUCLEO-IDB04A1 expansion plugged on STM32 Nucleo board
Information regarding the X-NUCLEO-IDB04A1 expansion board is available on
www.st.com at http://www.st.com/x-nucleo.
3.1.3
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, which expands the functionality of the STM32
Nucleo boards. The SPBTLE-RF module is FCC (FCC ID: S9NSPBTLERF) and IC certified
DocID028666 Rev 2
25/35
System setup guide
UM1991
(IC: 8976C-SPBTLERF). The BlueNRG-MS is a very low power Bluetooth low energy
(BLE) single-mode network processor, compliant with Bluetooth specification v4.1.
X-NUCLEO-IDB05A1 is compatible with the ST morpho and Arduino UNO R3 connector
layout, and can be plugged into the Arduino UNO R3 connectors of any STM32 Nucleo
board.
Figure 22: X-NUCLEO-IDB05A1 expansion board
26/35
DocID028666 Rev 2
UM1991
System setup guide
Figure 23: X-NUCLEO-IDB05A1 plugged on STM32 Nucleo board
Information regarding the X-NUCLEO-IDB05A1 expansion board is available on
www.st.com at http://www.st.com/x-nucleo.
3.1.4
X-NUCLEO-NFC01A1 expansion board
The X-NUCLEO-NFC01A1 is an expansion board based on the M24SR64-Y device, which
can be plugged into the Arduino UNO R3 connectors of any STM32 Nucleo board.
The M24SR64-Y device is a dynamic NFC/RFID tag IC with a dual interface. It embeds a
64 Kbit EEPROM memory module, and can be operated from:


an I²C interface - a two-wire serial interface consisting of a bidirectional data line and a
clock line. The device behaves as a slave with regard to the I²C protocol
a 13.56 MHz RFID reader or an NFC phone - the RF protocol is compatible with
ISO/IEC 14443 Type A and NFC Forum Type 4 Tag.
The board is powered through the Arduino UNO R3 connectors. It also includes three
general purpose LEDs.
DocID028666 Rev 2
27/35
System setup guide
UM1991
Figure 24: X-NUCLEO-NFC01A1 M24SR64-Y dynamic NFC tag expansion board
Figure 25: STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 stack
Information about the X-NUCLEO-NFC01A1 expansion board is available on www.st.com
at http://www.st.com/x-nucleo.
3.1.5
X-NUCLEO-IKS01A1 expansion board
The X-NUCLEO-IKS01A1 is a sensor expansion board for the STM32 Nucleo system. It is
also compatible with Arduino UNO R3 connector layout and is designed around
STMicroelectronics humidity (HTS221), pressure (LPS25HB) and motion (LIS3MDL and
LSM6DS0) sensing devices. The X-NUCLEO-IKS01A1 interfaces with the STM32 MCU via
the I²C pin, and the user can change the default I²C port and the device IRQ by changing a
resistor on the evaluation board.
28/35
DocID028666 Rev 2
UM1991
System setup guide
You can attach the LSM6DS3 DIL24 expansion component and use it instead of the one of
the LSM6DS0 sensors.
Figure 26: X-NUCLEO-IKS01A1 sensor expansion board without (left) and with (right) DIL24
LSM6DS3
Information about the X-NUCLEO-IKS01A1 expansion board is available on www.st.com at
http://www.st.com/x-nucleo.
DocID028666 Rev 2
29/35
System setup guide
UM1991
Figure 27: STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 + X-NUCLEO-IKS01A1
stack
3.1.6
X-NUCLEO-6180XA1 expansion board
The X-NUCLEO-6180XA1 is an expansion board for the STM32 Nucleo board, also
compatible with Arduino UNO R3 connector layout and designed around
STMicroelectronics VL6180X proximity, gesture and ALS sensor, based on the ST
FlightSense™ Time-of-Flight technology.
The board allows the user to test VL6180X functionality and develop relevant applications.
It includes:





a 4-digit display to render either the range value in mm or the ambient light value in lux
a switch to select the value type to be displayed
a 2.8 V regulator to supply the VL6180X
two level shifters to adapt the I/O level to the microcontroller main board
the necessary connectivity for the application
To use gesture recognition, you need to plug two additional satellite sensors to the
connectors marked LEFT and RIGHT. The third connector (BOTTOM) is not used.
30/35
DocID028666 Rev 2
UM1991
System setup guide
Figure 28: X-NUCLEO-6180XA1 expansion board
DocID028666 Rev 2
31/35
System setup guide
UM1991
Figure 29: STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 + X-NUCLEO-IKS01A1
+ X-NUCLEO-6180XA1 stack
3.2
Software description
The following software components are required in order to set up the suitable
development environment for creating applications for the STM32 Nucleo equipped with
the NFC, sensors, FlightSense and BlueNRG expansion boards:


3.3
BLUEMICROSYSTEM3: a Bluetooth low energy, sensors and NFC tag software for
STM32Cube. The BLUEMICROSYSTEM3 firmware and related documentation is
available on www.st.com.
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

System Workbench for STM32 + ST-LINK
Hardware and software setup
This section describes the separate hardware and software setup procedures, as well as
the combined system setup.
3.3.1
Hardware setup
The following hardware components are required:
1.
32/35
one STM32 Nucleo Development platform (order code: NUCLEO-F401RE or
NUCLEO-L476RG)
DocID028666 Rev 2
UM1991
2.
3.
4.
5.
6.
7.
3.3.2
System setup guide
one NFC expansion board (order code: X-NUCLEO-NFC01A1)
one sensors expansion board (order code: X-NUCLEO-IKS01A1)
one FlightSense expansion board (order code: X-NUCLEO-6180XA1)
two mini-PCB VL6180X satellites (order code: VL6180X-SATEL)
one BlueNRG Bluetooth low energy expansion board (order code: X-NUCLEOIDB04A1 or X-NUCLEO-IDB05A1)
one USB type A to Mini-B USB cable to connect the STM32 Nucleo to the PC
Software setup
This section lists the minimum requirements to set up the SDK, run the sample testing
scenario based on the GUI utility and customize applications.
3.3.2.1
Development tool-chains and compilers
Choose one of the Integrated Development Environments supported by the STM32Cube
expansion software and follow the system and setup details provided by the selected IDE
provider.
3.3.3
System setup guide
This section describes how to setup different hardware parts before writing and executing
an application on the STM32 Nucleo board with the sensors expansion board.
3.3.3.1
STM32 Nucleo and sensor expansion boards setup
The STM32 Nucleo board integrates the ST-LINK/V2-1 debugger/programmer. You can
download the relevant version of the ST-LINK/V2-1 USB driver by searching STSWLINK008 or STSW-LINK009 on www.st.com (based on your version of Microsoft Windows).
Connect the following boards via the Arduino UNO R3 extension connector:




The BlueNRG BLE expansion board X-NUCLEO-IDB04A1 (or X-NUCLEO-IDB05A1)
to the STM32 Nucleo, see Figure 21: "X-NUCLEO-IDB04A1 expansion on STM32
Nucleo board" or Figure 23: "STM32 Nucleo + X-NUCLEO-IDB05A1 stack".
The Dynamic NFC tag board X-NUCLEO-NFC01A1 to the X-NUCLEO-IDB04A1 (or XNUCLEO-IDB05A1) expansion boards, see Figure 25: "STM32 Nucleo + X-NUCLEOIDB05A1 + X-NUCLEO-NFC01A1 stack".
The sensors board X-NUCLEO-IKS01A1 to the X-NUCLEO-NFC01A1 expansion
board, see Figure 27: "STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEONFC01A1 + X-NUCLEO-IKS01A1 stack".
The FlightSense board X-NUCLEO-6180XA1 to the X-NUCLEO-IKS01A1 expansion,
see Figure 29: "STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 + XNUCLEO-IKS01A1 + X-NUCLEO-6180XA1 stack". The two 6180X satellites can be
plugged onto the FlightSense board at the LEFT and RIGHT connectors.
To optimize the performance of the SPBTLE-RF module on the X-NUCLEO-IDB05A1
expansion board, and reduce interference to its antenna, you should stack the boards as
shown in Figure 29: "STM32 Nucleo + X-NUCLEO-IDB05A1 + X-NUCLEO-NFC01A1 + XNUCLEO-IKS01A1 + X-NUCLEO-6180XA1 stack".
DocID028666 Rev 2
33/35
Revision history
4
UM1991
Revision history
Table 2: Document revision history
Date
Version
25-Nov-2015
1
Initial release.
2
Throughout document: added reference to additional "gesture
recognition" algorithm, and minor text edits.
Updated Figure 1: "BLUEMICROSYSTEM3 software architecture"
Updated Section 2.5: "Sample application description"
Updated Section 2.6: "Android and iOS sample client application"
and added Figure 18: "BlueMS (Android version) gesture
recognition page"
Updated Section 3.1.6: "X-NUCLEO-6180XA1 expansion board"
Updated Section 3.3.1: "Hardware setup"
Updated Section 3.3.3.1: "STM32 Nucleo and sensor expansion
boards setup"
25-Jan-2016
34/35
Changes
DocID028666 Rev 2
UM1991
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. 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.
© 2015 STMicroelectronics – All rights reserved
DocID028666 Rev 2
35/35
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement