Skip to content

Commit d3eb88a

Browse files
committed
Release v2.0.1
1 parent 760bf87 commit d3eb88a

File tree

134 files changed

+1606477
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1606477
-225
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.0] - UNRELEASED
9+
10+
### Added
11+
12+
- `LR11XX_SYSTEM_IRQ_LORA_RX_TIMESTAMP` management in `apps_common_lr11xx_irq_process`
13+
14+
### Changed
15+
16+
- Updated LR11xx driver to v2.3.0
17+
- Macro `LR11XX_DISABLE_HIGH_ACP_WORKAROUND` is now defined to disable the corresponding workaround
18+
- Add `Sigfox` example with LR11xx
19+
- Default `TX_OUTPUT_POWER_DBM` default value for LR11xx examples to `13 dBm`
20+
21+
### Removed
22+
23+
- LR11xx geolocation-related examples (GNSS and Wi-Fi scan)
24+
25+
### Added
26+
27+
- SX126x support
28+
- LR1121 support
29+
- SMTC HAL MCU - simplified MCU hardware abstration layer to ease porting on another platform
30+
- Shield interface - library to get specificities related to each LR11xx / SX126x shield
31+
832
## [2.0.0] - 2023-03-06
933

1034
### Added

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ The output files of the build process are stored in the `build` folder with firm
5353

5454
Here are the parameters available at compile time:
5555

56-
| Parameter | Description | Default value |
57-
| ------------ | ---------------------------------------- | ------------- |
58-
| TARGET_BOARD | Board for which the example is compiled | NUCLEO_L476RG |
59-
| RADIO_SHIELD | Shield for which the example is compiled | **lr11xx**: LR1120MB1DIS, **sx126x**: SX1262MB1CAS |
56+
| Parameter | Description | Default value |
57+
| ------------ | ---------------------------------------- | -------------------------------------------------- |
58+
| TARGET_BOARD | Board for which the example is compiled | NUCLEO_L476RG |
59+
| RADIO_SHIELD | Shield for which the example is compiled | **lr11xx**: LR1120MB1DIS, **sx126x**: SX1262MB1CAS |
6060

6161
For instance, to build the project `per` with LR1110MB1GJS shield simply run make as follows
6262

common/inc/common_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050
* --- PUBLIC MACROS -----------------------------------------------------------
5151
*/
5252

53-
#define COMMON_SDK_VERSION "v2.0.0"
53+
#define COMMON_SDK_VERSION "2.0.1-4-gc964966"
5454

