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).
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...
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...
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...
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: ...
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.
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...
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).
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...
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;...
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...
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.
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: ...
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").
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-...
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:...
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.
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.
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...
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;...
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.
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...
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...
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...
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 ...
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 ...
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: ...
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...
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).
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...
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.
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.
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...
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
"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.
Need help?
Do you have a question about the FP-SNS-FLIGHT1 and is the answer not in the manual?
Questions and answers