STMicroelectronics FP-ATR-LTE1 User Manual

UM2712
User manual
Getting started with the FP-ATR-LTE1 software package for asset tracking with
TE connectivity, GNSS and MEMS sensors
L

Introduction

The FP-A cellular connectivity and view GNSS and MEMS sensor data using standard application layer protocols.
It fully supports security and protocol requirements to interface with AWS cloud thanks to the integrated Amazon AWS IoT SDK.
This software, together with the suggested combination of STM32 and ST devices, can be used to develop asset tracking and other related applications. ST also provides an asset tracking dashboard for sensor data visualization.
The package contains examples that implements sensor data reading from a local or a remote device on the Internet.
Visit the STM32Cube ecosystem web page on www.st.com for further information
TR-LTE1is an STM32Cube function pack that allows you to connect an IoT node to Amazon Web Services using LTE
RELATED LINKS
UM2712 - Rev 2 - February 2021
For further information contact your local STMicroelectronics sales of
fice.
www.st.com

1 Acronyms and abbreviations

Table 1. List of acronyms
Acronym Description
AP Access point
BSP Base support package
FOTA Firmware update over-the-air
GNSS Global navigation satellite system
GPIO General purpose input/output
GPS Global positioning system
HAL Hardware abstraction layer
HTML Hypertext markup language
HTTP Hypertext transfer protocol
IDE Integrated development environment
IoT Internet of things
I2C Inter-integrated circuit
LTE Long-term evolution
MCU Microcontroller unit
MEMS Micro electro-mechanical systems
ODE Open development environment
REST API Representational state transfer API
SIM Subscriber identity module
SDK Software development kit
SMD Surface mount device
SSID Service set identifier
UART Universal asynchronous receiver/transmitter
URL Uniform resource locator
UM2712
Acronyms and abbreviations
UM2712 - Rev 2
page 2/28
FP-ATR-LTE1 software expansion for STM32Cube

2 FP-ATR-LTE1 software expansion for STM32Cube

2.1 Overview

The package features:
Complete firmware to connect a node with GNSS and MEMS sensors to a cellular network using LTE communication technology
Middleware library with FreeRTOS, mbedTLS and Amazon Web Services SDK
Software interface to access GNSS module (Teseo-LIV3F), temperature and humidity sensor (HTS221), pressure sensor (LPS22HB), and motion sensors (LSM6DSO, LIS2MDL and LIS2DW12)
Sample implementations available for X-NUCLEO-GNSS1A1 and X-NUCLEO-IKS01A3 expansion boards when connected to a P-L496G-CELL02 LTE cellular to cloud pack
Easy portability across different MCU families, thanks to STM32Cube
Free, user-friendly license terms
The package integrates the AWS IoT device SDK middleware with APIs to simplify interaction between the
32L496GDISCOVERY and the Amazon AWS IoT services.
You can use it to prototype end-to-end sensors-to-cloud IoT applications, by registering your board to the ST
Asset Tracking web dashboard and begin exchanging real-time sensor data and commands.
For AWS license terms, visit https://aws.amazon.com.
UM2712

2.2 Architecture

The software layers used by the application software to access and use the STM32 microcontroller, cellular (L
TE-IoT) modem and the sensor expansion boards are:
STM32Cube HAL layer: a simple, generic and multi-instance set of APIs (application programming interfaces) to interact with the upper layer applications, libraries and stack layers. The APIs are based on a common framework so that overlying software can implement functions and routines without specific microcontroller unit (MCU) hardware configurations. This structure improves library code reusability and guarantees easy portability across other devices.
Board support package (BSP) layer: drives the STM32 Nucleo board peripherals such as LEDs, user button, etc. (except the MCU), with a specific set of APIs. This interface also helps to identify the specific board version.
Middleware layers: contains mbedTLS and the Amazon AWS IoT device SDK (https://aws.amazon.com/
tools/) to facilitate the connection of the 32L496GDISCOVERY discovery kit to AWS IoT services.
UM2712 - Rev 2
page 3/28
FP-ATR-LTE1
Application
LibNMEA
Middleware
Hardware
LTE cellular to cloud pack
P-L496G-CELL02
STM32 Nucleo expansion boards
X-NUCLEO-GNSS1A1 (Sense)
FreeRTOS
LibGNSS
mbedTLS
AWS IoT SDK
X-NUCLEO-IKS01A3 (Sense)
STM32Cube Hardware Abstraction Layer (HAL)
Hardware Abstraction
UM2712
Folder structure
Figure 1. FP-A
TR-LTE1 software architecture

2.3 Folder structure

The folders in the software package are:
Documentation: a compiled HTML file generated from the source code detailing the software components and APIs (one for each project).
Drivers: HAL drivers and the board-specific drivers for each supported board or hardware platform, including those for the on-board components, and the CMSIS vendor-independent hardware abstraction layer for the ARM Cortex-M processor series.
Middlewares: middleware interface for cellular and mbedTLS, together with the porting of Amazon A device SDK.
Utilities: Tera Term script parameters
Projects: sample applications for 32L496GDISCOVERY that can be used to register a device and transmit sensor data to Amazon AWS IoT. Together with the ST Asset Tracking web dashboard, these sample applications enable easy sensor data visualization and device control through AWS IoT. Sample applications can be compiled under the IAR Embedded Workbench for ARM, RealView Microcontroller Development Kit or STM32CubeIDE development environments. For each sample application, the folder also contains a corresponding pre-compiled binary.
WS IoT
UM2712 - Rev 2
page 4/28

3 How to run the firmware application

