Skip to content

Commit ec04b6b

Browse files
author
smtc-bot
committed
Release v1.1.0
1 parent 45c6cdf commit ec04b6b

37 files changed

+712
-463
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [v1.1.0] - 2025-10-15
8+
9+
### Added
10+
11+
- The toolchain supports building with compile-time parameters given on command-line
12+
713
## [v1.0.0] - 2024-09-19
814

915
First release

Inc/apps/apps_utilities.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ extern "C" {
7878
*/
7979
void print_hex_buffer( const uint8_t* buffer, uint8_t size );
8080

81+
/**
82+
* @brief Prints the provided buffer as ASCII characters
83+
*
84+
* @param [in] buffer Buffer to be printed
85+
* @param [in] size Buffer size to be printed
86+
*/
87+
void print_ascii_buffer( const uint8_t* buffer, uint16_t size );
88+
8189
/**
8290
* @brief Prints the LoRaWAN keys
8391
*
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/**
2+
* @file common_app_configuration.h
3+
*
4+
* @brief App configuration common to all apps
5+
*
6+
* The Clear BSD License
7+
* Copyright Semtech Corporation 2024. All rights reserved.
8+
*
9+
* Redistribution and use in source and binary forms, with or without
10+
* modification, are permitted (subject to the limitations in the disclaimer
11+
* below) provided that the following conditions are met:
12+
* * Redistributions of source code must retain the above copyright
13+
* notice, this list of conditions and the following disclaimer.
14+
* * Redistributions in binary form must reproduce the above copyright
15+
* notice, this list of conditions and the following disclaimer in the
16+
* documentation and/or other materials provided with the distribution.
17+
* * Neither the name of the Semtech corporation nor the
18+
* names of its contributors may be used to endorse or promote products
19+
* derived from this software without specific prior written permission.
20+
*
21+
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
22+
* THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23+
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
24+
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25+
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE
26+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
* POSSIBILITY OF SUCH DAMAGE.
33+
*/
34+
35+
#ifndef COMMON_APP_CONFIGURATION_H
36+
#define COMMON_APP_CONFIGURATION_H
37+
38+
#ifdef __cplusplus
39+
extern "C" {
40+
#endif
41+
42+
/*
43+
* -----------------------------------------------------------------------------
44+
* --- DEPENDENCIES ------------------------------------------------------------
45+
*/
46+
47+
/*
48+
* -----------------------------------------------------------------------------
49+
* --- PUBLIC MACROS -----------------------------------------------------------
50+
*/
51+
52+
/**
53+
* @brief Watchdog counter reload value during sleep (The period must be lower than MCU watchdog period (here 20s))
54+
*/
55+
#ifndef WATCHDOG_RELOAD_PERIOD_MS
56+
#define WATCHDOG_RELOAD_PERIOD_MS 20000
57+
#endif // WATCHDOG_RELOAD_PERIOD_MS
58+
59+
/*!
60+
* @brief User application data buffer size
61+
*/
62+
#ifndef LORAWAN_APP_DATA_MAX_SIZE
63+
#define LORAWAN_APP_DATA_MAX_SIZE 242
64+
#endif // LORAWAN_APP_DATA_MAX_SIZE
65+
66+
/*!
67+
* @brief LoRaWAN regulatory region.
68+
* One of:
69+
* LR1121_LORAWAN_REGION_AS923_GRP1
70+
* LR1121_LORAWAN_REGION_AS923_GRP2
71+
* LR1121_LORAWAN_REGION_AS923_GRP3
72+
* LR1121_LORAWAN_REGION_AS923_GRP4
73+
* LR1121_LORAWAN_REGION_AU915
74+
* LR1121_LORAWAN_REGION_CN470
75+
* LR1121_LORAWAN_REGION_EU868
76+
* LR1121_LORAWAN_REGION_IN865
77+
* LR1121_LORAWAN_REGION_KR920
78+
* LR1121_LORAWAN_REGION_RU864
79+
* LR1121_LORAWAN_REGION_US915
80+
*/
81+
#ifndef LORAWAN_REGION_USED
82+
#define LORAWAN_REGION_USED LR1121_LORAWAN_REGION_EU868
83+
#endif // LORAWAN_REGION_USED
84+
85+
/**
86+
* @brief Periodical uplink alarm delay in seconds
87+
*/
88+
#ifndef PERIODICAL_UPLINK_DELAY_S
89+
#define PERIODICAL_UPLINK_DELAY_S 30
90+
#endif // PERIODICAL_UPLINK_DELAY_S
91+
92+
93+
94+
95+
/*
96+
* -----------------------------------------------------------------------------
97+
* --- PUBLIC CONSTANTS --------------------------------------------------------
98+
*/
99+
100+
/*
101+
* -----------------------------------------------------------------------------
102+
* --- PUBLIC TYPES ------------------------------------------------------------
103+
*/
104+
105+
/*
106+
* -----------------------------------------------------------------------------
107+
* --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
108+
*/
109+
110+
#ifdef __cplusplus
111+
}
112+
#endif
113+
114+
#endif // COMMON_APP_CONFIGURATION_H
115+
116+
/* --- EOF ------------------------------------------------------------------ */

Inc/apps/lorawan_commissioning/lorawan_commissioning.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ extern "C" {
5858
* @brief Use internal credential
5959
* @remark By setting true the credentials defined in this document will not be used
6060
*/
61+
#ifndef USE_LR11XX_CREDENTIALS
6162
#define USE_LR11XX_CREDENTIALS false
63+
#endif // USE_LR11XX_CREDENTIALS
6264

6365
/**
6466
* @brief IEEE Organizationally Unique Identifier ( OUI ) (big endian)
@@ -72,37 +74,46 @@ extern "C" {
7274
* @remark In this application the value is automatically generated by calling
7375
* lr1110_modem_get_dev_eui function
7476
*/
77+
78+
#ifndef LORAWAN_DEVICE_EUI
7579
#define LORAWAN_DEVICE_EUI \
7680
{ \
7781
IEEE_OUI, 0x00, 0x00, 0x00, 0x00, 0x12 \
7882
}
83+
#endif // LORAWAN_DEVICE_EUI
7984
#define LORAWAN_DEVICE_EUI_LEN 8
8085

8186
/**
8287
* @brief App/Join server IEEE EUI (big endian)
8388
*/
89+
#ifndef LORAWAN_JOIN_EUI
8490
#define LORAWAN_JOIN_EUI \
8591
{ \
8692
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34 \
8793
}
94+
#endif // LORAWAN_JOIN_EUI
8895
#define LORAWAN_JOIN_EUI_LEN 8
8996

9097
/**
9198
* @brief loRaWAN Network Key (big endian)
9299
*/
100+
#ifndef LORAWAN_NWK_KEY
93101
#define LORAWAN_NWK_KEY \
94102
{ \
95103
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56 \
96104
}
105+
#endif // LORAWAN_NWK_KEY
97106
#define LORAWAN_NWK_KEY_LEN 16
98107

99108
/**
100109
* @brief loRaWAN Application Key (big endian)
101110
*/
111+
#ifndef LORAWAN_APP_KEY
102112
#define LORAWAN_APP_KEY \
103113
{ \
104114
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78 \
105115
}
116+
#endif // LORAWAN_APP_KEY
106117
#define LORAWAN_APP_KEY_LEN 16
107118

108119
/*

Inc/boards/board-config.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ extern "C" {
4444
* --- DEPENDENCIES ------------------------------------------------------------
4545
*/
4646

47+
#include "lr1121_modem_system_types.h"
48+
4749
/*
4850
* -----------------------------------------------------------------------------
4951
* --- PUBLIC MACROS -----------------------------------------------------------
@@ -54,10 +56,44 @@ extern "C" {
5456
* --- PUBLIC CONSTANTS --------------------------------------------------------
5557
*/
5658

59+
/*
60+
* -----------------------------------------------------------------------------
61+
* --- TCXO CONFIGURATION ------------------------------------------------------
62+
*/
63+
64+
/**
65+
* @brief Indicates whether the board includes a TCXO (Temperature Compensated Crystal Oscillator).
66+
*
67+
* Define this macro to 1 if the board has a TCXO connected and requires IO initialization.
68+
* Defaults to 0 (no TCXO) if not defined elsewhere.
69+
*/
70+
#ifndef TCXO_ON_BOARD
71+
#define TCXO_ON_BOARD 0
72+
#endif
73+
74+
/**
75+
* @brief Defines the supply voltage for the TCXO.
76+
*
77+
* Available values:
78+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_1_6V (0x00) - Supply voltage = 1.6V
79+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_1_7V (0x01) - Supply voltage = 1.7V
80+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_1_8V (0x02) - Supply voltage = 1.8V
81+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_2_2V (0x03) - Supply voltage = 2.2V
82+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_2_4V (0x04) - Supply voltage = 2.4V
83+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_2_7V (0x05) - Supply voltage = 2.7V
84+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_3_0V (0x06) - Supply voltage = 3.0V
85+
* - LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V (0x07) - Supply voltage = 3.3V
86+
*/
87+
#ifndef BOARD_TCXO_SUPPLY_VOLTAGE
88+
#define BOARD_TCXO_SUPPLY_VOLTAGE LR1121_MODEM_SYSTEM_TCXO_CTRL_1_8V
89+
#endif
90+
5791
/**
5892
* @brief Defines the time required for the TCXO to wakeup [ms].
5993
*/
60-
#define BOARD_TCXO_WAKEUP_TIME 5
94+
#ifndef BOARD_TCXO_WAKEUP_TIME
95+
#define BOARD_TCXO_WAKEUP_TIME 8
96+
#endif
6197

6298
/**
6399
* @brief Board MCU pins definitions

README.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## 1. Description
44

5-
The LR1121 modem application example project contains several simple examples highlighting LoRa Basic Modem-E features.
5+
The LR1121 modem application example project contains several simple examples highlighting LoRa Basic Modem-E features.
6+
This version of the examples supports LoRa Basics™ Modem-E **v2.0.2**.
7+
68

79
### 1.1. Simple LoRaWAN Class A application
810

@@ -41,18 +43,48 @@ The example applications are designed to run with the LR1121 Evaluation Kit hard
4143
* NUCLEO-L476RG development board
4244
* LR1121 shield
4345

46+
This project supports both versions of the LR1121 shield **with TCXO or without TCXO**
47+
48+
### 2.1. TCXO Configuration
49+
50+
To enable support for TCXO-based shields, you must modify the TCXO configuration macros in the [board-config.h](Inc/boards/board-config.h) file:
51+
52+
**Basic TCXO Enable/Disable:**
53+
- Set `TCXO_ON_BOARD` to `1` if your shield includes a TCXO, or leave it as `0` (default) for non-TCXO boards.
54+
55+
**Advanced TCXO Parameters (configurable when `TCXO_ON_BOARD = 1`):**
56+
- `BOARD_TCXO_SUPPLY_VOLTAGE`: Configure the TCXO supply voltage. Available options:
57+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_1_6V` (1.6V)
58+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_1_7V` (1.7V)
59+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_1_8V` (1.8V) - **Default**
60+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_2_2V` (2.2V)
61+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_2_4V` (2.4V)
62+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_2_7V` (2.7V)
63+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_3_0V` (3.0V)
64+
- `LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V` (3.3V)
65+
66+
- `BOARD_TCXO_WAKEUP_TIME`: Configure the TCXO wakeup time in milliseconds (default: 8ms)
67+
68+
**Example configuration for a 3.3V TCXO with 10ms wakeup time:**
69+
```c
70+
#define TCXO_ON_BOARD 1
71+
#define BOARD_TCXO_SUPPLY_VOLTAGE LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V
72+
#define BOARD_TCXO_WAKEUP_TIME 10
73+
```
74+
4475
## 3. Usage
4576
4677
Connect 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.
4778
4879
Use a terminal application configured with the following settings:
80+
4981
- Speed: 921600 baud
5082
- Data bits: 8s
5183
- Stop bits: 1
5284
- Parity: None
5385
5486
Applications use the serial link to display information messages.
55-
Modem keys are defined in [lorawan_comissioning.h](Inc/apps/lorawan_commissioning/lorawan_commissioning.h).
87+
Modem keys are defined in [lorawan_commissioning.h](Inc/apps/lorawan_commissioning/lorawan_commissioning.h).
5688
To use the LR1121 modem production keys, update the USE_LR11XX_CREDENTIALS definition
5789
5890
## 4. Build & Install
@@ -61,13 +93,49 @@ To build the example application for the STM32L476RG controller of the NUCLEO de
6193
6294
To build the example applications with the GNU Arm Embedded Toolchain:
6395
64-
6596
1. Run `make` from the `gcc` directory with the target application name as an argument:
6697
6798
```
6899
$ make APP=lorawan
69100
```
70101

102+
It is possible to provide additional compile-time definition through usage of `EXTRAFLAGS` make argument as follows:
103+
104+
```
105+
$ make APP=lorawan EXTRAFLAGS='-D<TOKEN>=<VALUE>'
106+
```
107+
108+
Where `<TOKEN>` is a macro name to configure with `<VALUE>`, for instance:
109+
110+
```bash
111+
$ make APP=lorawan EXTRAFLAGS='-DLORAWAN_REGION_USED=LR1121_LORAWAN_REGION_EU868'
112+
```
113+
114+
**Example: Building with TCXO configuration:**
115+
```bash
116+
$ make APP=lorawan EXTRAFLAGS='-DTCXO_ON_BOARD=1 -DBOARD_TCXO_SUPPLY_VOLTAGE=LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V -DBOARD_TCXO_WAKEUP_TIME=10'
117+
```
118+
119+
Here is the list of configurable tokens:
120+
121+
**Application Configuration:**
122+
* `WATCHDOG_RELOAD_PERIOD_MS`
123+
* `LORAWAN_APP_DATA_MAX_SIZE`
124+
* `LORAWAN_REGION_USED`
125+
* `PERIODICAL_UPLINK_DELAY_S`
126+
127+
**LoRaWAN Credentials:**
128+
* `USE_LR11XX_CREDENTIALS`
129+
* `LORAWAN_DEVICE_EUI`
130+
* `LORAWAN_JOIN_EUI`
131+
* `LORAWAN_NWK_KEY`
132+
* `LORAWAN_APP_KEY`
133+
134+
**TCXO Configuration:**
135+
* `TCXO_ON_BOARD` (set to 1 to enable TCXO support)
136+
* `BOARD_TCXO_SUPPLY_VOLTAGE` (e.g., `LR1121_MODEM_SYSTEM_TCXO_CTRL_3_3V`)
137+
* `BOARD_TCXO_WAKEUP_TIME` (wakeup time in milliseconds)
138+
71139
Note: The supported application names are `lorawan`, `certification`, `class_b`, `multicast` and `fuota`.
72140

73141
2. The application binary file, for example `lorawan.bin`, is created in the `gcc/build` directory.

0 commit comments

Comments
 (0)