The LR1121 modem application example project contains several simple examples highlighting LoRa Basic Modem-E features.
This version of the examples supports LoRa Basics™ Modem-E v2.0.2.
This application automatically joins the LoRa Network server and then sends uplinks periodically with the interval defined by PERIODICAL_UPLINK_DELAY_S.
Please read the lorawan application documentation for more details.
This application switches the modem to certification mode once the NUCLEO blue button is pressed.
Please read the certification application documentation for more details.
This application switches the modem between class A and class B configurations once the NUCLEO blue button is pressed.
Please read the class b application documentation for more details.
This application allows you to configure and launch one or more multicast sessions in Class B or Class C.
Please read the multicast application documentation for more details.
This example of Firmware Upgrade Over the Air (FUOTA) demonstrates how to run pre-certification suite with LoRaWAN Certification Test Tool (LCTT) for FUOTA
Please read the fuota application documentation for more details.
The example applications are designed to run with the LR1121 Evaluation Kit hardware, which includes:
- NUCLEO-L476RG development board
- LR1121 shield
This project supports both versions of the LR1121 shield with TCXO or without TCXO
To enable support for TCXO-based shields, you must modify the TCXO configuration macros in the board-config.h file:
Basic TCXO Enable/Disable:
- Set
TCXO_ON_BOARDto1if your shield includes a TCXO, or leave it as0(default) for non-TCXO boards.
Advanced TCXO Parameters (configurable when TCXO_ON_BOARD = 1):
-
BOARD_TCXO_SUPPLY_VOLTAGE: Configure the TCXO supply voltage. Available options:LR1121_MODEM_SYSTEM_TCXO_CTRL_1_6V(1.6V)LR1121_MODEM_SYSTEM_TCXO_CTRL_1_7V(1.7V)LR1121_MODEM_SYSTEM_TCXO_CTRL_1_8V(1.8V) - DefaultLR1121_MODEM_SYSTEM_TCXO_CTRL_2_2V(2.2V)LR1121_MODEM_SYSTEM_TCXO_CTRL_2_4V(2.4V)LR1121_MODEM_SYSTEM_TCXO_CTRL_2_7V(2.7V)LR1121_MODEM_SYSTEM_TCXO_CTRL_3_0V(3.0V)LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V(3.3V)
-
BOARD_TCXO_WAKEUP_TIME: Configure the TCXO wakeup time in milliseconds (default: 8ms)
Example configuration for a 3.3V TCXO with 10ms wakeup time:
#define TCXO_ON_BOARD 1
#define BOARD_TCXO_SUPPLY_VOLTAGE LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V
#define BOARD_TCXO_WAKEUP_TIME 10Connect the NUCLEO board to a host PC via a USB cable. The USB connection will provide power for the LR1121 Evaluation Kit as well as serve as a serial communication link for the example application.
Use a terminal application configured with the following settings:
- Speed: 921600 baud
- Data bits: 8s
- Stop bits: 1
- Parity: None
Applications use the serial link to display information messages.
Modem keys are defined in lorawan_commissioning.h.
To use the LR1121 modem production keys, update the USE_LR11XX_CREDENTIALS definition
To build the example application for the STM32L476RG controller of the NUCLEO development board, the ARM GCC tool chain must be set up under your development environment. These examples were developed using GNU Arm Embedded Toolchain 10-2020-q4-major 10.2.1 20201103 (release)
To build the example applications with the GNU Arm Embedded Toolchain:
- Run
makefrom thegccdirectory with the target application name as an argument:
$ make APP=lorawan
It is possible to provide additional compile-time definition through usage of EXTRAFLAGS make argument as follows:
$ make APP=lorawan EXTRAFLAGS='-D<TOKEN>=<VALUE>'
Where <TOKEN> is a macro name to configure with <VALUE>, for instance:
$ make APP=lorawan EXTRAFLAGS='-DLORAWAN_REGION_USED=LR1121_LORAWAN_REGION_EU868'Example: Building with TCXO configuration:
$ make APP=lorawan EXTRAFLAGS='-DTCXO_ON_BOARD=1 -DBOARD_TCXO_SUPPLY_VOLTAGE=LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V -DBOARD_TCXO_WAKEUP_TIME=10'Here is the list of configurable tokens:
Application Configuration:
WATCHDOG_RELOAD_PERIOD_MSLORAWAN_APP_DATA_MAX_SIZELORAWAN_REGION_USEDPERIODICAL_UPLINK_DELAY_S
LoRaWAN Credentials:
USE_LR11XX_CREDENTIALSLORAWAN_DEVICE_EUILORAWAN_JOIN_EUILORAWAN_NWK_KEYLORAWAN_APP_KEY
TCXO Configuration:
TCXO_ON_BOARD(set to 1 to enable TCXO support)BOARD_TCXO_SUPPLY_VOLTAGE(e.g.,LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V)BOARD_TCXO_WAKEUP_TIME(wakeup time in milliseconds)
Note: The supported application names are lorawan, certification, class_b, multicast and fuota.
- The application binary file, for example
lorawan.bin, is created in thegcc/builddirectory. - Copy the binary file to the STM32 microcontroller, either using the host OS copy facility or a dedicated tool like the STM32 ST-Link utility.