ST FP-SNS-FLIGHT1 User Manual Download Page 1

March 2017 

DocID029047 Rev 4 

1/50 

www.st.com

 

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. 

Summary of Contents for FP-SNS-FLIGHT1

Page 1: ... 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 portabil...

Page 2: ...n 23 2 11 Firmware over the air FOTA update with BlueMS 35 3 System setup guide 39 3 1 Hardware description 39 3 1 1 STM32 Nucleo platform 39 3 1 2 X NUCLEO IDB04A1 expansion board 40 3 1 3 X NUCLEO IDB05A1 expansion board 40 3 1 4 X NUCLEO NFC01A1 expansion board 41 3 1 5 X NUCLEO IKS01A1 expansion board 42 3 1 6 X NUCLEO IKS01A2 expansion board 43 3 1 7 X NUCLEO 6180XA1 expansion board 44 3 1 8 ...

Page 3: ...UM2026 List of tables DocID029047 Rev 4 3 50 List of tables Table 1 Acronyms and abbreviations 5 Table 2 Document revision history 49 ...

Page 4: ...l console stdout stderr 29 Figure 21 BlueMS android version Debug console stdin stdout stderr 30 Figure 22 BlueMS android version Debug console change transmission frequency 31 Figure 23 BlueMS Android version MotionAR activity recognition page 32 Figure 24 BlueMS Android version MotionCP carry position recognition page 33 Figure 25 BlueMS Android version MotionGR gesture recognition page 34 Figur...

Page 5: ...nyms and abbreviations DocID029047 Rev 4 5 50 1 Acronyms and abbreviations Table 1 Acronyms and abbreviations Acronym Description BLE Bluetooth low energy NFC Near field communication NDEF NFC data exchange format ...

Page 6: ...vity recognition algorithm based only on accelerometer data MotionCP iNEMOEngine PRO carry position detection algorithm based only on accelerometer data MotionGR iNEMOEngine PRO gesture recognition algorithm based only on accelerometer data Proximity based hand gesture detection algorithm based on VL53L0X or VL6180X proximity sensors Easy portability across different MCU families thanks to STM32Cu...

Page 7: ...ackage BSP for the BlueNRG 1 sensor expansion board proximity and ambient light sensing for X NUCLEO 6180XA1 only module and the dynamic NFC tag expansion boards and some middleware components for communication with other Bluetooth low energy devices it also enables data exchange with an NFC ready device using the NDEF standard BlueNRG is a very low power Bluetooth low energy BLE single mode netwo...

Page 8: ...read from the accelerometer magnetometer gyroscope temperature humidity pressure luminosity and proximity sensors 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 ...

Page 9: ...ge Documentation contains a compiled HTML file generated from the source code detailing 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 ...

Page 10: ...em Workbench for STM32 development environments Utilities contains the boot loader binary ready to be flashed for the STM32F401RE and STM32L476RG Nucleo boards 2 4 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 Fl...

Page 11: ... vector table offset has been set in Src system_stm32f4xx c for STM32F401 and Src system_stm32l4xx c for STM32L476 thus define VECT_TAB_OFFSET 0x4000 The linker script has also been changed For example the linker script for SP SNS FLIGHT1 running on STM32F401RE and compiled using IAR Embedded Workbench for ARM is define symbol __ICFEDIT_intvec_start__ 0x08004000 Memory Regions define symbol __ICFE...

Page 12: ...erwrites the second Flash region with FP SNS FLIGHT1 firmware and replaces its content with the FOTA restarting the board if there is no FOTA the bootloader jumps to the FP SNS FLIGHT1 firmware Figure 5 FP SNS FLIGHT1 Flash structure 2 6 The installation process The package Binary directory contains an image in bin and hex format for each platform NUCLEO F401RE NUCLEO L476RG including pre compiled...

Page 13: ...nd for each IDE IAR RealView System Workbench IAR toolchain Embedded Workbench V7 70 2 For Nucleo F4 CleanFLIGHT1_IAR_53L0A1_NF401 CleanFLIGHT1_IAR_6180XA1_NF401 bat For Nucleo L4 CleanFLIGHT1_IAR_53L0A1_NL476 bat CleanFLIGHT1_IAR_6180XA1_NL476 bat µVision toolchain MDK ARM Professional Version 5 21 1 For Nucleo F4 CleanFLIGHT1_MDK_ARM_53L0A1_NF401 bat CleanFLIGHT1_MDK_ARM_6180XA1_NF401 bat For Nu...

Page 14: ... 14 50 DocID029047 Rev 4 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 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: ... the script must be modified with the installation path for OpenOCD the installation path for STM32 OpenOCD scritps the Library path for OpenOCD TheOpenOCD script section to be edited is 1 Set the Installation path for OpenOCD example OpenOCD_DIR C Ac6 SystemWorkbench plugins fr ac6 mcu externaltools openocd win32_ 1 13 0 201701121612 tools openocd OpenOCD_DIR 2 Set the installation path for stm32...

Page 17: ...ing 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 2 8 APIs Detailed technical information regarding the APIs available to the user can be found in a compiled HTML file located inside the Documentation folder o...

