Skip to content

Commit

Permalink
Release v3.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rbaquero committed Sep 9, 2022
1 parent cf58a73 commit 8d052b2
Show file tree
Hide file tree
Showing 90 changed files with 3,179 additions and 2,414 deletions.
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ All notable changes to this project will be documented in this file.

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).

## [v3.2.4] 2022-08-23

### Added

* AS923 group 4 Regional Parameters
* WW2G4 Regional Parameters for LoRaWAN protocol emulation
* Support of sx128x radio

### Changed

* [lr11xx_driver] Update to version `v2.1.1`
* [sx126x_driver] Update to version `v2.1.0`
* [makefile] remove ARM Cortex option from makefile to make LoRa Basics Modem completely agnostic from the MCU. Makefile shall be called with a new MCU_FLAGS option containing all core options
* [makefile] Align built target directory with crypto compilation options
* [utility/example] Update PA configuration process in `ral_lr11xx_bsp_get_tx_cfg` function.
* [utility/example] Update `stm32l476rgtx_flash.ld` files to fix stack start and stop address
* [utility/example] Remove `ral_lr11xx_bsp_get_rssi_calibration_table` workaround as the lr11xx driver was fixed
* [utility/example] Fix `hal_rtc_get_time_ms` so that it returns a full range value
* Clock Sync Service with ALC Sync source can generate events:
* SMTC_MODEM_EVENT_TIME_VALID_BUT_NOT_SYNC
* Clock Sync Service with DeviceTimeReq source can generate events:
* SMTC_MODEM_EVENT_TIME_VALID_BUT_NOT_SYNC
* SMTC_MODEM_EVENT_TIME_NOT_VALID

### Fixed

* [LFU] LoRa Basics Modem now rejects properly files with a size between 8181 and 8192 bytes
* [LFU] Fix issue regarding encryption of files with size higher than 4080 bytes
* [RP] Fix issue on radio interruption timestamp
* [LBT] On lr11xx targets, correct outdated LBT pre-hook issue
* [LBT] Remove log print when uplinking on fsk to avoid adding delay on scheduled tasks
* [LBT] Moved log print after enqueued the sniffing task in Radio Planer to avoid to add a delays
* [ADR] In case a MAC command `link_adr_req` with a new channel mask is received, it is now accepted if the custom datarate profile is enabled and configured with the highest datarate of the corresponding region
* [LFU/Stream] In case of reception of rejoin request from DAS, reset LFU and stream services properly
*[ClockSyncService/MAC] Fixed an issue where the Clock Synchronization Service was not reloaded when DeviceTimeAns was not received
*[DeviceTimeReq/MAC] Fixed an issue where the GPS epoch time became invalid if DeviceTimeAns not received

## [v3.1.7] 2022-04-22

### Added
Expand Down Expand Up @@ -31,7 +68,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
* `smtc_modem_set_crystal_error` renamed to `smtc_modem_set_crystal_error_ppm` and now takes real ppm (previously was ppt)
* `smtc_modem_get_stack_state`: Added a new stack state `SMTC_MODEM_STACK_STATE_TX_WAIT` when stack is between retransmissions
* `smtc_modem_time_trigger_sync_request` function does not take `sync_service` parameter anymore, now it will use the current enabled time synchronization service
* [smtc_modem_hal]:
* [smtc_modem_hal]:
* `smtc_modem_hal_irq_is_radio_irq_pending()` function has been replaced with `smtc_modem_hal_radio_irq_clear_pending()`. Now modem only asks to clear radio pending irq
* LR1110 driver was renamed to LR11xx driver and now also supports LR1120 radio
* Updated to latest version of SX126x and LR11xx driver
Expand Down
118 changes: 71 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ TARGET_ROOT = basic_modem

BYPASS=no

PERF_TEST=no

# Crypto management
CRYPTO ?= SOFT
PERF_TEST?=no

# Compile with coverage analysis support
COVERAGE ?= no
Expand All @@ -35,67 +32,85 @@ LOG_MEM ?= yes
# Tranceiver
RADIO ?= nc

#MCU - Must be provided by user
MCU_FLAGS =? nc

#-----------------------------------------------------------------------------
# Internal LBM features management
#-----------------------------------------------------------------------------

# Middleware advanced access
MIDDLEWARE?= no

