ST STM32Cube User Manual

ST STM32Cube User Manual

Function pack for steval-smartag2 evaluation board with dynamic nfc tag, environmental, motion, and ambient light sensors
Hide thumbs Also See for STM32Cube:
Table of Contents

Advertisement

Quick Links

UM3073
User manual
Getting started with the STM32Cube function pack for STEVAL-SMARTAG2
evaluation board with dynamic NFC tag, environmental, motion, and ambient light
sensors
Introduction
FP-SNS-SMARTAG2
is an
STM32Cube
function pack that allows you to read the ambient light, the motion, and the
environmental sensor data on the
STEVAL-SMARTAG2
evaluation board. These functions are performed via an NFC-enabled
reader, such as a mobile phone or a tablet. The package supports battery-operated use cases.
This software, together with the suggested combination of STM32 and ST devices, can be used to develop tracking, cold chain,
medical, smart sensing, smart home, city, and building applications.
The package contains also a simple example that shows how to make the firmware update using the NFC and ST25 NFC tap
application for Android/iOS.
The software runs on an
STM32L4
ultralow power microcontroller. It includes drivers for the dynamic NFC tag and for the
ambient light, motion, and environmental sensors.
You can register the NFC sensor tag node on the
DSH-ASSETRACKING
web application for asset tracking, which stores and
monitors on-board sensor data, as well as the geo-localization of the smartphone used to read the IoT node data.
Related links
Visit the STM32Cube ecosystem web page on www.st.com for further information
UM3073 - Rev 1 - October 2022
www.st.com
For further information contact your local STMicroelectronics sales office.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32Cube and is the answer not in the manual?

Questions and answers

