Skip to content

Commit 5cf9794

Browse files
author
smtc-bot
committed
Release v2.3.0
1 parent 0003d57 commit 5cf9794

14 files changed

+150
-132
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ 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+
9+
## [v2.3.0] - 2024-09-13
10+
11+
### Changed
12+
13+
- Default LR11xx LoRa IQ configuration set to *standard* instead of *inverted*
14+
- Add frequency argument to RTTOF function `get_recommended_rx_tx_delay_indicator`
15+
16+
### Fixed
17+
18+
- RTToF example just runs once and then stops if it is compiled by Keil.
19+
820
## [v2.2.1] - 2024-07-24
921

1022
### Changed

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.2.1"
53+
#define COMMON_SDK_VERSION "v2.3.0"
5454

5555
/*
5656
* -----------------------------------------------------------------------------

libs/smtc-shields/lr11xx/inc/smtc_shield_lr11x0_common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ extern "C" {
7272
*/
7373
const smtc_shield_lr11xx_xosc_cfg_t* smtc_shield_lr11x0_common_get_xosc_cfg( void );
7474

75-
bool smtc_shield_lr11x0_common_rttof_recommended_rx_tx_delay_indicator( lr11xx_radio_lora_bw_t bw,
75+
bool smtc_shield_lr11x0_common_rttof_recommended_rx_tx_delay_indicator( uint32_t rf_freq_in_hz,
76+
lr11xx_radio_lora_bw_t bw,
7677
lr11xx_radio_lora_sf_t sf,
7778
uint32_t* delay_indicator );
7879

libs/smtc-shields/lr11xx/inc/smtc_shield_lr11x1_common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ extern "C" {
7272
*/
7373
const smtc_shield_lr11xx_xosc_cfg_t* smtc_shield_lr11x1_common_get_xosc_cfg( void );
7474

75-
bool smtc_shield_lr11x1_common_rttof_recommended_rx_tx_delay_indicator( lr11xx_radio_lora_bw_t bw,
75+
bool smtc_shield_lr11x1_common_rttof_recommended_rx_tx_delay_indicator( uint32_t rf_freq_in_hz,
76+
lr11xx_radio_lora_bw_t bw,
7677
lr11xx_radio_lora_sf_t sf,
7778
uint32_t* delay_indicator );
7879

libs/smtc-shields/lr11xx/inc/smtc_shield_lr11xx.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ typedef const smtc_shield_lr11xx_pinout_t* ( *smtc_shield_lr11xx_get_pinout_f )(
103103
/**
104104
* @brief Function pointer to abstract RTToF recommented Tx/Rx delay indicator getter
105105
*/
106-
typedef bool ( *smtc_shield_lr11xx_get_rttof_recommended_rx_tx_delay_indicator_f )( lr11xx_radio_lora_bw_t bw,
106+
typedef bool ( *smtc_shield_lr11xx_get_rttof_recommended_rx_tx_delay_indicator_f )( uint32_t rf_freq_in_hz,
107+
lr11xx_radio_lora_bw_t bw,
107108
lr11xx_radio_lora_sf_t sf,
108109
uint32_t* delay_indicator );
109110

@@ -219,6 +220,7 @@ static inline const smtc_shield_lr11xx_pinout_t* smtc_shield_lr11xx_get_pinout(
219220
* @brief Return the RTToF recommended Rx/Tx delay indicator
220221
*
221222
* @param [in] shield Pointer to a shield data structure
223+
* @param [in] rf_freq_in_hz Frequency to get the recommended delay indicator for
222224
* @param [in] bw Bandwidth to get the recommended delay indicator for
223225
* @param [in] sf Spreading factor to get the recommended delay indicator for
224226
* @param [out] delay_indicator Recommended delay indicator corresponding to sf/bw. Only valid if the call returned
@@ -228,11 +230,12 @@ static inline const smtc_shield_lr11xx_pinout_t* smtc_shield_lr11xx_get_pinout(
228230
* @retval false The RTToF recommanded Rx/Tx delay indicator has not been found and must not be used
229231
*/
230232
static inline bool smtc_shield_lr11xx_get_rttof_recommended_rx_tx_delay_indicator( const smtc_shield_lr11xx_t* shield,
231-
lr11xx_radio_lora_bw_t bw,
232-
lr11xx_radio_lora_sf_t sf,
233+
uint32_t rf_freq_in_hz,
234+
lr11xx_radio_lora_bw_t bw,
235+
lr11xx_radio_lora_sf_t sf,
233236
uint32_t* delay_indicator )
234237
{
235-
return shield->get_rttof_recommended_rx_tx_delay_indicator( bw, sf, delay_indicator );
238+
return shield->get_rttof_recommended_rx_tx_delay_indicator( rf_freq_in_hz, bw, sf, delay_indicator );
236239
}
237240

238241
#ifdef __cplusplus

libs/smtc-shields/lr11xx/src/smtc_shield_lr11x0_common.c

Lines changed: 84 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,36 @@
4848
* --- PRIVATE MACROS-----------------------------------------------------------
4949
*/
5050

51+
/*!
52+
* @brief Recommanded for frequency from 430MHz to 510MHz
53+
*/
54+
static const uint32_t rttof_delay_indicator_table_below_600mhz[3][8] = {
55+
/* SF5, SF6, SF7, SF8, SF9, SF10, SF11, SF12 */
56+
{ 19107, 19122, 19113, 19114, 19113, 19114, 19036, 19024 }, // BW125
57+
{ 20265, 20279, 20278, 20273, 20270, 20272, 20236, 20232 }, // BW250
58+
{ 20166, 20249, 20288, 20309, 20318, 20312, 20295, 20298 }, // BW500
59+
};
60+
61+
/*!
62+
* @brief Recommanded for frequency from 860MHz to 928MHz
63+
*/
64+
static const uint32_t rttof_delay_indicator_table_from_600mhz_to_2ghz[3][8] = {
65+
/* SF5, SF6, SF7, SF8, SF9, SF10, SF11, SF12 */
66+
{ 19115, 19113, 19121, 19127, 19141, 19178, 19036, 19024 }, // BW125
67+
{ 20265, 20266, 20279, 20292, 20236, 20305, 20236, 20232 }, // BW250
68+
{ 20154, 20268, 20298, 20319, 20323, 20314, 20295, 20298 }, // BW500
69+
};
70+
71+
/*!
72+
* @brief Recommanded for 2.4G frequency
73+
*/
74+
static const uint32_t rttof_delay_indicator_table_above_2ghz[3][8] = {
75+
/* SF5, SF6, SF7, SF8, SF9, SF10, SF11, SF12 */
76+
{ 19118, 19123, 19120, 19124, 19121, 19119, 19036, 19024 }, // BW125
77+
{ 20221, 20230, 20226, 20231, 20236, 20223, 20236, 20232 }, // BW250
78+
{ 20143, 20230, 20252, 20284, 20305, 20288, 20295, 20298 }, // BW500
79+
};
80+
5181
/*
5282
* -----------------------------------------------------------------------------
5383
* --- PRIVATE CONSTANTS -------------------------------------------------------
@@ -89,136 +119,75 @@ const smtc_shield_lr11xx_xosc_cfg_t* smtc_shield_lr11x0_common_get_xosc_cfg( voi
89119
return &smtc_shield_lr11x0_common_xosc_cfg;
90120
}
91121

92-
bool smtc_shield_lr11x0_common_rttof_recommended_rx_tx_delay_indicator( lr11xx_radio_lora_bw_t bw,
122+
bool smtc_shield_lr11x0_common_rttof_recommended_rx_tx_delay_indicator( uint32_t rf_freq_in_hz,
123+
lr11xx_radio_lora_bw_t bw,
93124
lr11xx_radio_lora_sf_t sf,
94125
uint32_t* delay_indicator )
95126
{
96-
bool found = true;
127+
uint8_t row_index;
128+
uint8_t column_index;
97129

98130
*delay_indicator = 0u;
99131

100-
if( bw == LR11XX_RADIO_LORA_BW_500 )
132+
switch( bw )
133+
{
134+
case LR11XX_RADIO_LORA_BW_125:
135+
row_index = 0;
136+
break;
137+
case LR11XX_RADIO_LORA_BW_250:
138+
row_index = 1;
139+
break;
140+
case LR11XX_RADIO_LORA_BW_500:
141+
row_index = 2;
142+
break;
143+
default:
144+
return false;
145+
}
146+
147+
switch( sf )
101148
{
102-
if( sf == LR11XX_RADIO_LORA_SF5 )
103-
{
104-
*delay_indicator = 20149u;
105-
}
106-
else if( sf == LR11XX_RADIO_LORA_SF6 )
107-
{
108-
*delay_indicator = 20227u;
109-
}
110-
else if( sf == LR11XX_RADIO_LORA_SF7 )
111-
{
112-
*delay_indicator = 20258u;
113-
}
114-
else if( sf == LR11XX_RADIO_LORA_SF8 )
115-
{
116-
*delay_indicator = 20277u;
117-
}
118-
else if( sf == LR11XX_RADIO_LORA_SF9 )
119-
{
120-
*delay_indicator = 20286u;
121-
}
122-
else if( sf == LR11XX_RADIO_LORA_SF10 )
123-
{
124-
*delay_indicator = 20292u;
125-
}
126-
else if( sf == LR11XX_RADIO_LORA_SF11 )
127-
{
128-
*delay_indicator = 20295u;
129-
}
130-
else if( sf == LR11XX_RADIO_LORA_SF12 )
131-
{
132-
*delay_indicator = 20298u;
133-
}
134-
else
135-
{
136-
found = false;
137-
}
149+
case LR11XX_RADIO_LORA_SF5:
150+
column_index = 0;
151+
break;
152+
case LR11XX_RADIO_LORA_SF6:
153+
column_index = 1;
154+
break;
155+
case LR11XX_RADIO_LORA_SF7:
156+
column_index = 2;
157+
break;
158+
case LR11XX_RADIO_LORA_SF8:
159+
column_index = 3;
160+
break;
161+
case LR11XX_RADIO_LORA_SF9:
162+
column_index = 4;
163+
break;
164+
case LR11XX_RADIO_LORA_SF10:
165+
column_index = 5;
166+
break;
167+
case LR11XX_RADIO_LORA_SF11:
168+
column_index = 6;
169+
break;
170+
case LR11XX_RADIO_LORA_SF12:
171+
column_index = 7;
172+
break;
173+
default:
174+
return false;
138175
}
139-
else if( bw == LR11XX_RADIO_LORA_BW_250 )
176+
177+
if( rf_freq_in_hz < 600000000 )
140178
{
141-
if( sf == LR11XX_RADIO_LORA_SF5 )
142-
{
143-
*delay_indicator = 20235u;
144-
}
145-
else if( sf == LR11XX_RADIO_LORA_SF6 )
146-
{
147-
*delay_indicator = 20239u;
148-
}
149-
else if( sf == LR11XX_RADIO_LORA_SF7 )
150-
{
151-
*delay_indicator = 20238u;
152-
}
153-
else if( sf == LR11XX_RADIO_LORA_SF8 )
154-
{
155-
*delay_indicator = 20237u;
156-
}
157-
else if( sf == LR11XX_RADIO_LORA_SF9 )
158-
{
159-
*delay_indicator = 20236u;
160-
}
161-
else if( sf == LR11XX_RADIO_LORA_SF10 )
162-
{
163-
*delay_indicator = 20235u;
164-
}
165-
else if( sf == LR11XX_RADIO_LORA_SF11 )
166-
{
167-
*delay_indicator = 20236u;
168-
}
169-
else if( sf == LR11XX_RADIO_LORA_SF12 )
170-
{
171-
*delay_indicator = 20232u;
172-
}
173-
else
174-
{
175-
found = false;
176-
}
179+
*delay_indicator = rttof_delay_indicator_table_below_600mhz[row_index][column_index];
177180
}
178-
else if( bw == LR11XX_RADIO_LORA_BW_125 )
181+
else if( ( 600000000 <= rf_freq_in_hz ) && ( rf_freq_in_hz < 2000000000 ) )
179182
{
180-
if( sf == LR11XX_RADIO_LORA_SF5 )
181-
{
182-
*delay_indicator = 19035u;
183-
}
184-
else if( sf == LR11XX_RADIO_LORA_SF6 )
185-
{
186-
*delay_indicator = 19040u;
187-
}
188-
else if( sf == LR11XX_RADIO_LORA_SF7 )
189-
{
190-
*delay_indicator = 19040u;
191-
}
192-
else if( sf == LR11XX_RADIO_LORA_SF8 )
193-
{
194-
*delay_indicator = 19039u;
195-
}
196-
else if( sf == LR11XX_RADIO_LORA_SF9 )
197-
{
198-
*delay_indicator = 19036u;
199-
}
200-
else if( sf == LR11XX_RADIO_LORA_SF10 )
201-
{
202-
*delay_indicator = 19038u;
203-
}
204-
else if( sf == LR11XX_RADIO_LORA_SF11 )
205-
{
206-
*delay_indicator = 19036u;
207-
}
208-
else if( sf == LR11XX_RADIO_LORA_SF12 )
209-
{
210-
*delay_indicator = 19024u;
211-
}
212-
else
213-
{
214-
found = false;
215-
}
183+
*delay_indicator = rttof_delay_indicator_table_from_600mhz_to_2ghz[row_index][column_index];
216184
}
217185
else
218186
{
219-
found = false;
187+
*delay_indicator = rttof_delay_indicator_table_above_2ghz[row_index][column_index];
220188
}
221-
return found;
189+
190+
return true;
222191
}
223192

224193
void smtc_shield_lr11x0_common_gnss_consumption_instantaneous_value(

libs/smtc-shields/lr11xx/src/smtc_shield_lr11x1_common.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ const smtc_shield_lr11xx_xosc_cfg_t* smtc_shield_lr11x1_common_get_xosc_cfg( voi
8989
return &smtc_shield_lr11x1_common_xosc_cfg;
9090
}
9191

92-
bool smtc_shield_lr11x1_common_rttof_recommended_rx_tx_delay_indicator( lr11xx_radio_lora_bw_t bw,
92+
bool smtc_shield_lr11x1_common_rttof_recommended_rx_tx_delay_indicator( uint32_t rf_freq_in_hz,
93+
lr11xx_radio_lora_bw_t bw,
9394
lr11xx_radio_lora_sf_t sf,
9495
uint32_t* delay_indicator )
9596
{

lr11xx/apps/per/main_per.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ int main( void )
172172
HAL_DBG_TRACE_PRINTF( "Valid reception amount: %d \n", nb_ok );
173173
HAL_DBG_TRACE_PRINTF( "Timeout reception amount: %d \n", nb_rx_timeout );
174174
HAL_DBG_TRACE_PRINTF( "CRC Error reception amount: %d \n", nb_rx_error );
175-
#if( PACKET_TYPE == LR11XX_RADIO_PKT_TYPE_GFSK )
176-
HAL_DBG_TRACE_PRINTF( "FSK Length Error reception amount: %d \n", nb_fsk_len_error );
177-
#endif
175+
if( PACKET_TYPE == LR11XX_RADIO_PKT_TYPE_GFSK )
176+
{
177+
HAL_DBG_TRACE_PRINTF( "FSK Length Error reception amount: %d \n", nb_fsk_len_error );
178+
}
178179

179180
while( 1 )
180181
{

lr11xx/apps/rttof/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,11 @@ Furthermore, the application defines the following parameters in the [`main_rtto
2424
| `RESPONSE_SYMBOLS_COUNT` | Number of symbols contained in the subordinate's RTToF response packet |
2525
| `MANAGER_TX_RX_TIMEOUT_MS` | Manager-side RTToF timeout (waiting for subordinate response) |
2626
| `MANAGER_RTTOF_SLEEP_PERIOD` | Manager-side sleep period between two RTToF executions |
27+
28+
## Notes
29+
30+
Some of the points that need attention as followings.
31+
32+
- Spreading factors from SF5 to SF10 are recommended values.
33+
- Bandwidth shall be chosen among `LR11XX_RADIO_LORA_BW_125`, `LR11XX_RADIO_LORA_BW_250` and `LR11XX_RADIO_LORA_BW_500` for both sub-GHz and 2.4G bands.
34+
- Please set the IQ value - `LORA_IQ`, as the standard mode - `LR11XX_RADIO_LORA_IQ_STANDARD`. Because all the calibration values are based on the standard mode. It might reduce the ranging accuracy if used the inverted mode.

lr11xx/common/apps_common.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ void apps_common_lr11xx_radio_rttof_init( const void* context )
566566
ASSERT_LR11XX_RC( lr11xx_radio_set_lora_sync_word( context, LORA_SYNCWORD ) );
567567

568568
uint32_t rttof_rx_tx_delay = 0u;
569-
if( smtc_shield_lr11xx_get_rttof_recommended_rx_tx_delay_indicator( &shield, lora_mod_params.bw, lora_mod_params.sf,
570-
&rttof_rx_tx_delay ) )
569+
if( smtc_shield_lr11xx_get_rttof_recommended_rx_tx_delay_indicator( &shield, RF_FREQ_IN_HZ, lora_mod_params.bw,
570+
lora_mod_params.sf, &rttof_rx_tx_delay ) )
571571
{
572572
ASSERT_LR11XX_RC( lr11xx_rttof_set_rx_tx_delay_indicator( context, rttof_rx_tx_delay ) );
573573
HAL_DBG_TRACE_INFO( "RTTof delay : %d\n", rttof_rx_tx_delay );
@@ -974,5 +974,25 @@ void on_gnss_scan_done( void )
974974
{
975975
HAL_DBG_TRACE_INFO( "No IRQ routine defined\n" );
976976
}
977+
void on_rttof_request_valid( void )
978+
{
979+
HAL_DBG_TRACE_INFO( "No IRQ routine defined\n" );
980+
}
981+
void on_rttof_request_discarded( void )
982+
{
983+
HAL_DBG_TRACE_INFO( "No IRQ routine defined\n" );
984+
}
985+
void on_rttof_response_done( void )
986+
{
987+
HAL_DBG_TRACE_INFO( "No IRQ routine defined\n" );
988+
}
989+
void on_rttof_exchange_valid( void )
990+
{
991+
HAL_DBG_TRACE_INFO( "No IRQ routine defined\n" );
992+
}
993+
void on_rttof_timeout( void )
994+
{
995+
HAL_DBG_TRACE_INFO( "No IRQ routine defined\n" );
996+
}
977997

978998
/* --- EOF ------------------------------------------------------------------ */

lr11xx/common/apps_configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extern "C" {
100100
#define LORA_PKT_LEN_MODE LR11XX_RADIO_LORA_PKT_EXPLICIT
101101
#endif
102102
#ifndef LORA_IQ
103-
#define LORA_IQ LR11XX_RADIO_LORA_IQ_INVERTED
103+
#define LORA_IQ LR11XX_RADIO_LORA_IQ_STANDARD
104104
#endif
105105
#ifndef LORA_CRC
106106
#define LORA_CRC LR11XX_RADIO_LORA_CRC_ON

lr11xx/common/lr11xx_hal_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ extern "C" {
4949
#include "smtc_hal_mcu_gpio_stm32l4.h"
5050
#include "stm32l4xx_ll_gpio.h"
5151
#include "stm32l4xx_ll_spi.h"
52+
#include "stm32l4xx_ll_utils.h"
5253

5354
/*
5455
* -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)