# Crypto management
CRYPTO ?= SOFT

# D2D feature
ADD_D2D ?= no

# Multicast feature
ADD_MULTICAST ?= yes

# Stream feature
ADD_SMTC_STREAM ?= yes

# File Upload feature
ADD_SMTC_FILE_UPLOAD ?= yes

# ALCSYNC feature
ADD_SMTC_ALC_SYNC ?= yes

# Trace prints
MODEM_TRACE ?= yes
MODEM_DEEP_TRACE ?= no

# GNSS
USE_GNSS ?= yes

# TB bypass
BYPASS_JOIN_DUTY_CYCLE?= no

# Middleware advanced access
MIDDLEWARE?= no

ifeq ($(MODEM_APP),HW_MODEM)
override BYPASS_JOIN_DUTY_CYCLE = yes
endif

#-----------------------------------------------------------------------------
# default action: print help
#-----------------------------------------------------------------------------
help:
$(call echo_help_b, "Available TARGETs: sx128x lr1110 lr1120 sx1261 sx1262")
$(call echo_help_b, "Available TARGETs: sx128x lr1110 lr1120 sx1261 sx1262 sx1268")
$(call echo_help, "")
$(call echo_help_b, "-------------------------------- Clean -------------------------------------")
$(call echo_help, " * make clean_<TARGET> : clean basic_modem for a given target")
$(call echo_help, " * make clean_all : clean all")
$(call echo_help, " * make clean_<TARGET> : clean basic_modem for a given target")
$(call echo_help, " * make clean_all : clean all")
$(call echo_help, "")
$(call echo_help_b, "----------------------------- Compilation ----------------------------------")
$(call echo_help, " * make basic_modem_<TARGET> : build basic_modem on a given target")
$(call echo_help, " * make all : build all targets")
$(call echo_help, " * make basic_modem_<TARGET> MCU_FLAGS=xxx : build basic_modem on a given target with chosen mcu flags")
$(call echo_help, " * MCU_FLAGS are mandatory. Ex for stm32l4:")
$(call echo_help, " * MCU_FLAGS=\"-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard\"")
$(call echo_help, "")
$(call echo_help_b, "---------------------- Optional build parameters ---------------------------")
$(call echo_help, " * REGION=xxx : choose which region should be compiled (default: all)")
$(call echo_help, " * Combinations also work (i.e. REGION=EU_868,US_915 )")
$(call echo_help, " * - AS_923")
$(call echo_help, " * - AU_915")
$(call echo_help, " * - CN_470")
$(call echo_help, " * - CN_470_RP_1_0")
$(call echo_help, " * - EU_868")
$(call echo_help, " * - IN_865")
$(call echo_help, " * - KR_920")
$(call echo_help, " * - RU_864")
$(call echo_help, " * - US_915")
$(call echo_help, " * - WW_2G4 (to be used only for lr1120 and sx128x targets)")
$(call echo_help, " * RP_VERSION=xxx : choose wich regional paramerter version should be compiled (default: RP2_101) ")
$(call echo_help, " * - RP2_101")
$(call echo_help, " * - RP2_103 (LR-FHSS support)")
$(call echo_help, " * CRYPTO=xxx : choose which crypto should be compiled (default: SOFT)")
$(call echo_help, " * - SOFT")
$(call echo_help, " * - LR11XX (only for lr1110 and lr1120 targets)")
$(call echo_help, " * - LR11XX_WITH_CREDENTIALS (only for lr1110 and lr1120 targets)")
$(call echo_help, " * MODEM_TRACE=yes/no : choose to enable or disable modem trace print (default: trace is ON)")
$(call echo_help, " * USE_GNSS=yes/no : only for lr1110 and lr1120 targets: choose to enable or disable use of gnss (default: gnss is ON)")
$(call echo_help, " * MIDDLEWARE=yes : build target for middleware advanced access")
$(call echo_help, " * REGION=xxx : choose which region should be compiled (default: all)")
$(call echo_help, " * Combinations also work (i.e. REGION=EU_868,US_915 )")
$(call echo_help, " * - AS_923")
$(call echo_help, " * - AU_915")
$(call echo_help, " * - CN_470")
$(call echo_help, " * - CN_470_RP_1_0")
$(call echo_help, " * - EU_868")
$(call echo_help, " * - IN_865")
$(call echo_help, " * - KR_920")
$(call echo_help, " * - RU_864")
$(call echo_help, " * - US_915")
$(call echo_help, " * - WW_2G4 (to be used only for lr1120 and sx128x targets)")
$(call echo_help, " * RP_VERSION=xxx : choose wich regional paramerter version should be compiled (default: RP2_101) ")
$(call echo_help, " * - RP2_101")
$(call echo_help, " * - RP2_103 (LR-FHSS support)")
$(call echo_help, " * CRYPTO=xxx : choose which crypto should be compiled (default: SOFT)")
$(call echo_help, " * - SOFT")
$(call echo_help, " * - LR11XX (only for lr1110 and lr1120 targets)")
$(call echo_help, " * - LR11XX_WITH_CREDENTIALS (only for lr1110 and lr1120 targets)")
$(call echo_help, " * MODEM_TRACE=yes/no : choose to enable or disable modem trace print (default: yes)")
$(call echo_help, " * USE_GNSS=yes/no : only for lr1110 and lr1120 targets: choose to enable or disable use of gnss (default: yes)")
$(call echo_help, " * MIDDLEWARE=yes/no : build target for middleware advanced access (default: no)")
$(call echo_help_b, "-------------------- Optional makefile parameters --------------------------")
$(call echo_help, " * MULTITHREAD=no : Disable multithreaded build")
$(call echo_help, " * COVERAGE=xxx : build target with coverage instrumentation for specific subsystems:")
$(call echo_help, " * - RADIO")
$(call echo_help, " * - MODEM")
$(call echo_help, " * VERBOSE=yes : Increase build verbosity")
$(call echo_help, " * SIZE=yes : Display size for all objects")
$(call echo_help, " * DEBUG=yes/no : Change opt to O0 and add -g* options for debugging (default: no)")
$(call echo_help, " * MULTITHREAD=yes/no : Multithreaded build (default: yes)")
$(call echo_help, " * VERBOSE=yes/no : Increase build verbosity (default: no)")
$(call echo_help, " * SIZE=yes/no : Display size for all objects (default: no)")