5555
/*
5656
* -----------------------------------------------------------------------------
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/**
2+
* \file
3+
*
4+
* \brief Generic DBPSK support library implementation
5+
*/
6+
7+
/**
8+
* \file
9+
*
10+
* The Clear BSD License
11+
* Copyright Semtech Corporation 2022. All rights reserved.
12+
*
13+
* Redistribution and use in source and binary forms, with or without
14+
* modification, are permitted (subject to the limitations in the disclaimer
15+
* below) provided that the following conditions are met:
16+
* * Redistributions of source code must retain the above copyright
17+
* notice, this list of conditions and the following disclaimer.
18+
* * Redistributions in binary form must reproduce the above copyright
19+
* notice, this list of conditions and the following disclaimer in the
20+
* documentation and/or other materials provided with the distribution.
21+
* * Neither the name of the Semtech corporation nor the
22+
* names of its contributors may be used to endorse or promote products
23+
* derived from this software without specific prior written permission.
24+
*
25+
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
26+
* THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
27+
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
28+
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
29+
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE
30+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36+
* POSSIBILITY OF SUCH DAMAGE.
37+
*/
38+
39+
/*
40+
* -----------------------------------------------------------------------------
41+
* --- DEPENDENCIES ------------------------------------------------------------
42+
*/
43+
44+
#include "smtc_dbpsk.h"
45+
46+
/*
47+
* -----------------------------------------------------------------------------
48+
* --- PUBLIC FUNCTION DEFINITIONS ---------------------------------------------
49+
*/
50+
51+
void smtc_dbpsk_encode_buffer( const uint8_t* data_in, int bpsk_pld_len_in_bits, uint8_t* data_out )
52+
{
53+
uint8_t in_byte;
54+
uint8_t out_byte;
55+
56+
int data_in_bytecount = bpsk_pld_len_in_bits >> 3;
57+
in_byte = *data_in++;
58+
59+
uint8_t current = 0;
60+
61+
// Process full bytes
62+
while( --data_in_bytecount >= 0 )
63+
{
64+
for( int i = 0; i < 8; ++i )
65+
{
66+
out_byte = ( out_byte << 1 ) | current;
67+
if( ( in_byte & 0x80 ) == 0 )
68+
{
69+
current = current ^ 0x01;
70+
}
71+
in_byte <<= 1;
72+
}
73+
in_byte = *data_in++;
74+
*data_out++ = out_byte;
75+
}
76+
77+
// Process remaining bits
78+
for( int i = 0; i < ( bpsk_pld_len_in_bits & 7 ); ++i )
79+
{
80+
out_byte = ( out_byte << 1 ) | current;
81+
if( ( in_byte & 0x80 ) == 0 )
82+
{
83+
current = current ^ 0x01;
84+
}
85+
in_byte <<= 1;
86+
}
87+
88+
// Process last data bit
89+
out_byte = ( out_byte << 1 ) | current;
90+
if( ( bpsk_pld_len_in_bits & 7 ) == 7 )
91+
{
92+
*data_out++ = out_byte;
93+
}
94+
95+
// Add duplicate bit and store
96+
out_byte = ( out_byte << 1 ) | current;
97+
*data_out = out_byte << ( 7 - ( ( bpsk_pld_len_in_bits + 1 ) & 7 ) );
98+
}
99+
100+
/* --- EOF ------------------------------------------------------------------ */
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/**
2+
* \file
3+
*
4+
* \brief Generic DBPSK support library header
5+
*/
6+
7+
/**
8+
* \file
9+
*
10+
* The Clear BSD License
11+
* Copyright Semtech Corporation 2022. All rights reserved.
12+
*
13+
* Redistribution and use in source and binary forms, with or without
14+
* modification, are permitted (subject to the limitations in the disclaimer
15+
* below) provided that the following conditions are met:
16+
* * Redistributions of source code must retain the above copyright
17+
* notice, this list of conditions and the following disclaimer.
18+
* * Redistributions in binary form must reproduce the above copyright
19+
* notice, this list of conditions and the following disclaimer in the
20+
* documentation and/or other materials provided with the distribution.
21+
* * Neither the name of the Semtech corporation nor the
22+
* names of its contributors may be used to endorse or promote products
23+
* derived from this software without specific prior written permission.
24+
*
25+
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
26+
* THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
27+
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
28+
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
29+
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE
30+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36+
* POSSIBILITY OF SUCH DAMAGE.
37+
*/
38+
39+
#ifndef SMTC_DBPSK_H
40+
#define SMTC_DBPSK_H
41+
42+
/*
43+
* -----------------------------------------------------------------------------
44+
* --- DEPENDENCIES ------------------------------------------------------------
45+
*/
46+
47+
#include <stdint.h>
48+
49+
#ifdef __cplusplus
50+
extern "C" {
51+
#endif
52+
53+
/*
54+
* -----------------------------------------------------------------------------
55+
* --- PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
56+
*/
57+
58+
/*!
59+
* \brief Perform differential encoding for DBPSK modulation.
60+
*
61+
* \param [in] data_in Buffer with input data
62+
* \param [in] bpsk_pld_len_in_bits Length of the input BPSK frame, in bits
63+
* \param [out] data_out Buffer for output data (can optionally be the same as data_in, but must have space
64+
* for bpsk_pld_len_in_bits + 2 bits)
65+
*/
66+
void smtc_dbpsk_encode_buffer( const uint8_t* data_in, int bpsk_pld_len_in_bits, uint8_t* data_out );
67+
68+
/*!
69+
* \brief Given the length of a BPSK frame, in bits, calculate the space necessary to hold the frame after differential
70+
* encoding, in bits.
71+
*
72+
* \param [in] bpsk_pld_len_in_bits Length of a BPSK frame, in bits
73+
* \returns Space required for DBPSK frame, after addition of start/stop bits [bits]
74+
*/
75+
static inline int smtc_dbpsk_get_pld_len_in_bits( int bpsk_pld_len_in_bits )
76+
{
77+
// Hold the last bit one extra bit-time
78+
return bpsk_pld_len_in_bits + 2;
79+
}
80+
81+
/*!
82+
* \brief Given the length of a BPSK frame, in bits, calculate the space necessary to hold the frame after differential
83+
* encoding, in bytes.
84+
*
85+
* \param [in] bpsk_pld_len_in_bits Length of a BPSK frame, in bits
86+
* \returns Space required for DBPSK frame, after addition of start/stop bits [bytes]
87+
*/
88+
static inline int smtc_dbpsk_get_pld_len_in_bytes( int bpsk_pld_len_in_bits )
89+
{
90+
return ( smtc_dbpsk_get_pld_len_in_bits( bpsk_pld_len_in_bits ) + 7 ) >> 3;
91+
}
92+
93+
#ifdef __cplusplus
94+
}
95+
#endif
96+
97+
#endif // SMTC_DBPSK_H
98+
99+
/* --- EOF ------------------------------------------------------------------ */