Page 18: ...C 2 declares which MEMS sensor expansion board is plugged and if all the sensors are working 3 with X NUCLEO IKS01A1 checks whether the LSM6DS3 DIL24 extension is present 4 with the NDEF protocol writes the www st com stm32ode URI to the M24SR dynamic NFC tag on the X NUCLEO NFC01A1 expansion board 5 declares whether the firmware is compiled for X NUCLEO 53L0A1 or X NUCLEO 6180XA1 ...

Page 19: ...UCLEO IDB04A1 or X NUCLEOIDB05A1 is connected to the STM32 Nucleo board and the hardware and firmware versions 4 creates the random BLE MAC address and PIN necessary for the connection 5 initializes the BLE hardware service adding the temperature humidity pressure ambient light for VL6180X only distance 3D gyroscope 3D magnetometer and 3D accelerometer characteristics 6 initializes the BLE console...

Page 20: ...D029047 Rev 4 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: ...e STM32 Nucleo board only accepts secure connections default or any connection define is commented so you do not have to enter the BLE connection PIN for a device to connect to the STM32 Nucleo board As the console output shows the application sends the values of temperature humidity pressure and abient light for X NUCLEO 6180XA1 only every 500 ms the values of the 3D accelerometer 3D gyroscope an...

Page 22: ...FP SNS FLIGHT1 software description UM2026 22 50 DocID029047 Rev 4 Figure 13 UART console output when a device first connects with the board ...

Page 23: ...he 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 Version 3 0 0 or above is required for over the air firmware updates for X NUCLEO IDB05A1 Bluetooth low energy expansion boards only The Android application is used here to show how the application works After connection BlueMS s...

Page 24: ...cription UM2026 24 50 DocID029047 Rev 4 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 ...

Page 25: ...bles 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 the left button resets the cube position the right button shows the MotionFX library calibration status black for not calibrated green for calibrated Clicking it forces a magneto calibration ...

Page 26: ...e 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: ... FP SNS FLIGHT1 software description DocID029047 Rev 4 27 50 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 ...

Page 28: ...FP SNS FLIGHT1 software description UM2026 28 50 DocID029047 Rev 4 Figure 19 BlueMS android version menu selection If the Serial console is enabled stdout stderr is displayed as shown below ...

Page 29: ...tion DocID029047 Rev 4 29 50 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 ...

Page 30: ...re humidity pressure with the command TL the application sends environmental data every 5 s TM the application sends environmental data every 1 s TH the application sends environmental data every 100 ms TD the application sends environmental data as default 500 ms For 3D accelerometer 3D gyroscope and 3D magnetometer with the command AL the application sends the data every 500 ms AM the applicatio...

Page 31: ...nvironmental data every 100 ms LD the application sends environmental data as default 500 ms For distance proximity with the command PL the application sends the data every 500 ms PM the application sends the data every 100 ms PH the application sends the data every 50 ms PD the application sends the data as default 50 ms Figure 22 BlueMS android version Debug console change transmission frequency...

Page 32: ...re 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 on desk in hand near head shirt pocket trousers pocket arm swing ...

Page 33: ...ion DocID029047 Rev 4 33 50 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: ...re 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: ...n DocID029047 Rev 4 35 50 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 ...

Page 36: ...cID029047 Rev 4 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: ...e 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: ...ure 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: ...er 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 l...

Page 40: ...le 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 expansion 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 8976C SPBTLERF The BlueNRG MS is a very low power Bluetooth low energy BLE single mode network p...

Page 41: ...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 64 Kbit EEPROM memory and can be operated from an I C interface a 13 56 MHz RFID reader or a NFC phone The I C interface uses a two wire serial interface consisting of a bidirectional data line and a clock line It behaves as a slave with respect to the I C protocol The RF p...

Page 42: ...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 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 You can ...

Page 43: ...n 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 IKS01A2 interfaces with the STM32 microcontroller via the I C pin and it is possible to change the default I C ...

Page 44: ...light 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 connectivi...

Page 45: ...ectors which allows for example to develop VL53L0X applications with Bluetooth or Wi Fi interface To allow the user to quickly access the gesture recognition demonstration the X NUCLEO 53L0A1 expansion board is delivered with two VL53L0X satellites The key features are VL53L0X ranging and gesture detection sensor module accurate absolute ranging distance independent of the reflectance of the targe...

Page 46: ...nsors 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 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 ...

Page 47: ...chains and compilers Select one of the Integrated Development Environments supported by the STM32Cube expansion software and follow the system and setup information provided by the selected IDE provider 3 3 3 System setup guide This section describes how to set up different hardware parts before writing and executing an application on the STM32 Nucleo board with the sensors expansion board 3 3 3 1...

Page 48: ...d 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: ... Over The Air FOTA update and Section 2 9 Firmware Over The Air FOTA update with BlueMS 20 Feb 2017 3 Throughout document minor text and formatting changes added IKS01A2 expansion board compatibility information Added Section 2 6 The installation process Updated Section 2 9 Sample application description Section 2 10 Android and iOS sample client application and Section 2 11 Firmware over the air ...

Page 50: ...asers 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 S...

Reviews: