ST FP-SNS-FLIGHT1 User Manual

ST FP-SNS-FLIGHT1 User Manual

Stm32 ode function pack for iot node with nfc, ble connectivity and environmental, motion and time-of-flight sensors
Hide thumbs Also See for FP-SNS-FLIGHT1:
Table of Contents

Advertisement

Quick Links

UM2026
User manual
Getting started with the STM32 ODE function pack for IoT node with NFC,
BLE connectivity and environmental, motion and Time-of-Flight sensors
Introduction
FP-SNS-FLIGHT1 is an STM32 ODE function pack for connecting an IoT node to a smartphone via
Bluetooth low energy and view real time humidity, pressure, motion, proximity and ambient light sensor
data (for X-NUCLEO-6180XA1 only).
It uses the NDEF standard for simple and secure Bluetooth pairing, storing the necessary information on
the NFC tag and thus simplifying the device configuration. It includes the functionality to perform
firmware over-the-air updating (FOTA) with the ST BlueMS application for Android/iOS devices.
This package lets you jump-start your sensor node development so that you can focus on adding
desired functions.
The expansion is built on STM32Cube software technology to ease portability across different STM32
microcontrollers.
The software comes with sample driver implementations running on the X-NUCLEO-IKS01A2 (or X-
NUCLEO-IKS01A1), X-NUCLEO-53L0A1 (or X-NUCLEO-6180XA1), X-NUCLEO-NFC01A1 and the X-
NUCLEO-IDB05A1 (or X-NUCLEO-IDB04A1) boards connected to a NUCLEO-F401RE or NUCLEO-
L476RG development board.
March 2017
DocID029047 Rev 4
1/50
www.st.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FP-SNS-FLIGHT1 and is the answer not in the manual?

Questions and answers

