STM Discovery B-L072Z-LRWAN1
Introduction
The STMicrolectronics Discovery B-L072Z-LRWAN1 “Evaluation Board” (EVB) features the Murata CMWX1ZZABZ-091 LoRaWAN module, and full source-code is available for this board, and including source code for the LoRaWAN MAC, as well as some example applications. The distributor in New Zealand for this EVB is Arrow Electronics.
To get started developing for this board, first set up a suitable development environment and then go to Getting Started.
- STMicrolectronics Discovery B-L072Z-LRWAN1
- Arrow Electronics
- Custom Firmware Development
- Getting Started
Features
- STM32L0 32-bit microcontroller based on a 32 MHz ARM Cortex-M0+ processor
- Semtech LoRa SX1276 transceiver
- Support for Class A and Class C operating modes
- STM32Cube Expansion API’s and firmware with source code, project files, and example applications
- Arduino shield compatible pin headers
- Integrated USB ST-Link v2.1 and USB bulk-storage controller
- Mbed OS support (STM Discovery B-L072Z-LRWAN1)
Additional Information
Getting Started
If you configure the B-L072Z-LRWAN1 with the AT_Slave
application firmware, then the first steps to getting started are to:
- install ST-Link v2 drivers;
- install serial-port drivers (for Windows users);
- set up a suitable development environment/toolchain, to generate firmware images;
- upload a firmware image to the device;
- provision the B-L072Z-LRWAN1 so that it’s registered with our network;
- establish a serial connection to the end-device, and issue
AT+JOIN
to join the network;
Provisioning is required so that Spark LoRaWAN knows about your B-L072Z-LRWAN1 device so that you can connect it to the Internet. If a suitable development environment has not been set up already, then see the following section (Custom Firmware Development) for how to do this. You need a suitable compiler toolchain so that you can compile firmware for the B-L072Z-LRWAN1 board. This also involves fetching the latest STM32Cube Expansion LRWAN source-code distribution, which was v1.2.1 when this guide was written.
Installing the Firmware Distribution
Unzip the en.i-cube_lrwan.zip distribution into a suitable location; e.g., your Docments
folder on a Windows PC. Then, launch the Keil uVision 5 MDK, and from the Project
menu item, select Open Project...
to navigate to a project to load, from the STM32Cube Expansion LRWAN distribution. The End_Node
example application demostrates how firmware for a sensor end-device could be written, for the B-L072Z-LRWAN1 board, and the AT_Slave
project turns the B-L072Z-LRWAN1 into an “AT modem” where AT commands can be used to configure the device, as well as to connect your device to the Internet using your Spark LoRaWAN subscriber account and connectivity plan, and then send and receive messages.
AS923 Rejoin Bug
All known firmware versions (as of 18-02-2019) for the B-L072Z-LRWAN1 are affected by the problem where attempts to rejoin the network would fail. But this has been fixed for Multitech firmware releases from v3.1.0 onwards; i.e, this version is capable of rejoining the network by issuing an AT+JOIN
. This problem was due to a bug in the upstream LoRaMAC code that affected nearly all devices and manufacturers.
AT Modem Project: AT_Slave
The default baud-rate is 9600
, and after flashing the B-L072Z-LRWAN1 it will need to be reset. Then issue:
in a suitable serial-port terminal (emulator), to see that the device is functioning correctly.
The B-L072Z-LRWAN1 AT modem commands are case-sensitive, whereas this is not the case with all other devices; for example, the AT modem commands for MultiTech mDot and xDot devices are not case-sensitive.
Custom Firmware Development
STMicrolectronics provides the full source-code for the B-L072Z-LRWAN1 via its STM32Cube Expansion LRWAN distribution. This allows custom firmware to be developed for its ARM Cortex-M0+ processor. The developer resources page for getting set up for firmware-development targetting AS923 contains information on how to set up a suitable compiler toolchain so that you can quickly begin development for this board.
- Toolchain Setup for AS923
- AS923 Regional Information
- STM32Cube Expansion LRWAN
- ST-Link USB Driver (Windows)
- ST-Link Firmware Upgrade (OPTIONAL)
- ST-Link Server (OPTIONAL)
- Tera Term (OPTIONAL)
On Windows computers, you will probably need to install the USB ST-Link and serial port drivers by installing the drivers (ST-Link USB Driver).
Firmware Modifications, Fixes, and AS923 Compliance
The STM32Cube Expansion LRWAN source code distribution, en.i-cube_lrwan.zip version 1.2.1 provided by STMicroelectronics, has a couple of unfixed problems. Spark can provide fixes for several of these issues, until a new release of the STM32Cube Expansion LRWAN becomes available. The source code and a description of these issues can be found on the associated downloads page. More information on setting up a compiler toolchain for building firmware images can be found on the Developer Resources page.
Note on AS923 Compliance
The full source code is available for the both the SX1276 driver, and for the LoRaWAN MAC (LoRaMac Github repository) and its API, whereas other manufacturers may provide just a binary file for this functionality. Full availability of the source code allows the behaviour of the MAC & LoRa transceiver to be modified, and potentially resulting in non-AS923 behaviour for an end-device. Therefore, any (non-approved) modifications to the source code of the MAC and/or the SX1276 driver will require that any devices using this modified firmware to be re-certified for AS923 compliance.