Expand All @@ -118,14 +133,18 @@ ifeq ($(RADIO),sx1262)
-include makefiles/sx126x.mk
endif

ifeq ($(RADIO),sx1268)
-include makefiles/sx126x.mk
endif

ifeq ($(RADIO),sx128x)
-include makefiles/sx128x.mk
endif

#-----------------------------------------------------------------------------
-include makefiles/common.mk

.PHONY: clean_all all help
.PHONY: clean_all all help
.PHONY: FORCE
FORCE:

Expand All @@ -152,6 +171,9 @@ clean_sx1261:
clean_sx1262:
$(MAKE) clean_target RADIO=sx1262

clean_sx1268:
$(MAKE) clean_target RADIO=sx1268

#-----------------------------------------------------------------------------
# Compilation
#-----------------------------------------------------------------------------
Expand All @@ -170,3 +192,5 @@ basic_modem_sx1261:
basic_modem_sx1262:
$(MAKE) basic_modem RADIO=sx1262 $(MTHREAD_FLAG)

basic_modem_sx1268:
$(MAKE) basic_modem RADIO=sx1268 $(MTHREAD_FLAG)
36 changes: 11 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ LoRa Basics Modem supports the following LoRaWAN regions:
* RU_864
* US_915

LoRa Basics Modem supports an emulation of LoRaWAN protocol for the 2.4GHz global ISM band (WW2G4)

### LoRaWAN regional parameters