Summary of Contents for ST FP-SNS-FLIGHT1

  • Page 1 BLE connectivity and environmental, motion and Time-of-Flight sensors Introduction FP-SNS-FLIGHT1 is an STM32 ODE function pack for connecting an IoT node to a smartphone via Bluetooth low energy and view real time humidity, pressure, motion, proximity and ambient light sensor data (for X-NUCLEO-6180XA1 only).
  • Page 2: Table Of Contents

    Contents UM2026 Contents Acronyms and abbreviations ............5 FP-SNS-FLIGHT1 software description.......... 6 Overview ................... 6 Architecture ..................7 Folder structure ................. 9 Flash organization ................10 The boot process ................11 The installation process ..............12 Firmware-over-the-air (FOTA) update ..........17 APIs ....................
  • Page 3 UM2026 List of tables List of tables Table 1: Acronyms and abbreviations ......................5 Table 2: Document revision history ......................49 DocID029047 Rev 4 3/50...
  • Page 4 UM2026 List of figures Figure 1: FP-SNS-FLIGHT1 software architecture ..................9 Figure 2: FP-SNS-FLIGHT1 package folder structure ................9 Figure 3: FP-SNS-FLIGHT1 Flash structure .................... 11 Figure 4: Bootloader folder content ......................12 Figure 5: FP-SNS-FLIGHT1 Flash structure .................... 12 Figure 6: Binary folder content ........................
  • Page 5: Acronyms And Abbreviations

    UM2026 Acronyms and abbreviations Acronyms and abbreviations Table 1: Acronyms and abbreviations Acronym Description Bluetooth low energy Near field communication NDEF NFC data exchange format DocID029047 Rev 4 5/50...
  • Page 6: Fp-Sns-Flight1 Software Description

    FP-SNS-FLIGHT1 software description UM2026 FP-SNS-FLIGHT1 software description Overview The key features of the FP-SNS-FLIGHT1 package are:  For STM32 Nucleo board with X-NUCLEO-IKS01A1 expansion boards, complete middleware to build applications using temperature and humidity sensors (HTS221), pressure sensor (LPS25HB), motion sensors (LIS3MDL and LSM6DS0), motion...
  • Page 7: Architecture

    UM2026 FP-SNS-FLIGHT1 software description  recognized carry position using the MotionCP algorithm  recognized gesture using the MotionGR algorithm  the hand gesture recognized by the gesture detection middleware  the third is the Console service that includes two characteristics: ...
  • Page 8 Version 3.0.0 or higher allows over-the-air firmware update (with X-NUCLEO-IDB05A1 Bluetooth low energy expansion boards only). The ST BlueMS Android/iOS application was developed to enable NFC pairing prior to sensor data transmission. The software layers used by the application software to access and use the Sensors expansion boards are: ...
  • Page 9: Folder Structure

    The next figure outlines the software architecture of the package: Figure 1: FP-SNS-FLIGHT1 software architecture Folder structure Figure 2: FP-SNS-FLIGHT1 package folder structure The following folders are included in the software package:  Documentation: contains a compiled HTML file generated from the source code, detailing the software components and APIs.
  • Page 10: Flash Organization

    Utilities: contains the boot loader binary ready to be flashed for the STM32F401RE and STM32L476RG Nucleo boards. Flash organization Apart from storing its code, FP-SNS-FLIGHT1 uses the Flash memory to allow the Firmware-Over-The-Air update. To enable this feature the Flash memory is divided into three different regions (see Figure 3: "FP-SNS-FLIGHT1 Flash...
  • Page 11: The Boot Process

    FP-SNS-FLIGHT1 software description Figure 3: FP-SNS-FLIGHT1 Flash structure The boot process The FP-SNS-FLIGHT1 cannot be flashed at the beginning of the Flash memory (address 0x08000000); therefore it is compiled to run from the beginning of the second Flash region (0x08004000).
  • Page 12: The Installation Process

    FOTA update procedure  pre-compiled FLIGHT1 plus BootLoader firmware that may be directly flashed to a supported STM32 Nucleo development board with the ST-LINK or via a Drag & Drop 12/50 DocID029047 Rev 4...
  • Page 13: Figure 6: Binary Folder Content

    FOTA update procedure Figure 6: Binary folder content To flash modified FLIGHT1 firmware, simply flash the compiled FP-SNS-FLIGHT1 firmware to the correct address (0x08004000). A batch script has been provided to simplify this operation by saving the firmware and the BootLoader on the right position;...
  • Page 14: Figure 7: Content Of A Project Folder

    FP-SNS-FLIGHT1 software description UM2026 Figure 7: Content of a project folder 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...
  • Page 15: Figure 8: Bootloader And Fp-Sns-Flight1 Installation

    UM2026 FP-SNS-FLIGHT1 software description Figure 8: BootLoader and FP-SNS-FLIGHT1 installation 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 like in the same way as the image provided in the Binary folder.
  • Page 16: Figure 9: Fp-Sns-Flight1 Dump Process

    Figure 9: FP-SNS-FLIGHT1 dump process 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 only included in the System Workbench IDE: ...
  • Page 17: Firmware-Over-The-Air (Fota) Update

    If the CRC calculation matches the BlueMS CRC value, the new firmware is written from the beginning of the third Flash region. A “magic number” prompts the boot loader that a firmware update has been received, checked and is ready to replace the current FP-SNS-FLIGHT1 firmware (see Section 2.11: "Firmware over-the-air (FOTA) update with BlueMS").
  • Page 18: Figure 10: Terminal Setting

    X-NUCLEO-IKS01A1, checks whether the LSM6DS3 DIL24 extension is present with the NDEF protocol, writes the www.st.com/stm32ode URI to the M24SR dynamic NFC tag on the X-NUCLEO-NFC01A1 expansion board declares whether the firmware is compiled for X-NUCLEO-53L0A1 or X-NUCLEO-...
  • Page 19: Figure 11: Initialization Phase

    UM2026 FP-SNS-FLIGHT1 software description Figure 11: Initialization phase When reading the NFC tag content with an Android device, the browser automatically starts and tries to connect to that URI. When the user presses the blue user button (see Figure 12: "UART console output when the BLE services are started"), the program:...
  • Page 20: Figure 12: Uart Console Output When The Ble Services Are Started

    FP-SNS-FLIGHT1 software description UM2026 Figure 12: UART console output when the BLE services are started When reading the above NFC content on an Android device with the BlueMS application installed, it is possible to automatically launch the BlueMS application to connect the device...
  • Page 21 UM2026 FP-SNS-FLIGHT1 software description with the STM32 Nucleo board, without having to scan for the board or manually insert the PIN. iOS does not allow the use of NFC for this purpose, so you must manually run the application, scan for the STM32 Nucleo board and enter the connection PIN.
  • Page 22: Figure 13: Uart Console Output When A Device First Connects With The Board

    FP-SNS-FLIGHT1 software description UM2026 Figure 13: UART console output when a device first connects with the board 22/50 DocID029047 Rev 4...
  • Page 23: Android And Ios Sample Client Application

    Figure 14: UART console output when one device are already trusted 2.10 Android and iOS sample client application The FP-SNS-FLIGHT1 software for STM32Cube is compatible with the BlueMS Android/iOS applications (Version 2.2.0 and above), available at the respective Google Play/iOS stores.
  • Page 24: Figure 15: Bluems (Android Version) Main Page (After Ble Connection)

    FP-SNS-FLIGHT1 software description UM2026 Figure 15: BlueMS (android version) main page (after BLE connection) If the MotionFX sensor fusion library is enabled, the following page shows a cube that rotates according to the board movement. 24/50 DocID029047 Rev 4...
  • Page 25: Figure 16: Bluems (Android Version) Motionfx Sensor Fusion Page

    UM2026 FP-SNS-FLIGHT1 software description Figure 16: BlueMS (Android version) MotionFX sensor fusion page In the page above:  the central button enables or disables the proximity sensor, which triggers the cube zooming out or in as a function of the proximity measured by the X-NUCLEO-53L0A1 (or X-NUCLEO-6180XA1) expansion board;...
  • Page 26: Figure 17: Bluems (Android Version) Popup Windows

    FP-SNS-FLIGHT1 software description UM2026 When a button is pressed, the application pops up a window describing how to position the board for a correct cube rotation and how to move the board to facilitate calibration (see figure below). Figure 17: BlueMS (Android version) popup windows On the next page to the left, you can plot any value from the sensor expansion boards.
  • Page 27: Figure 18: Bluems (Android Version) Example Of Plot Value

    UM2026 FP-SNS-FLIGHT1 software description Figure 18: BlueMS (android version) example of plot value In the option menu below, you can access:  Serial or Debug (with stdin) console  firmware upgrade DocID029047 Rev 4 27/50...
  • Page 28: Figure 19: Bluems (Android Version) Menu Selection

    FP-SNS-FLIGHT1 software description UM2026 Figure 19: BlueMS (android version) menu selection If the Serial console is enabled, stdout/stderr is displayed, as shown below. 28/50 DocID029047 Rev 4...
  • Page 29: Figure 20: Bluems (Android Version) Serial Console (Stdout/Stderr)

    UM2026 FP-SNS-FLIGHT1 software description Figure 20: BlueMS (android version) Serial console (stdout/stderr) If the Debug console is enabled, stdin is displayed and any message written in the Debug console triggers a reply with the same message, as shown below. DocID029047 Rev 4...
  • Page 30: Figure 21: Bluems (Android Version) Debug Console (Stdin/Stdout/Stderr)

    FP-SNS-FLIGHT1 software description UM2026 Figure 21: BlueMS (android version) Debug console (stdin/stdout/stderr) Through the Debug console, you can change the sensor value transmission frequency.  For temperature/humidity/pressure with the command:  @TL: the application sends environmental data every 5 s ...
  • Page 31: Figure 22: Bluems (Android Version) Debug Console - Change Transmission Frequency

    UM2026 FP-SNS-FLIGHT1 software description  @AH: the application sends the data every 50 ms  @AD: the application sends the data as default (100 ms).  For ambient light (lux) with the command (for VL6180X only):  @LL: the application sends environmental data every 5 s ...
  • Page 32: Figure 23: Bluems (Android Version) Motionar Activity Recognition Page

    FP-SNS-FLIGHT1 software description UM2026  jogging  biking  driving Figure 23: BlueMS (Android version) MotionAR activity recognition page If the MotionCP 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: ...
  • Page 33: Figure 24: Bluems (Android Version) Motioncp Carry Position Recognition Page

    UM2026 FP-SNS-FLIGHT1 software description Figure 24: BlueMS (Android version) MotionCP carry position recognition page If the MotionGR algorithm is enabled, the page shown below is available with gesture recognition information:  pick up  glance  wake up in hand...
  • Page 34: Figure 25: Bluems (Android Version) Motiongr Gesture Recognition Page

    FP-SNS-FLIGHT1 software description UM2026 Figure 25: BlueMS (Android version) MotionGR gesture recognition page If gesture detection is enabled, the 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).
  • Page 35: Firmware Over-The-Air (Fota) Update With Bluems

    UM2026 FP-SNS-FLIGHT1 software description Figure 26: BlueMS (Android version) gesture detection page 2.11 Firmware over-the-air (FOTA) update with BlueMS If the 'Firmware upgrade' menu option is selected in the BlueMS main application page, the following page appears: DocID029047 Rev 4...
  • Page 36: Figure 27: Bluems (Android Version) Firmware Upgrade Page

    FP-SNS-FLIGHT1 software description UM2026 Figure 27: BlueMS (Android version) firmware upgrade page The BlueMS application shows which version of the FP-SNS-FLIGHT1 software is running and the board type. To apply an update, press the red button and select the appropriate update file.
  • Page 37: Figure 28: Bluems (Android Version) Firmware Update File Selection

    FP-SNS-FLIGHT1 software description Figure 28: BlueMS (Android version) firmware update file selection BlueMS sends to FP-SNS-FLIGHT1 an update of a certain byte size and corresponding CRC value. The figure below shows the terminal window with the debug information returned during FOTA for an STM32 Nucleo platform (STM32F401RE/L476RG) when we use a UART to control FP-SNS-FLIGHT1 behavior.
  • Page 38: Figure 29: Terminal Window Information During Fota

    FP-SNS-FLIGHT1 software description UM2026 Figure 29: Terminal window information during FOTA During the FOTA procedure, the BlueMS application shows the remaining packets to be sent, and the total update time when the procedure has finished. Figure 30: BlueMS (Android version) application page during FOTA and on completion...
  • Page 39: System Setup Guide

    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.
  • Page 40: X-Nucleo-Idb04A1 Expansion Board

    SPBTLERF). The BlueNRG-MS is a very low power Bluetooth low energy (BLE) single- mode network processor, compliant with Bluetooth specification v4.2. X-NUCLEO-IDB05A1 is compatible with the ST morpho and Arduino™ UNO R3 connector layout. This expansion board can be plugged into the Arduino UNO R3 connectors of any STM32 Nucleo board.
  • Page 41: X-Nucleo-Nfc01A1 Expansion Board

    UM2026 System setup guide Figure 33: 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 3.1.4 X-NUCLEO-NFC01A1 expansion board The X-NUCLEO-NFC01A1 is an expansion board based on the M24SR64-Y device. This expansion board can be plugged on the Arduino UNO R3 connectors of any STM32 Nucleo board.
  • Page 42: X-Nucleo-Iks01A1 Expansion Board

    System setup guide UM2026 Figure 34: X-NUCLEO-NFC01A1 M24SR64-Y dynamic NFC tag expansion board Information regarding 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 board. It is also compatible with Arduino UNO R3 connector layout and is designed around humidity (HTS221), pressure (LPS25HB) and motion (LIS3MDL and LSM6DS0) sensing devices.
  • Page 43: X-Nucleo-Iks01A2 Expansion Board

    UM2026 System setup guide Figure 35: X-NUCLEO-IKS01A1 expansion board 3.1.6 X-NUCLEO-IKS01A2 expansion board The X-NUCLEO-IKS01A2 is a motion MEMS and environmental sensor expansion board for the STM32 Nucleo. It is equipped with 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.
  • Page 44: X-Nucleo-6180Xa1 Expansion Board

    The X-NUCLEO-6180XA1 is an expansion board for the STM32 Nucleo system, 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.
  • Page 45: X-Nucleo-53L0A1 Expansion Board

    3.1.8 X-NUCLEO-53L0A1 expansion board The X-NUCLEO-53L0A1 is an expansion board for the STM32 Nucleo system, also compatible with Arduino UNO R3 connector layout and designed around ST VL53L0X ranging and gesture detection sensor, based on ST FlightSense™, Time-of-Flight technology. Several ST expansion boards can be superposed through the Arduino connectors, which allows, for example, to develop VL53L0X applications with Bluetooth or Wi-Fi interface.
  • Page 46: Software Description

    STM32 Nucleo equipped with the NFC, sensors, FlightSense and BlueNRG expansion boards:  FP-SNS-FLIGHT1: a Bluetooth low energy, sensors and NFC tag software for STM32Cube. The FP-SNS-FLIGHT1 firmware and related documentation is available on www.st.com.
  • Page 47: Hardware And Software Setup

    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 STSW- LINK008 or STSW-LINK009 on www.st.com (based on your version of Microsoft Windows).
  • Page 48: Figure 39: Stm32 Nucleo Development Board Plus X-Nucleo-Idb05A1, X-Nucleo-Nfc01A1, X-Nucleo-Iks01A1 And X-Nucleo-6180Xa1 Expansion Boards

    System setup guide UM2026 Figure 39: STM32 Nucleo development board plus X-NUCLEO-IDB05A1, X-NUCLEO-NFC01A1, X-NUCLEO-IKS01A1 and X-NUCLEO-6180XA1 expansion boards You must connect the boards in the sequence described above to optimize the performance of the SPBTLE-RF module on the X-NUCLEO-IDB05A1 expansion board and to reduce interference from its antenna.
  • Page 49: Revision History

    "Initialization phase", Figure 5: "UART console output when the BLE services are started", Figure 6: "UART console output when a device first connects with the board", Figure 15: "BlueMS (android version) initial page after BLE connection", Figure 1: "FP-SNS-FLIGHT1 05-Dec-2016 software architecture" and Figure 18: "BlueMS (android version) Serial console (stdout/stderr)";...
  • Page 50 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.

Table of Contents