Add Z-Stack_3.x.0 20200721 firmware

This commit is contained in:
Koen Kanters 2020-07-21 15:23:49 +02:00
parent e8204e8188
commit 941f11ced3
9 changed files with 242 additions and 317 deletions

View File

@ -1,4 +1,7 @@
# 20200328
# 20200721
- SimpleLink SDK 4.20.00.35 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.20.00.35/exports/changelog.html))
# 20200417
- SimpleLink SDK 4.10.00.78 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.10.00.78/exports/changelog.html)) (+ SimpleLink SDK 3.40.00.02 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/3.40.00.02/exports/changelog.html)))
- Remove and rediscover route on source route failure (should fix issues with e.g. Hue enddevices dropping off) ([more info](https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/883629))
- Fix devices not able to reconnect when attempt unsecured rejoin ([more info](https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311))

View File

@ -1,12 +1,12 @@
# Compiling the firmware
## Setup development environment
1. Download and install [SIMPLELINK-CC13X2-26X2-SDK_4.10.00.78](http://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK).
2. Download and install [Code Composer Studio 10.0.00010](http://www.ti.com/tool/CCSTUDIO).
1. Download and install [SIMPLELINK-CC13X2-26X2-SDK_4.20.00.35](http://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK).
2. Download and install [Code Composer Studio 10.1.0.00010](http://www.ti.com/tool/CCSTUDIO).
## Compiling
1. Start Code Composer Studio
2. Go to *File -> Import -> Code Composer Studio -> CCS Projects -> Select* search-directory: `simplelink_cc13x2_26x2_sdk_4_10_00_78/examples/rtos`. Select `znp_CC26X2R1_LAUNCHXL_tirtos_css`, `znp_CC1352P_2_LAUNCHXL_tirtos_css` and `znp_CC2652RB_LAUNCHXL_tirtos_css`. Press *Finish*.
2. Go to *File -> Import -> Code Composer Studio -> CCS Projects -> Select* search-directory: `simplelink_cc13x2_26x2_sdk_4_20_00_35/examples/rtos`. Select `znp_CC26X2R1_LAUNCHXL_tirtos_css`, `znp_CC1352P_2_LAUNCHXL_tirtos_css` and `znp_CC2652RB_LAUNCHXL_tirtos_css`. Press *Finish*.
3. Go to your CCS workspace and copy `firmware.patch` to the root.
4. Open Git Bash, go to your CCS root and apply the patch using `git apply firmware.patch --ignore-space-change`.
5. Build both projects; right click -> *Build project*.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,40 +1,40 @@
From a1a8f1f7c181b7f6368e82ca5fd448e6b5f01460 Mon Sep 17 00:00:00 2001
From 35c07f6fb32030dca9736a57f67a90269b5ed202 Mon Sep 17 00:00:00 2001
From: Koen Kanters <koenkanters94@gmail.com>
Date: Fri, 17 Apr 2020 17:50:22 +0200
Date: Mon, 20 Jul 2020 21:52:22 +0200
Subject: [PATCH] Own changes
---
.../Application/mt/mt_sys.c | 4 +-
.../Application/mt/mt_sys.c | 2 +-
.../Application/mt/mt_version.c | 2 +-
.../Application/mt/revision_info.h | 4 ++
.../Stack/Config/preinclude.h | 38 +++++++++++++++++++
.../Stack/Config/znp_cnf.opts | 2 +
.../Stack/af/af.c | 14 +++++--
.../Stack/sys/zglobals.c | 6 ++-
.../Stack/zdo/zd_app.c | 30 +++++++++------
.../Stack/zdo/zd_app.c | 22 +++++------
.../cc13x2lp.cmd | 6 +--
znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg | 5 ++-
.../Application/mt/mt_sys.c | 4 +-
.../Application/mt/mt_sys.c | 2 +-
.../Application/mt/mt_version.c | 2 +-
.../Application/mt/revision_info.h | 4 ++
.../Stack/Config/preinclude.h | 38 +++++++++++++++++++
.../Stack/Config/znp_cnf.opts | 2 +
.../Stack/af/af.c | 14 +++++--
.../Stack/sys/zglobals.c | 6 ++-
.../Stack/zdo/zd_app.c | 30 +++++++++------
.../Stack/zdo/zd_app.c | 22 +++++------
znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd | 12 ++----
znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg | 5 ++-
.../Application/mt/mt_sys.c | 4 +-
.../Application/mt/mt_sys.c | 2 +-
.../Application/mt/mt_version.c | 2 +-
.../Application/mt/revision_info.h | 4 ++
.../Stack/Config/preinclude.h | 38 +++++++++++++++++++
.../Stack/Config/znp_cnf.opts | 2 +
.../Stack/af/af.c | 14 +++++--
.../Stack/sys/zglobals.c | 6 ++-
.../Stack/zdo/zd_app.c | 30 +++++++++------
.../Stack/zdo/zd_app.c | 22 +++++------
znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd | 6 +--
znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg | 5 ++-
30 files changed, 258 insertions(+), 81 deletions(-)
30 files changed, 231 insertions(+), 78 deletions(-)
create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
create mode 100644 znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
@ -43,28 +43,19 @@ Subject: [PATCH] Own changes
create mode 100644 znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
index ee5ee10..7d8d058 100644
index f3d45f6..d709df7 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
@@ -510,8 +510,8 @@ static void MT_SysVersion(void)
uint8_t *pBuf = &verStr[sizeof(MTVersionString)];
#if (defined MAKE_CRC_SHDW) || (defined FAKE_CRC_SHDW) //built for bootloader
uint32_t sblSig;
- uint32_t sblRev;
#endif
+ uint32_t sblRev;
OsalPort_memcpy(verStr, (uint8_t *)MTVersionString, sizeof(MTVersionString));
@@ -1327,7 +1327,7 @@ static void MT_SysNvWrite(uint8_t *pBuf)
else
{
/* Attempt to write data (existing) to the specified item */
- error = pZStackCfg->nvFps.writeItemEx( nvId, dataOfs, dataLen, pBuf );
+ error = pZStackCfg->nvFps.writeItem( nvId, dataLen, pBuf );
}
}
uint8_t *pBuf = &verStr[sizeof(MTVersionString)];
#if (defined MAKE_CRC_SHDW) || (defined FAKE_CRC_SHDW) //built for bootloader
uint32_t sblSig;
- uint32_t sblRev;
#endif
+ uint32_t sblRev;
OsalPort_memcpy(verStr, (uint8_t *)MTVersionString, sizeof(MTVersionString));
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
index dbe48fb..f8402cd 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
@ -80,18 +71,17 @@ index dbe48fb..f8402cd 100644
1, /* Software maintenance release number */
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
new file mode 100644
index 0000000..04a07a3
index 0000000..5594a9d
--- /dev/null
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
@@ -0,0 +1,4 @@
+#ifndef APPLICATION_MT_REVISION_INFO_H_
+#define APPLICATION_MT_REVISION_INFO_H_
+#define CODE_REVISION_NUMBER 20200417
+#define CODE_REVISION_NUMBER 20200721
+#endif
\ No newline at end of file
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
new file mode 100644
index 0000000..d81062f
index 0000000..733be1d
--- /dev/null
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
@@ -0,0 +1,38 @@
@ -133,7 +123,6 @@ index 0000000..d81062f
+#define ZDSECMGR_TC_DEVICE_MAX 200
+#define MAX_NEIGHBOR_ENTRIES 20
+#define MAX_RTG_ENTRIES 100
\ No newline at end of file
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
index d809fb2..abb769e 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@ -146,15 +135,15 @@ index d809fb2..abb769e 100644
+--preinclude=preinclude.h
\ No newline at end of file
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/af/af.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/af/af.c
index bacef22..0193f78 100644
index a96b3cc..b64fb18 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/af/af.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/af/af.c
@@ -406,10 +406,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
+ if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) {
+ // No endpoint found, default to endpoint 1.
+ // In the original source code there is a return here.
@ -166,90 +155,75 @@ index bacef22..0193f78 100644
+ else {
+ epDesc = afFindEndPointDesc( grpEp );
+ }
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
index 117be3d..2cd470c 100644
index 0c62cd3..6d55ba4 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
@@ -110,7 +110,7 @@ uint8_t zgSecurePermitJoin = TRUE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
+uint8_t zgAllowRejoinsWithWellKnownKey = TRUE; // https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311#3265311
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
@@ -204,7 +204,9 @@ uint8_t zgEndDeviceConfiguration = END_DEV_CONFIGURATION;
//
// NOTICE: Before enabling Child Aging make sure to review all the related
// definitions in this file, especially zgNwkParentInformation.
-uint8_t zgChildAgingEnable = TRUE;
//
// NOTICE: Before enabling Child Aging make sure to review all the related
// definitions in this file, especially zgNwkParentInformation.
-uint8_t zgChildAgingEnable = TRUE;
+
+// Disable child aging, otherwise Xiaomi devices are being kicked off the network.
+uint8_t zgChildAgingEnable = FALSE;
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
index 969c516..cfe9f56 100644
index a893bc3..ca57a6a 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
@@ -422,12 +422,11 @@ uint32_t ZDApp_event_loop( uint8_t task_id, uint32_t events )
ZDApp_ChangeState( DEV_ROUTER );
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a ROUTER set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
ZDApp_ChangeState( DEV_ROUTER );
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a ROUTER set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
@@ -905,12 +904,11 @@ void ZDApp_NetworkStartEvt( void )
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a COORDINATOR set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
@@ -3184,6 +3182,14 @@ void ZDO_NetworkStatusCB( uint16_t nwkDstAddr, uint8_t statusCode, uint16_t dstA
// Routing error for dstAddr, this is informational and a Route
// Request should happen automatically.
}
+
+ if ( (nwkDstAddr == NLME_GetShortAddr())
+ && (statusCode == NWKSTAT_SOURCE_ROUTE_FAILURE) )
+ {
+ // Received a source route failure, remove route and rediscover.
+ RTG_RemoveRtgEntry( dstAddr, 0 );
+ NLME_RouteDiscoveryRequest( dstAddr, 0, 30 );
+ }
}
/******************************************************************************
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a COORDINATOR set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd
index 30e5847..016187a 100755
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd
@ -268,7 +242,7 @@ index 30e5847..016187a 100755
#define FLASH_LAST_SIZE 0x2000
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg
index 925448d..c80d40b 100644
index a1eef12..1794099 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg
@@ -52,6 +52,7 @@ CCFG.enableBootloaderBackdoor = true;
@ -291,28 +265,19 @@ index 925448d..c80d40b 100644
NVS2.$name = "CONFIG_NVSEXTERNAL";
NVS2.nvsType = "External";
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
index ee5ee10..7d8d058 100644
index f3d45f6..d709df7 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
@@ -510,8 +510,8 @@ static void MT_SysVersion(void)
uint8_t *pBuf = &verStr[sizeof(MTVersionString)];
#if (defined MAKE_CRC_SHDW) || (defined FAKE_CRC_SHDW) //built for bootloader
uint32_t sblSig;
- uint32_t sblRev;
#endif
+ uint32_t sblRev;
OsalPort_memcpy(verStr, (uint8_t *)MTVersionString, sizeof(MTVersionString));
@@ -1327,7 +1327,7 @@ static void MT_SysNvWrite(uint8_t *pBuf)
else
{
/* Attempt to write data (existing) to the specified item */
- error = pZStackCfg->nvFps.writeItemEx( nvId, dataOfs, dataLen, pBuf );
+ error = pZStackCfg->nvFps.writeItem( nvId, dataLen, pBuf );
}
}
uint8_t *pBuf = &verStr[sizeof(MTVersionString)];
#if (defined MAKE_CRC_SHDW) || (defined FAKE_CRC_SHDW) //built for bootloader
uint32_t sblSig;
- uint32_t sblRev;
#endif
+ uint32_t sblRev;
OsalPort_memcpy(verStr, (uint8_t *)MTVersionString, sizeof(MTVersionString));
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
index dbe48fb..f8402cd 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
@ -328,18 +293,17 @@ index dbe48fb..f8402cd 100644
1, /* Software maintenance release number */
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
new file mode 100644
index 0000000..04a07a3
index 0000000..5594a9d
--- /dev/null
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
@@ -0,0 +1,4 @@
+#ifndef APPLICATION_MT_REVISION_INFO_H_
+#define APPLICATION_MT_REVISION_INFO_H_
+#define CODE_REVISION_NUMBER 20200417
+#define CODE_REVISION_NUMBER 20200721
+#endif
\ No newline at end of file
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
new file mode 100644
index 0000000..d81062f
index 0000000..733be1d
--- /dev/null
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
@@ -0,0 +1,38 @@
@ -381,7 +345,6 @@ index 0000000..d81062f
+#define ZDSECMGR_TC_DEVICE_MAX 200
+#define MAX_NEIGHBOR_ENTRIES 20
+#define MAX_RTG_ENTRIES 100
\ No newline at end of file
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
index d809fb2..abb769e 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@ -394,15 +357,15 @@ index d809fb2..abb769e 100644
+--preinclude=preinclude.h
\ No newline at end of file
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/af/af.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/af/af.c
index bacef22..0193f78 100644
index a96b3cc..b64fb18 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/af/af.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/af/af.c
@@ -406,10 +406,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
+ if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) {
+ // No endpoint found, default to endpoint 1.
+ // In the original source code there is a return here.
@ -414,90 +377,75 @@ index bacef22..0193f78 100644
+ else {
+ epDesc = afFindEndPointDesc( grpEp );
+ }
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
index 117be3d..2cd470c 100644
index 0c62cd3..6d55ba4 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
@@ -110,7 +110,7 @@ uint8_t zgSecurePermitJoin = TRUE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
+uint8_t zgAllowRejoinsWithWellKnownKey = TRUE; // https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311#3265311
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
@@ -204,7 +204,9 @@ uint8_t zgEndDeviceConfiguration = END_DEV_CONFIGURATION;
//
// NOTICE: Before enabling Child Aging make sure to review all the related
// definitions in this file, especially zgNwkParentInformation.
-uint8_t zgChildAgingEnable = TRUE;
//
// NOTICE: Before enabling Child Aging make sure to review all the related
// definitions in this file, especially zgNwkParentInformation.
-uint8_t zgChildAgingEnable = TRUE;
+
+// Disable child aging, otherwise Xiaomi devices are being kicked off the network.
+uint8_t zgChildAgingEnable = FALSE;
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
index 969c516..cfe9f56 100644
index a893bc3..ca57a6a 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
@@ -422,12 +422,11 @@ uint32_t ZDApp_event_loop( uint8_t task_id, uint32_t events )
ZDApp_ChangeState( DEV_ROUTER );
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a ROUTER set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
ZDApp_ChangeState( DEV_ROUTER );
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a ROUTER set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
@@ -905,12 +904,11 @@ void ZDApp_NetworkStartEvt( void )
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a COORDINATOR set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
@@ -3184,6 +3182,14 @@ void ZDO_NetworkStatusCB( uint16_t nwkDstAddr, uint8_t statusCode, uint16_t dstA
// Routing error for dstAddr, this is informational and a Route
// Request should happen automatically.
}
+
+ if ( (nwkDstAddr == NLME_GetShortAddr())
+ && (statusCode == NWKSTAT_SOURCE_ROUTE_FAILURE) )
+ {
+ // Received a source route failure, remove route and rediscover.
+ RTG_RemoveRtgEntry( dstAddr, 0 );
+ NLME_RouteDiscoveryRequest( dstAddr, 0, 30 );
+ }
}
/******************************************************************************
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a COORDINATOR set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
index 2991774..1329f45 100755
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
@ -522,7 +470,7 @@ index 2991774..1329f45 100755
#define FLASH_LAST_SIZE 0x2000
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg
index d149bd9..2ec0b92 100644
index 55f270e..44ca0e7 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg
@@ -50,6 +50,7 @@ CCFG.enableBootloaderBackdoor = true;
@ -545,28 +493,19 @@ index d149bd9..2ec0b92 100644
NVS2.$name = "CONFIG_NVSEXTERNAL";
NVS2.nvsType = "External";
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
index ee5ee10..7d8d058 100644
index f3d45f6..d709df7 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_sys.c
@@ -510,8 +510,8 @@ static void MT_SysVersion(void)
uint8_t *pBuf = &verStr[sizeof(MTVersionString)];
#if (defined MAKE_CRC_SHDW) || (defined FAKE_CRC_SHDW) //built for bootloader
uint32_t sblSig;
- uint32_t sblRev;
#endif
+ uint32_t sblRev;
OsalPort_memcpy(verStr, (uint8_t *)MTVersionString, sizeof(MTVersionString));
@@ -1327,7 +1327,7 @@ static void MT_SysNvWrite(uint8_t *pBuf)
else
{
/* Attempt to write data (existing) to the specified item */
- error = pZStackCfg->nvFps.writeItemEx( nvId, dataOfs, dataLen, pBuf );
+ error = pZStackCfg->nvFps.writeItem( nvId, dataLen, pBuf );
}
}
uint8_t *pBuf = &verStr[sizeof(MTVersionString)];
#if (defined MAKE_CRC_SHDW) || (defined FAKE_CRC_SHDW) //built for bootloader
uint32_t sblSig;
- uint32_t sblRev;
#endif
+ uint32_t sblRev;
OsalPort_memcpy(verStr, (uint8_t *)MTVersionString, sizeof(MTVersionString));
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
index dbe48fb..f8402cd 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
@ -582,18 +521,17 @@ index dbe48fb..f8402cd 100644
1, /* Software maintenance release number */
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
new file mode 100644
index 0000000..04a07a3
index 0000000..5594a9d
--- /dev/null
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/revision_info.h
@@ -0,0 +1,4 @@
+#ifndef APPLICATION_MT_REVISION_INFO_H_
+#define APPLICATION_MT_REVISION_INFO_H_
+#define CODE_REVISION_NUMBER 20200417
+#define CODE_REVISION_NUMBER 20200721
+#endif
\ No newline at end of file
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
new file mode 100644
index 0000000..d81062f
index 0000000..733be1d
--- /dev/null
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
@@ -0,0 +1,38 @@
@ -635,7 +573,6 @@ index 0000000..d81062f
+#define ZDSECMGR_TC_DEVICE_MAX 200
+#define MAX_NEIGHBOR_ENTRIES 20
+#define MAX_RTG_ENTRIES 100
\ No newline at end of file
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
index d809fb2..abb769e 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@ -648,15 +585,15 @@ index d809fb2..abb769e 100644
+--preinclude=preinclude.h
\ No newline at end of file
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/af/af.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/af/af.c
index bacef22..0193f78 100644
index a96b3cc..b64fb18 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/af/af.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/af/af.c
@@ -406,10 +406,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
+ if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) {
+ // No endpoint found, default to endpoint 1.
+ // In the original source code there is a return here.
@ -668,90 +605,75 @@ index bacef22..0193f78 100644
+ else {
+ epDesc = afFindEndPointDesc( grpEp );
+ }
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
index 117be3d..2cd470c 100644
index 0c62cd3..6d55ba4 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
@@ -110,7 +110,7 @@ uint8_t zgSecurePermitJoin = TRUE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
+uint8_t zgAllowRejoinsWithWellKnownKey = TRUE; // https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311#3265311
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
@@ -204,7 +204,9 @@ uint8_t zgEndDeviceConfiguration = END_DEV_CONFIGURATION;
//
// NOTICE: Before enabling Child Aging make sure to review all the related
// definitions in this file, especially zgNwkParentInformation.
-uint8_t zgChildAgingEnable = TRUE;
//
// NOTICE: Before enabling Child Aging make sure to review all the related
// definitions in this file, especially zgNwkParentInformation.
-uint8_t zgChildAgingEnable = TRUE;
+
+// Disable child aging, otherwise Xiaomi devices are being kicked off the network.
+uint8_t zgChildAgingEnable = FALSE;
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
index 969c516..cfe9f56 100644
index a893bc3..ca57a6a 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
@@ -422,12 +422,11 @@ uint32_t ZDApp_event_loop( uint8_t task_id, uint32_t events )
ZDApp_ChangeState( DEV_ROUTER );
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a ROUTER set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
ZDApp_ChangeState( DEV_ROUTER );
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a ROUTER set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
@@ -905,12 +904,11 @@ void ZDApp_NetworkStartEvt( void )
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a COORDINATOR set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
@@ -3184,6 +3182,14 @@ void ZDO_NetworkStatusCB( uint16_t nwkDstAddr, uint8_t statusCode, uint16_t dstA
// Routing error for dstAddr, this is informational and a Route
// Request should happen automatically.
}
+
+ if ( (nwkDstAddr == NLME_GetShortAddr())
+ && (statusCode == NWKSTAT_SOURCE_ROUTE_FAILURE) )
+ {
+ // Received a source route failure, remove route and rediscover.
+ RTG_RemoveRtgEntry( dstAddr, 0 );
+ NLME_RouteDiscoveryRequest( dstAddr, 0, 30 );
+ }
}
/******************************************************************************
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
- if ( zgChildAgingEnable == TRUE )
- {
- // Once the device has changed its state to a COORDINATOR set the timer to send
- // Parent annce
- ZDApp_SetParentAnnceTimer();
- }
+ // As we cannot enable child aging as Xiaomi devices will drop off
+ // but we stil want to have the parent announces we always enable it here.
+ // Otherwise some end devices could be unreachable when they changed parent
+ // while the coordinator was powered off.
+ ZDApp_SetParentAnnceTimer();
}
else
{
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
index 464e39c..1329f45 100755
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
@ -770,7 +692,7 @@ index 464e39c..1329f45 100755
#define FLASH_LAST_SIZE 0x2000
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg
index 86c093b..d007d4c 100644
index 09f46d2..99e4ebd 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg
@@ -49,6 +49,7 @@ CCFG.enableBootloader = true;
@ -793,5 +715,5 @@ index 86c093b..d007d4c 100644
NVS2.$name = "CONFIG_NVSEXTERNAL";
NVS2.nvsType = "External";
--
2.24.1 (Apple Git-126)
2.24.3 (Apple Git-128)