April 2020 UM2426 Rev 6 1/58
1
UM2426
User manual
X-CUBE-CELLULAR cellular connectivity Expansion Package for
STM32Cube
Introduction
This user manual describes the content and use of the X-CUBE-CELLULAR cellular
connectivity Expansion Package for STM32Cube.
The X-CUBE-CELLULAR Expansion Package enables connectivity over cellular networks.
The network access technology depends on the cellular modem used: 2G, 3G, LTE Cat M1,
or NB-IoT (also known as NB1). The cellular connectivity framework exposes standard APIs
for easy integration of any application interacting with a remote host using the TCP- or
UDP-over-IP protocol.
The X-CUBE-CELLULAR Expansion Package for STM32Cube provides an application
example that connects and subscribes to cloud services using the HTTP protocol in order to
report data from the device to the server, as well as to receive commands from the remote
server. Two additional applications are provided as examples: ECHO (exchanges data with
a remote server using TCP or UDP), and PING (tests the access to a remote machine).
X-CUBE-CELLULAR is available for the following hardware (refer to Chapter 1 for details):
P-L496G-CELL01 cellular-to-cloud pack with an STM32L496AG-based Discovery host
board and an add-on board based on Quectel UG96 modem (2G / 3G)
P-L496G-CELL02 cellular-to-cloud pack with an STM32L496AG-based Discovery host
board and an add-on board based on Quectel BG96 modem (LTE Cat M / NB-IoT / 2G
fallback)
B-L475E-IOT01A IoT Discovery board and add-on board with Quectel BG96 modem
B-L475E-IOT01A IoT Discovery board and add-on board with Sequans
®
GM01Q modem
32L496GDISCOVERY Discovery board and modem board based on Sequans
®
GM01Q,
or Quectel UG96 or BG96 modem
The main features of the X-CUBE-CELLULAR Expansion Package are:
Ready-to-run firmware examples using the 2G, 3G, LTE Cat M1, or NB-IoT protocols
Configuration of the HTTP and MQTT connections to the IoT platform and cellular
connectivity
Cellular connection
Reporting of such values as temperature, humidity, and pressure
Network radio level reporting
Testing of access to a remote machine
Connection and data exchange using the TCP or UDP socket protocols
www.st.com
Contents UM2426
2/58 UM2426 Rev 6
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 Terms and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Important note regarding the security . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Service connectivity description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Package description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
4.2 Modem socket versus LwIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
4.3 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
4.3.1 Architecture concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.3.2 Static architecture view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.3 Dynamic architecture view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.4 X-CUBE-CELLULAR Expansion Package description . . . . . . . . . . . . . . . 25
4.5 Folder structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.6 Reset push-button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.7 Real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5 Cellular connectivity examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1 Real network or simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2 Connection overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3 PING example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4 ECHO example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.5 GroveStreams (HTTP) access example . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.6 MQTT example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.7 COM example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6 Hardware and software environment setup . . . . . . . . . . . . . . . . . . . . . 36
7 Interacting with the host board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.1 Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42