lr11xx/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# LR11xx SDK
2+
3+
The LR11xx SDK contains several simple examples for LR11xx transceivers.
4+
5+
## Examples
6+
7+
| Name | Description | Documentation |
8+
| -------------------- | --------------------------------------------------------------- | --------------------------------------------- |
9+
| CAD | Perform a Channel Activity Detection (CAD) - LoRa only | [README](apps/cad/README.md) |
10+
| PER | Perform a Packet Error Rate (PER) test - both Tx and Rx roles | [README](apps/per/README.md) |
11+
| Ping pong | Launch an exchange between two devices | [README](apps/ping_pong/README.md) |
12+
| Sprectral scan | Get inst-RSSI values in RX mode to form a heat map | [README](apps/spectral_scan/README.md) |
13+
| Spectrum display | Get inst-RSSI values in RX mode to form a dyamic spectrum curve | [README](apps/spectrum_display/README.md) |
14+
| Tx continuous wave | Configure the chip to transmit a single tone | [README](apps/tx_cw/README.md) |
15+
| Tx infinite preamble | Configure the chip to transmit an infinite preamble | [README](apps/tx_infinite_preamble/README.md) |
16+
17+
A demonstration of the LR-FHSS capability of the chip can be found [here](https://github.com/Lora-net/SWDM001).
18+
19+
## Configuration
20+
21+
Each example has its own set of parameters - see `lr11xx/apps/<example>/main_<example>.h`.
22+
23+
There is also [a common configuration file](common/apps_configuration.h) where parameters can be set, among which:
24+
25+
* Packet type
26+
* RF frequency
27+
* Output power
28+
* Packet and modulation parameters for different modulations
29+
30+
## Requirements
31+
32+
### Supported boards
33+
34+
This SDK is developed on the ST Microeletronic [NUCLEO-L476RG development board](https://www.st.com/en/evaluation-tools/nucleo-l476rg.html)
35+
36+
### Supported shields
37+
38+
The list of compatible Semtech LR1110 shields is:
39+
40+
| Shield | PCB | Frequency matching | Characteristics |
41+
| ------------ | -------- | ------------------ | -------------------------------------- |
42+
| LR1110MB1DIS | E516V02B | 868/915 MHz | GNSS with LNA for Passive GNSS Antenna |
43+
| LR1110MB1DJS | E592V01B | 868/915 MHz | GNSS without LNA |
44+
| LR1110MB1GIS | E516V02B | 490 MHz | GNSS with LNA for Passive GNSS Antenna |
45+
| LR1110MB1GJS | E592V01B | 490 MHz | GNSS without LNA |
46+
47+
The list of compatible Semtech LR1120 shields is:
48+
49+
| Shield | PCB | Frequency matching | Characteristics |
50+
| ------------ | -------- | ------------------ | -------------------------------------- |
51+
| LR1120MB1DIS | E655V01A | 868/915 MHz | GNSS with LNA for Passive GNSS Antenna |
52+
| LR1120MB1DJS | E656V01A | 868/915 MHz | GNSS without LNA |
53+
| LR1120MB1GIS | E655V01A | 490 MHz | GNSS with LNA for Passive GNSS Antenna |
54+
| LR1120MB1GJS | E656V01A | 490 MHz | GNSS without LNA |
55+
56+
The list of compatible Semtech LR1121 shields is:
57+
58+
| Shield | PCB | Frequency matching | Characteristics |
59+
| ------------ | -------- | ------------------ | --------------- |
60+
| LR1121MB1DIS | E655V01A | 868/915 MHz | N/A |
61+
| LR1121MB1GIS | E655V01A | 490 MHz | N/A |
62+
63+
### Firmware
64+
65+
This SDK requires the transceiver to run the following version
66+
67+
* LR1110: firmware version ([0x0307](https://github.com/Lora-net/radio_firmware_images/tree/master/lr1110/transceiver))
68+
* LR1120: firmware version ([0x0101](https://github.com/Lora-net/radio_firmware_images/tree/master/lr1120/transceiver))
69+
* LR1121: firmware version ([0x0101](https://github.com/Lora-net/radio_firmware_images/tree/master/lr1121/transceiver))
70+
71+
To update the transceiver with the desired firmware version, please use [the updater tool application](https://github.com/Lora-net/SWTL001).
72+
73+
### Workaround
74+
75+
#### High ACP (Adjacent Channel Power)
76+
77+
This issue has beed fixed in firmware LR1110 0x0308 and LR1120 0x0102 - it was not present in LR1121 0x0101. The associated workaround is disabled in this project starting from v2.1.0.
78+
79+
If one wants to re-enable the workaround, this [line](common/apps_common.mk#L33) has to be commented.

lr11xx/apps/cad/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
The chip performs the CAD operation in LoRa. Define macro `PACKET_TYPE` to `LR1110_RADIO_PKT_TYPE_LORA` (in file [`../../common/apps_configuration.h`](../../common/apps_configuration.h)) to use this sample code.
66

7-
In CAD test, there are 3 kinds of exit mode that can be defined for different use cases. For `CAD_ONLY` mode, once done and whatever the activity on the channel, the chip goes back to STBY_RC mode. For `CAD_RX` mode, if an activity is detected, it stays in RX until a packet is detected or the timer reaches the timeout defined by `CAD_TIMOUT_MS`. For `CAD_LBT` mode, if no activity is detected, it goes to tx mode. This mode is actually a substitue of tx mode, so payload data for transmitting should be preloaded before setting the chip to `CAD_LBT` mode.
7+
In CAD test, there are 3 kinds of exit mode that can be defined for different use cases. For `CAD_ONLY` mode, once done and whatever the activity on the channel, the chip goes back to STBY_RC mode. For `CAD_RX` mode, if an activity is detected, it stays in RX until a packet is detected or the timer reaches the timeout defined by `CAD_TIMEOUT_MS`. For `CAD_LBT` mode, if no activity is detected, it goes to tx mode. This mode is actually a substitue of tx mode, so payload data for transmitting should be preloaded before setting the chip to `CAD_LBT` mode.
88

99
## Configuration
1010

@@ -18,4 +18,4 @@ Several parameters can be updated in [`main_cad.h`](main_cad.h) header file:
1818
| `CAD_DETECT_PEAK` | Define the sensitivity of the LoRa modem when trying to correlate to symbols |
1919
| `CAD_DETECT_MIN` | Minimum peak value, meant to filter out case with almost no signal or noise. |
2020
| `CAD_EXIT_MODE` | Defines the action to be performed after a CAD operation |
21-
| `CAD_TIMOUT_MS` | Only used when the CAD is performed with CAD_EXIT_MODE = CAD_RX or CAD_LBT |
21+
| `CAD_TIMEOUT_MS` | Only used when the CAD is performed with CAD_EXIT_MODE = CAD_RX or CAD_LBT |

lr11xx/apps/sigfox/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# LR11XX Sigfox PHY sample code
2+
3+
## Description
4+
5+
This sample code illustrates the sending of Sigfox-compliant uplinks.
6+
7+
### Payload setting
8+
9+
There is currently one pre-defined physical payload (corresponding to "0x01" application payload).
10+
11+
To send another payload, one can update `sample0` array and `SIGFOX_PAYLOAD_LENGTH` macro in [`main_sigfox.c`](main_sigfox.c).
12+
13+
## Configuration
14+
15+
Several parameters can be updated in [`../../common/apps_configuration.h`](../../common/apps_configuration.h) header file, refer to [`../../common/README.md`](../../common/README.md) for more details.
16+
17+
Several parameters can be updated in [`main_sigfox.h`](main_sigfox.h) header file:
18+
19+
| Constant | Comments |
20+
| ---------------------- | ----------------------------------------- |
21+
| `TX_TO_TX_DELAY_IN_MS` | Time delay between 2 transmitting packets |

0 commit comments

Comments
 (0)