UM2712
How to run the firmware application
Before you begin, you should set up the hardware configuration compatible with the FP-A
To set up your remote IoT application with cloud monitoring and control capability, follow the steps below.
Step 1. Configure and launch a serial terminal application.
Step 2. Download the FP-ATR-LTE1 firmware package.
Step 3. Recompile the code or flash pre-compiled binaries to your board.
Step 4. Complete the cellular setup and read the SIM ID from serial terminal.
Step 5. Open the web dashboard and register your board using the SIM ID as Device ID.
Step 6. Download the certificate and key file from the dashboard.
Step 7. Provision credentials and certificates to your board.
Step 8. Login to the dashboard.
Step 9. Visualize sensor data.

3.1 Serial terminal setup

To update the provisioning data (cellular and certificates) to the board, you have to set up a serial terminal on a PC.
A serial terminal is required to:
configure the board (cellular parameters, device credentials)
read SIM ID (used as device ID to register the device in the web dashboard)
display the published and received AWS IoT messages locally
Tera Term is used in the example below, but you can use any other similar tool.
Step 1. When using the board for the first time, connect it to your PC USB port.
TR-LTE1 function pack.
Step 2. Determine the STM32 ST-LINK Virtual COM port used for the STM32 Nucleo board.
Step 3. Open the [Device Manager].
Step 4. Open a serial terminal on the PC and connect it to the above virtual COM port.
Figure 2. Opening the COM port for the STM32 Nucleo board
UM2712 - Rev 2
page 5/28
UM2712
Configuration of cellular credentials
Step 5. Configure the terminal with the recommended parameters shown below
Figure 3. Terminal setup
Note: The virtual terminal new-line transmit configuration must be set to LineFeed (\n or LF) to allow copying and
pasting from the UNIX type text files. The “Local echo” option makes copy and paste visible on the console.
Step 6. Flash the board with the pre-compiled binaries provided in the firmware package.FP-A
Step 7. Reset the board and follow the indications on the serial terminal to configure cellular parameters and
device credentials (see the following sections).
Data entered via serial terminal is copied and stored in the Flash memory and can be reused without editing after each board reset.
.
TR-LTE1

3.2 Configuration of cellular credentials

The P-L496G-CELL02 Discovery Kit features ready-to-run firmware samples using the 2G, 3G, L NB-IoT protocols to support quick evaluation and development of AWS IoT cloud applications.
The FP-ATR-LTE1 package offers out-of-the-box connectivity for communication to the AWS IoT through the MQTT protocol. It implements a complete middleware and application-level stack in C language, which allows the connection of the P-L496G-CELL02 Discovery kit to a AWS IoT.
The Discovery Kit includes an STM32-based main board and a cellular add-on modem board.
To use the BG96 modem in Cat M1 or NB1 mode, you must insert a SIM card compliant with this network technology from an MNO that has already deployed it.
After board reset, you can initialize the cellular module.
TE Cat M1, or
UM2712 - Rev 2
page 6/28
Configuration of cellular credentials
Figure 4. Cellular module initialization and modem connection to the network
UM2712
Then, you have to connect to the dashboard and register the new device (Thing).
Figure 5. Dashboard link and Thing registration
The first sixteen bytes of the platform SIM ID are used as default Thing Name/Device ID in device registration. When connection to MNO equipment is established, the board SIM ID (that is, the sixteen bytes) is shown on the serial terminal.

3.2.1 How to register the board to the ST IoT web dashboard

To run the test application included in FP-A
dashboard, it is necessary to register the board and download the device certificate and key.
The communication between ST development boards and AWS IoT is protected by X.509 device certificate, a digital certificate that uses public key infrastructure (PKI) standard.
The dashboard automates the generation of these certificates in the ST AWS Account used to deploy and run the web application.
TR-LTE1 package and connect it to the ST Asset Tracking web
UM2712 - Rev 2
page 7/28
UM2712
Configuration of cellular credentials
Step 1. T
o register a board and generate certificates, open the ST Asset Tracking web dashboard
Figure 6. ST Asset Tracking web dashboard
Step 2. Click on [Register and configure your devices]
and complete the login procedure.
Step 3. After successful login, in the Dashboard view, click on the empty icon with the '+' sign to register your
device.
The [New Device] popup appears.
Figure 7. Enroll a new device
Step 4. Select [L
TE Cellular], enter the SIM ID as [Device ID] and a descriptive name for the device in the
[Custom Name], and click on [Submit].
Step 5. After successful device registration, a .pem file will be automatically downloaded by the web browser.
UM2712 - Rev 2
page 8/28
UM2712
Board security credential provisioning
Step 6. Y
ou can check the file in a text editor.
The text file named xxxx.pem (where xxx is the device ID) is divided into two sections:
a. The first section is the certificate of the AWS Thing created in AWS IoT core:
-----BEGIN CERTIFICATE----­...
-----END CERTIFICATE-----
b.
The second section is the private key of the AWS Thing created in AWS IoT:
-----BEGIN RSA PRIVATE KEY----­...
-----END RSA PRIVATE KEY-----
Figure 8. Content of downloaded device_id.pem file

3.3 Board security credential provisioning

To set up your board with security credentials downloaded from ST IoT web dashboard after board registration, you can enter or update credentials as follows:
if the credentials are not available in the Flash memory (blank board), the console prompts to enter device certificates and key at startup;
if the credentials are available in the Flash (pre-provisioned board), the console prompts to press the user blue button within 5 seconds after the board startup to update them.

3.3.1 Blank board

When the board is flashed with pre-compiled files, enter or update the following parameters:
AWS IoT endpoint
Thing Name
AWS Root Certificate
Thing Device Certificate
UM2712 - Rev 2
page 9/28
Loading...
+ 19 hidden pages