Summary of Contents for ST STM32Cube

  • Page 1 The package supports battery-operated use cases. This software, together with the suggested combination of STM32 and ST devices, can be used to develop tracking, cold chain, medical, smart sensing, smart home, city, and building applications.
  • Page 2: Fp-Sns-Smartag2 Software Description

    To access and use the sensor expansion board, the application software uses: • STM32Cube HAL layer: provides a simple, generic, and multiinstance set of generic and extension APIs to interact with the upper layer application, libraries, and stacks. It is directly based on a generic architecture and allows the layers that are built on it, such as the middleware layer, to implement their functions without requiring the specific hardware configuration for a given microcontroller unit (MCU).
  • Page 3: Folder Structure

    (SmarTag2) used to read the motion, luminosity, and environmental sensor data on your IoT node via an NFC-enabled reader, such as a mobile phone or a tablet a sample application (FirmwareUpdate) used to update the firmware via NFC using the ST fast transfer protocol...
  • Page 4: Apis

    UM3073 APIs APIs Detailed user-API technical information with full function and parameter descriptions is available in a compiled HTML file in the package “Documentation” folder. Sample application description The sample applications available for the STEVAL-SMARTAG2 evaluation board are: • SmarTag2 •...
  • Page 5: Figure 4. Fp-Sns-Smartag2 Uart Output Initialization

    UM3073 Sample application description When you first press the reset button, the application: • starts initializing the UART and I²C interfaces • shows the SmarTag UID • reads the last configuration written on to NFC tag (if available) • sets the NFC behavior •...
  • Page 6: Figure 5. Fp-Sns-Smartag2 Uart Output Auto-Start

    UM3073 Sample application description Figure 5. FP-SNS-SMARTAG2 UART output auto-start When the smartphone is close to the NFC tag, the message "Detected NFC FIELD On" appears. UM3073 - Rev 1 page 6/42...
  • Page 7: Figure 6. Fp-Sns-Smartag2 Uart Output Nfc On

    UM3073 Sample application description Figure 6. FP-SNS-SMARTAG2 UART output NFC on When the smartphone is kept distant from the NFC tag, the message "Detected NFC FIELD Off" appears together with the new configuration if a new one is detected. UM3073 - Rev 1 page 7/42...
  • Page 8: Figure 7. Fp-Sns-Smartag2 Uart Output Nfc Off

    UM3073 Sample application description Figure 7. FP-SNS-SMARTAG2 UART output NFC off 1.5.1.1 SmarTag2: Android and iOS sample client application The SmarTag2 application is compatible with the STAssetTracking Android (version 3.1.0 or higher)/iOS (version 3.1.0 or higher) application and with the STNFCSensor Android/iOS application (version 1.4.0 or higher) available at their respective GooglePlay/App store.
  • Page 9: Figure 8. Sign-In With Myst (1 Of 2)

    UM3073 Sample application description 1.5.1.1.1 Sign-in with MyST If you are not signed-in or you are not registered on MyST, when you open the STAssetTracking application, the following page appears. Figure 8. Sign-in with MyST (1 of 2) Click on "Sign-in with MyST". Then, insert your e-mail address and password to execute the login if you are already registered.
  • Page 10: Figure 9. Sign-In With Myst (2 Of 2)

    UM3073 Sample application description Figure 9. Sign-in with MyST (2 of 2) 1.5.1.1.2 How to register a new device After signing-in to MyST, when reopening, the STAssetTracking application shows the following page. UM3073 - Rev 1 page 10/42...
  • Page 11: Figure 10. Stassettracking After Signing-In To Myst

    UM3073 Sample application description Figure 10. STAssetTracking after signing-in to MyST Click on the "+" button to register a new device and scroll down to find the Smartag2 device. UM3073 - Rev 1 page 11/42...
  • Page 12: Figure 11. Stassettracking - Registering A New Device (1 Of 3)

    UM3073 Sample application description Figure 11. STAssetTracking - registering a new device (1 of 3) Click on the add button and put the mobile phone on top the device to detect the tag by NFC. When the tag is detected, the device ID is shown: UM3073 - Rev 1 page 12/42...
  • Page 13: Figure 12. Stassettracking - Registering A New Device (2 Of 3)

    UM3073 Sample application description Figure 12. STAssetTracking - registering a new device (2 of 3) Insert the device name and click on the add button to complete the process. UM3073 - Rev 1 page 13/42...
  • Page 14: Figure 13. Stassettracking - Registering A New Device (3 Of 3)

    UM3073 Sample application description Figure 13. STAssetTracking - registering a new device (3 of 3) After the device is registered, the STAssetTracking shows it in the device list. UM3073 - Rev 1 page 14/42...
  • Page 15: Figure 14. Stassettracking - Device List

    UM3073 Sample application description Figure 14. STAssetTracking - device list 1.5.1.1.3 Settings Start the STAssetTracking application and select your device from the list. UM3073 - Rev 1 page 15/42...
  • Page 16: Figure 15. Stassettracking - Device Info

    UM3073 Sample application description Figure 15. STAssetTracking - device info Select settings and put the mobile phone on top the device to detect the tag by NFC. When the tag is detected, the application shows the following page. UM3073 - Rev 1 page 16/42...
  • Page 17: Figure 16. Stassettracking - Settings

    UM3073 Sample application description Figure 16. STAssetTracking - settings From this page, you can select the data to be logged (temperature, pressure, luminosity, IMU accelerometer, 6-axis orientation, and tilt) with the related data range as well as the time interval. 1.5.1.1.4 Extremes This page shows the maximum and minimum values obtained during the logging of the selected data.
  • Page 18: Figure 17. Stassettracking - Extremes

    UM3073 Sample application description Figure 17. STAssetTracking - Extremes 1.5.1.1.5 Samples This page collects all the data logging for the selected data with the related data range. UM3073 - Rev 1 page 18/42...
  • Page 19: Firmwareupdate And Simplebootloader Applications Description

    The FirmwareUpdate application must work with the SimpleBootLoader example to enable the firmware update capability. The FirmwareUpdate receives the new firmware via NFC using the ST FTM protocol and saves it on the right flash memory region. The SimpleBootLoader replaces the FirmwareUpdate firmware currently running with the new version received via NFC.
  • Page 20: Figure 19. Fp-Sns-Smartag2 Terminal Setting

    UM3073 Sample application description Figure 19. FP-SNS-SMARTAG2 terminal setting Note: To enable/disable this UART functionality on the STEVAL-SMARTAG2 board, you must recompile the code by uncommenting/commenting the line: #define SMARTAG2_ENABLE_PRINTF in the Projects\ STM32L4P5CE- SmarTag2\Applications\ FirmwareUpdate\Inc\Firmware_conf.h file. When you first press the reset button, the application: •...
  • Page 21: Figure 20. Fp-Sns-Smartag2 Uart Output Initialization

    UM3073 Sample application description Figure 20. FP-SNS-SMARTAG2 UART output initialization After pressing the user button, the fast transfer mode (FTM) starts. Figure 21. FP-SNS-SMARTAG2 - FTM After the firmware update, the board restarts. For further details on how to execute the firmware update, see Section 1.5.2.5 FirmwareUpdate: Android and iOS sample client application.
  • Page 22: Figure 22. Fp-Sns-Smartag2 - Board Restart (1 Of 3)

    UM3073 Sample application description Figure 22. FP-SNS-SMARTAG2 - board restart (1 of 3) Figure 23. FP-SNS-SMARTAG2 - board restart (2 of 3) UM3073 - Rev 1 page 22/42...
  • Page 23: Figure 24. Fp-Sns-Smartag2 - Board Restart (3 Of 3)

    UM3073 Sample application description Figure 24. FP-SNS-SMARTAG2 - board restart (3 of 3) 1.5.2.2 The installation process The package binary directory contains: • precompiled firmware to be flashed with the STM32CubeProgrammer to the correct memory address (0x08002000) Note: This precompiled binary is compatible with the firmware update procedure. •...
  • Page 24: Figure 25. Binary Folder

    UM3073 Sample application description Figure 25. Binary folder A batch script is provided to simplify the operation described before by saving the firmware and the bootloader to the right position. It is available for each IDE (IAR/RealView/STM32CubeIDE). This script: performs a full flash memory erase to start from a clean system flashes the bootloader to the correct position (0x08000000) flashes the firmware to the correct position (0x08002000) The script also dumps an image that contains the bootloader and the firmware.
  • Page 25: Figure 26. Flash Memory Management

    UM3073 Sample application description Figure 26. Flash memory management 1.5.2.4 The boot process The FirmwareUpdate cannot be flashed to the beginning of the flash memory (address 0x08000000). Therefore, it is compiled to run from the beginning of the second flash memory region (address0x08002000). To enable this functionality, we have set the vector table offset with respect to the default value by modifying the Src/system_stm32l4xx.c files using the #defineVECT_TAB_OFFSET 0x2000 define.
  • Page 26: Figure 27. Firmwareupdate Application

    UM3073 Sample application description For example, the linker script used for running and compiled using IAR Embedded Workbench for ARM is: /*###ICF### Section handled by ICF editor, don't touch! ****/ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ /*-Specials-*/ define symbol __ICFEDIT_intvec_start__ = 0x08002000; /*-Memory Regions-*/ define symbol __ICFEDIT_region_ROM_start__ = 0x08002000;...
  • Page 27: Figure 28. St25 Nfc Tag App - Tag Info

    UM3073 Sample application description Figure 28. ST25 NFC tag app - tag info Select "FTM Demos" and click "continue". UM3073 - Rev 1 page 27/42...
  • Page 28: Figure 29. St25 Nfc Tag App - Ftm Demos

    UM3073 Sample application description Figure 29. ST25 NFC tag app - FTM demos Select "Firmware Update", choose “Pick up a firmware in phone’s memory storage" and click "continue". UM3073 - Rev 1 page 28/42...
  • Page 29: Figure 30. St25 Nfc Tag App - Firmware Update

    UM3073 Sample application description Figure 30. ST25 NFC tag app - firmware update Select the firmware file and enter the password (12345678 is the default one). UM3073 - Rev 1 page 29/42...
  • Page 30: Figure 31. St25 Nfc Tag App - Password Entering

    UM3073 Sample application description Figure 31. ST25 NFC tag app - password entering Wait for the firmware update to finish. UM3073 - Rev 1 page 30/42...
  • Page 31: Figure 32. St25 Nfc Tag App - Firmware Update Complete

    UM3073 Sample application description Figure 32. ST25 NFC tag app - firmware update complete UM3073 - Rev 1 page 31/42...
  • Page 32: Using The Asset Tracking Web Dashboard

    UM3073 Using the Asset Tracking web dashboard Using the Asset Tracking web dashboard Step 1. Go to DSH asset tracking web dashoboard. Figure 33. DSH-ASSETRACKING dashboard homepage Step 2. Select login, click [GO] button and provide your username and password. Figure 34.
  • Page 33: Figure 35. Dsh-Assetracking Dashboard - Adding Device

    UM3073 Using the Asset Tracking web dashboard Step 3. Add the new device. Figure 35. DSH-ASSETRACKING dashboard - adding device UM3073 - Rev 1 page 33/42...
  • Page 34: Figure 36. Dsh-Assetracking Dashboard - Selecting The Device

    Select the device you want to monitor. Figure 36. DSH-ASSETRACKING dashboard - selecting the device Figure 37. DSH-ASSETRACKING dashboard - selecting telemetry To upload data on the cloud, you can also register the device from the ST Asset Tracking application. UM3073 - Rev 1 page 34/42...
  • Page 35: Figure 38. Uploading Data The Cloud Through St Asset Tracking Application

    UM3073 Using the Asset Tracking web dashboard Figure 38. Uploading data the cloud through ST Asset Tracking application Figure 39. ST Asset Tracking application - data uploaded to the cloud and related plots UM3073 - Rev 1 page 35/42...
  • Page 36: System Setup Guide

    FP-SNS-SMARTAG2: complete firmware to access data from an IoT node with a dynamic NFC tag, environmental, ambient light, and motion sensors and to enable the firmware update by NFC. The package provides easy portability across different MCU families, thanks to STM32Cube. The FP-SNS-SMARTAG2 firmware and related documentation is available on www.st.com.
  • Page 37: Steval-Smartag2 Evaluation Board Setup

    UM3073 STEVAL-SMARTAG2 evaluation board setup STEVAL-SMARTAG2 evaluation board setup To program the STEVAL-SMARTAG2 evaluation board, use the STLINK-V3SET (or STLINK-V3MINI) debugger/ programmer. Download the relevant version of the STLINK-V3SET (or STLINK-V3MINI) USB driver by clicking STSW-LINK007 or STSW-LINK009. Step 1. Connect the STLINK-V3SET (or STLINK-V3MINI) to your PC.
  • Page 38: Revision History

    UM3073 Revision history Table 1. Document revision history Date Revision Changes 07-Oct-2022 Initial release. UM3073 - Rev 1 page 38/42...
  • Page 39: Table Of Contents

    UM3073 Contents Contents FP-SNS-SMARTAG2 software description ......... 2 Overview .
  • Page 40: List Of Tables

    UM3073 List of tables List of tables Table 1. Document revision history ............. 38 UM3073 - Rev 1 page 40/42...
  • Page 41: List Of Figures

    Figure 39. ST Asset Tracking application - data uploaded to the cloud and related plots ......35 Figure 40.
  • Page 42 ST’s terms and conditions of sale in place at the time of order acknowledgment. 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’...

This manual is also suitable for:

Fp-sns-smartag2

Table of Contents