Skip to content

Commit 243864e

Browse files
committed
Merge branch 'master' into develop
2 parents 52d9298 + da031ab commit 243864e

File tree

90 files changed

+3816
-4628
lines changed

Some content is hidden

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

90 files changed

+3816
-4628
lines changed

CHANGELOG.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,37 @@ Please refer to [Releases pre-certification-results](https://github.com/Lora-net
1111

1212
## [Unreleased]
1313

14-
## [4.5.0-rc.1] - 2020-11-24
14+
## [4.4.6] - 2020-12-18
1515

1616
### General
1717

18-
- Release based on "LoRaWAN specification 1.0.4" and "LoRaWAN Regional Parameters 2-1.0.1"
19-
- GitHub reported issues corrections. Please refer to [Release Version 4.5.0](https://github.com/Lora-net/LoRaMac-node/milestone/5)
20-
21-
### Added
22-
23-
- Added implementation of LoRaWAN 1.0.4 changes
24-
- Added implementation for new Certification protocol specification
25-
- Added GitHub repository and firmware examples version definitions
18+
- Release based on "LoRaWAN specification 1.0.3" and "LoRaWAN Regional Parameters v1.0.3revA"
19+
- GitHub reported issues corrections. Please refer to [Release Version 4.4.6](https://github.com/Lora-net/LoRaMac-node/milestone/8)
20+
- **Release 4.4.6 is the last one supporting "LoRaWAN specification 1.0.3"**
2621

2722
### Changed
2823

29-
- Changed IMST boards default power source to USB_POWER
24+
- Refactored MAC layer and examples Non Volatile Memory data handling
25+
- Changed `NewChannelReq` amd `DlChannelReq` handling to ignore command for `AU915`, `CN470` and `US915` regions
26+
- Updated behavior of `SX126xSetLoRaSymbNumTimeout` to round up the timeout to the nearest possible number of symbol.
27+
- Changed radio drivers floating point to integer computations
28+
- Improved `GetNextLowerTxDr` function implementation.
29+
- Changed SX1272 and SX1276 FSK FIFO handling by using `FifoLevel` IRQ instead of `FifoEmpty` IRQ
30+
**WARNING** *DIO1 IRQ MCU pin detection has changed from `RISING` to `RISING_FALLING` edge.*
31+
- Changed IMST boards default power source to `USB_POWER`
3032

3133
### Fixed
3234

33-
- Fixed an issue where the Join back off algorithm wasn't being applied when the duty-cycle enforcement was OFF.
35+
- Fixed certification test application handling
36+
- Fixed `ping-pong` and `rx-sensi` examples to use the right `FSK_BANDWIDTH` and `FSK_AFC_BANDWIDTH` parameters
37+
- Fixed one byte transmissions over I2C
38+
- Fixed `RegionIN865RxParamSetupReq` `DrOffset` verification
39+
- Fixed STM platforms IRQ handlers when using a C++ compiler
40+
- Fixed an issue where the Join back off algorithm wasn't being applied when the duty-cycle enforcement was OFF
3441
- Fixed `AU915_MAX_RX1_DR_OFFSET` value to 5 instead of 6
3542

3643
### Removed
3744

38-
- Removed NvmCtxCallback calls as they should only be done when a modification happens.
3945
- Removed ClassA, ClassB and ClassC examples.
4046

4147
## [4.4.5] - 2020-10-14
@@ -61,6 +67,7 @@ Please refer to [Releases pre-certification-results](https://github.com/Lora-net
6167
- Changed hard coded `JoinAccept` max payload size (33) by `LORAMAC_JOIN_ACCEPT_FRAME_MAX_SIZE` definition.
6268
- Moved radio operating mode management to specific board implementation
6369
- Changed radio `IsChannelFree API` in order to provide reception bandwidth
70+
- AS923 default downlink dwell time setting changed to disabled
6471
- Back port 1.0.4 region implementation improvements
6572
- Changed `RegionCommonComputeSymbolTimeLoRa`, `RegionCommonComputeSymbolTimeFsk` and `RegionCommonComputeRxWindowParameters`
6673
API implementations to use integer divisions instead of double division.

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
The aim of this project is to show an example of an end-device LoRaWAN stack implementation.
2020

21-
This project has 3 active branches in place.
21+
This project has 2 active branches in place.
2222

2323
| Branch | L2 spec | RP spec | Tag/Milestone | Class | Comments |
2424
| ------------- |:-------------:|:---------:|:---------:|:---------:|:--------------|
25-
| | [1.0.3](https://lora-alliance.org/resource-hub/lorawanr-specification-v103) | [v1.0.3revA](https://www.lora-alliance.org/resource-hub/lorawanr-regional-parameters-v103reva) | [v4.4.5](https://github.com/Lora-net/LoRaMac-node/releases/tag/v4.4.5) | A/B/C | LoRaWAN L2 1.0.3 - **_Released_** |
26-
| [master](https://github.com/Lora-net/LoRaMac-node/tree/master) | [1.0.3](https://lora-alliance.org/resource-hub/lorawanr-specification-v103) | [v1.0.3revA](https://www.lora-alliance.org/resource-hub/lorawanr-regional-parameters-v103reva) | [M 4.4.6](https://github.com/Lora-net/LoRaMac-node/milestone/8) | A/B/C | LoRaWAN L2 1.0.3 |
27-
| [develop](https://github.com/Lora-net/LoRaMac-node/tree/develop) | [1.0.4](https://lora-alliance.org/resource-hub) | [2-1.0.1](https://lora-alliance.org/sites/default/files/2020-02/rp_2-1.0.1.pdf) | [v4.5.0-rc.1](https://github.com/Lora-net/LoRaMac-node/releases/tag/v4.5.0-rc.1)/[M 4.5.0](https://github.com/Lora-net/LoRaMac-node/milestone/5) | A/B/C | LoRaWAN L2 1.0.4 - **_Pre-Released_**|
28-
| [feature/5.0.0](https://github.com/Lora-net/LoRaMac-node/tree/feature/5.0.0) | [1.0.4](https://lora-alliance.org/resource-hub) / [1.1.1](https://lora-alliance.org/resource-hub/lorawanr-specification-v11) | [2-1.0.1](https://lora-alliance.org/sites/default/files/2020-02/rp_2-1.0.1.pdf) | [M 5.0.0](https://github.com/Lora-net/LoRaMac-node/milestone/3) | A/B/C | LoRaWAN L2 1.0.4 / 1.1.1 |
25+
| | [1.0.3](https://lora-alliance.org/resource-hub/lorawanr-specification-v103) | [v1.0.3revA](https://www.lora-alliance.org/resource-hub/lorawanr-regional-parameters-v103reva) | [v4.4.6](https://github.com/Lora-net/LoRaMac-node/releases/tag/v4.4.6) | A/B/C | LoRaWAN L2 1.0.3 - **_Released_ (last release based on 1.0.3)** |
26+
| [master](https://github.com/Lora-net/LoRaMac-node/tree/master) | [1.0.4](https://lora-alliance.org/resource-hub/lorawan-104-specification-package) | [2-1.0.1](https://lora-alliance.org/sites/default/files/2020-02/rp_2-1.0.1.pdf) | [M 4.5.0](https://github.com/Lora-net/LoRaMac-node/milestone/5) | A/B/C | LoRaWAN L2 1.0.4 |
27+
| [develop](https://github.com/Lora-net/LoRaMac-node/tree/develop) | [1.0.4](https://lora-alliance.org/resource-hub/lorawan-104-specification-package) / [1.1.1](https://lora-alliance.org/resource-hub/lorawanr-specification-v11) | [2-1.0.1](https://lora-alliance.org/sites/default/files/2020-02/rp_2-1.0.1.pdf) | [M 4.6.0](https://github.com/Lora-net/LoRaMac-node/milestone/3) | A/B/C | LoRaWAN L2 1.0.4 / 1.1.1 |
2928

3029
This project fully implements ClassA, ClassB and ClassC end-device classes and it also provides SX1272/73, SX1276/77/78/79, SX1261/2 and LR1110 radio drivers.
3130

src/apps/LoRaMac/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ if(SUB_PROJECT STREQUAL periodic-uplink-lpp)
4949
#---------------------------------------------------------------------------------------
5050
list(APPEND ${PROJECT_NAME}_COMMON
5151
"${CMAKE_CURRENT_LIST_DIR}/common/CayenneLpp.c"
52+
"${CMAKE_CURRENT_LIST_DIR}/common/cli.c"
5253
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandlerMsgDisplay.c"
53-
"${CMAKE_CURRENT_LIST_DIR}/common/NvmCtxMgmt.c"
54+
"${CMAKE_CURRENT_LIST_DIR}/common/NvmDataMgmt.c"
5455
)
5556

5657
#---------------------------------------------------------------------------------------
@@ -78,7 +79,7 @@ elseif(SUB_PROJECT STREQUAL fuota-test-01)
7879
#---------------------------------------------------------------------------------------
7980
list(APPEND ${PROJECT_NAME}_COMMON
8081
"${CMAKE_CURRENT_LIST_DIR}/common/LmHandlerMsgDisplay.c"
81-
"${CMAKE_CURRENT_LIST_DIR}/common/NvmCtxMgmt.c"
82+
"${CMAKE_CURRENT_LIST_DIR}/common/NvmDataMgmt.c"
8283
)
8384

8485
#---------------------------------------------------------------------------------------
@@ -125,6 +126,9 @@ target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE ACTIVE_REGION=
125126
if(${SECURE_ELEMENT_PRE_PROVISIONED} MATCHES ON)
126127
target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE -DSECURE_ELEMENT_PRE_PROVISIONED)
127128
endif()
129+
if(${SECURE_ELEMENT} MATCHES SOFT_SE)
130+
target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PRIVATE -DSOFT_SE)
131+
endif()
128132
target_compile_definitions(${PROJECT_NAME}-${SUB_PROJECT} PUBLIC
129133
$<BUILD_INTERFACE:$<TARGET_PROPERTY:mac,INTERFACE_COMPILE_DEFINITIONS>>
130134
)

src/apps/LoRaMac/common/LmHandler/LmHandler.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
#include "utilities.h"
2929
#include "timer.h"
3030
#include "Commissioning.h"
31-
#include "NvmCtxMgmt.h"
31+
#include "NvmDataMgmt.h"
32+
#include "radio.h"
3233
#include "LmHandler.h"
3334
#include "LmhPackage.h"
3435
#include "LmhpCompliance.h"
@@ -222,6 +223,7 @@ LmHandlerErrorStatus_t LmHandlerInit( LmHandlerCallbacks_t *handlerCallbacks,
222223
LmHandlerParams_t *handlerParams )
223224
{
224225
//
226+
uint16_t nbNvmData = 0;
225227
MibRequestConfirm_t mibReq;
226228
LmHandlerParams = handlerParams;
227229
LmHandlerCallbacks = handlerCallbacks;
@@ -232,7 +234,7 @@ LmHandlerErrorStatus_t LmHandlerInit( LmHandlerCallbacks_t *handlerCallbacks,
232234
LoRaMacPrimitives.MacMlmeIndication = MlmeIndication;
233235
LoRaMacCallbacks.GetBatteryLevel = LmHandlerCallbacks->GetBatteryLevel;
234236
LoRaMacCallbacks.GetTemperatureLevel = LmHandlerCallbacks->GetTemperature;
235-
LoRaMacCallbacks.NvmContextChange = NvmCtxMgmtEvent;
237+
LoRaMacCallbacks.NvmDataChange = NvmDataMgmtEvent;
236238
LoRaMacCallbacks.MacProcessNotify = LmHandlerCallbacks->OnMacProcess;
237239

238240
IsClassBSwitchPending = false;
@@ -242,10 +244,13 @@ LmHandlerErrorStatus_t LmHandlerInit( LmHandlerCallbacks_t *handlerCallbacks,
242244
return LORAMAC_HANDLER_ERROR;
243245
}
244246

247+
// Restore data if required
248+
nbNvmData = NvmDataMgmtRestore( );
249+
245250
// Try to restore from NVM and query the mac if possible.
246-
if( NvmCtxMgmtRestore( ) == NVMCTXMGMT_STATUS_SUCCESS )
251+
if( nbNvmData > 0 )
247252
{
248-
LmHandlerCallbacks->OnNvmContextChange( LORAMAC_HANDLER_NVM_RESTORE );
253+
LmHandlerCallbacks->OnNvmDataChange( LORAMAC_HANDLER_NVM_RESTORE, nbNvmData );
249254
}
250255
else
251256
{
@@ -337,6 +342,8 @@ bool LmHandlerIsBusy( void )
337342

338343
void LmHandlerProcess( void )
339344
{
345+
uint16_t size = 0;
346+
340347
// Process Radio IRQ
341348
if( Radio.IrqProcess != NULL )
342349
{
@@ -346,9 +353,12 @@ void LmHandlerProcess( void )
346353
// Processes the LoRaMac events
347354
LoRaMacProcess( );
348355

349-
if( NvmCtxMgmtStore( ) == NVMCTXMGMT_STATUS_SUCCESS )
356+
// Store to NVM if required
357+
size = NvmDataMgmtStore( );
358+
359+
if( size > 0 )
350360
{
351-
LmHandlerCallbacks->OnNvmContextChange( LORAMAC_HANDLER_NVM_STORE );
361+
LmHandlerCallbacks->OnNvmDataChange( LORAMAC_HANDLER_NVM_STORE, size );
352362
}
353363

354364
// Call all packages process functions

src/apps/LoRaMac/common/LmHandler/LmHandler.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,19 @@ typedef struct LmHandlerCallbacks_s
137137
/*!
138138
*\brief Will be called each time a Radio IRQ is handled by the MAC
139139
* layer.
140-
*
140+
*
141141
*\warning Runs in a IRQ context. Should only change variables state.
142142
*/
143143
void ( *OnMacProcess )( void );
144144
/*!
145145
* Notifies the upper layer that the NVM context has changed
146146
*
147-
* \param [IN] stored Indicates if we are storing (true) or
148-
* restoring (false) the NVM context
147+
* \param [IN] state Indicates if we are storing (true) or
148+
* restoring (false) the NVM context
149+
*
150+
* \param [IN] size Number of data bytes which were stored or restored.
149151
*/
150-
void ( *OnNvmContextChange )( LmHandlerNvmContextStates_t state );
152+
void ( *OnNvmDataChange )( LmHandlerNvmContextStates_t state, uint16_t size );
151153
/*!
152154
* Notifies the upper layer that a network parameters have been set
153155
*

src/apps/LoRaMac/common/LmHandler/packages/LmhpCompliance.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <stdint.h>
2323
#include <stdbool.h>
2424
#include "board.h"
25-
#include "NvmCtxMgmt.h"
25+
#include "NvmDataMgmt.h"
2626
#include "LoRaMacTest.h"
2727
#include "LmHandler.h"
2828
#include "LmhpCompliance.h"

src/apps/LoRaMac/common/LmHandlerMsgDisplay.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,18 @@ void PrintHexBuffer( uint8_t *buffer, uint8_t size )
110110
printf( "\n" );
111111
}
112112

113-
void DisplayNvmContextChange( LmHandlerNvmContextStates_t state )
113+
void DisplayNvmDataChange( LmHandlerNvmContextStates_t state, uint16_t size )
114114
{
115115
if( state == LORAMAC_HANDLER_NVM_STORE )
116116
{
117-
printf( "\n###### ============ CTXS STORED ============ ######\n\n" );
117+
printf( "\n###### ============ CTXS STORED ============ ######\n" );
118+
118119
}
119120
else
120121
{
121-
printf( "\n###### =========== CTXS RESTORED =========== ######\n\n" );
122+
printf( "\n###### =========== CTXS RESTORED =========== ######\n" );
122123
}
124+
printf( "Size : %i\n\n", size );
123125
}
124126

125127
void DisplayNetworkParametersUpdate( CommissioningParams_t *commissioningParams )

src/apps/LoRaMac/common/LmHandlerMsgDisplay.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
*
3131
* \param [IN] state Indicates if we are storing (true) or
3232
* restoring (false) the NVM context
33+
*
34+
* \param [IN] size Number of data bytes which were stored or restored.
3335
*/
34-
void DisplayNvmContextChange( LmHandlerNvmContextStates_t state );
36+
void DisplayNvmDataChange( LmHandlerNvmContextStates_t state, uint16_t size );
3537

3638
/*!
3739
* \brief Displays updated network parameters

0 commit comments

Comments
 (0)