Default regional parameters version supported by LoRa Basics Modem is rp2-1.0.1. It is possible to switch to rp2-1.0.3 at compile time.
Expand Down Expand Up @@ -60,42 +62,26 @@ The Hardware Abstraction Layer of LoRa Basics Modem is defined in the `smtc_mode
LoRa Basics Modem supports the following transceivers:

* LR1110 with firmware 0x0307.
* LR1120 with firmware 0x0101
* SX1261
* SX1262
* SX1280
* SX1281

## Known Limitations

* [LFU] In case LoRa Basics Modem is acting in US915 region with datarate DR0, files smaller than 13 bytes are not properly sent and cannot be econstructed on LoRa Cloud side
* [LFU] LoRa Basics Modem does not reject files with a size between 8181 and 8192 bytes while they cannot be sent properly
* [LFU] Enabling encryption on a file with a size larger than 4080 bytes will prevent this file from being properly decrypted. Recommendation is to not use encryption for files with a size larger than 4080 bytes.
* [LFU] In case LoRa Basics Modem is acting in US915 region with datarate DR0, files smaller than 13 bytes are not properly sent and cannot be reconstructed on LoRa Cloud side
* [charge] Values returned by `smtc_modem_get_charge()` for regions CN470 and CN470_RP1 are not accurate
* [charge] Values returned by `smtc_modem_get_charge()` for the LR-FHSS based datarate are not accurate
* [LBT] On LR1110 target, sometimes the LBT pre-hook can be outdated and aborted which leads to no uplink issued (this is due to a radio reset called before starting LBT operation which adds the LR1110 boot delay before any LBT actions) - as workaround, the call to `ral_init()` can be removed from `smtc_modem_core/lr1mac/src/services/smtc_lbt.c`
* [ADR] When a MAC command `link_adr_req` with a new channel mask is received, it is rejected if the custom datarate profile is enabled and configured with the highest datarate of the corresponding region - as a workaround, make sure there is at least one datarate different from the highest possible one in the custom ADR list

In [the simple application example](/utilities/user_app/), the implementation of [smtc_modem_hal_get_time_in_ms](/utilities/user_app/smtc_hal_l4/smtc_hal_rtc.c) does not cover the full scale of the 32-bit counter and will wrap earlier than expected. As a consequence, LoRa Basics Modem may reset after the wrapping time around 4.9 days. Find below a correct implementation:

```c
uint32_t hal_rtc_get_time_ms( void )
{
uint32_t seconds = 0;
uint16_t milliseconds_div_10 = 0;

seconds = rtc_get_calendar_time( &milliseconds_div_10 );

return seconds * 1000 + ( milliseconds_div_10 / 10 );
}
```
This workaround requires the following modification to be applied in the radio planner source code - [radio_planner.c, line 423](/smtc_modem_core/radio_planner/src/radio_planner.c):
rp->irq_timestamp_ms[rp->radio_task_id] = rp_hal_get_time_in_ms( );
* [multicast_class_b] Starting a class B multicast session with frequency equal to 0 will always return SMTC_MODEM_RC_INVALID even in the case lbm is acting in regions with frequency hopping beacon
* [LBT] In case LBT is used (by user's choice or imposed by regional parameters) and if TCXO start time is greater than default RP_MARGIN_DELAY value (8ms), uplinks will never be sent.
Workaround: At makefile level define RP_MARGIN_DELAY value to `TCXO start time + 3ms`. The consequence is that before rx1 and rx2 windows opening the mcu will be running and waiting during extra time.

## Disclaimer

This software has been extensively tested when targeting LR1110 / SX1261 / SX1262 for LoRaWAN regions mentioned in [this paragraph](#lorawan-region). For all other combinations of features this software shall be considered an Engineering Sample.
This software has been extensively tested when targeting LR1110 / LR1120 / SX1261 / SX1262 / SX1280 / SX1281 for LoRaWAN regions mentioned in [this paragraph](#lorawan-region). For all other combinations of features this software shall be considered an Engineering Sample.

All customers wanting to leverage LoRa Basics Modem for 2.4GHz running with SX1280 transceiver must still refer to the [release v1.0.1](https://github.com/lorabasics/lorabasicsmodem/releases/tag/v1.0.1) for which Semtech provides technical customer support.
Modem trace prints can only be used for debug purpose and shall be deactivated for production release.

### Disclaimer for Engineering Samples

Expand Down
4 changes: 2 additions & 2 deletions lora_basics_modem_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ extern "C" {
* --- PUBLIC TYPES ------------------------------------------------------------
*/
#define LORA_BASICS_MODEM_FW_VERSION_MAJOR 3
#define LORA_BASICS_MODEM_FW_VERSION_MINOR 1
#define LORA_BASICS_MODEM_FW_VERSION_PATCH 7
#define LORA_BASICS_MODEM_FW_VERSION_MINOR 2
#define LORA_BASICS_MODEM_FW_VERSION_PATCH 4

/*
* -----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 8d052b2

Please sign in to comment.