AnsweredAssumed Answered

How and where to set default link keys?

Question asked by Warren Ashcroft on Sep 25, 2018
Latest reply on Jul 9, 2020 by Jacco Bezemer


There appears to have been changes in the latest v1745 of the JN-SW-4170 Zigbee 3.0 SDK that changes the way link keys are handled from previous version v1518 (I'm using the JN-AN-1218 Light Bulb demo application).


1) TouchLink Master Key - #define BDB_APPLICATION_DEFINED_TL_MASTER_KEY in bdb_options.h now results in a compiler error:


../../ExtendedColorLight/Build/app_zps_link_keys.o (symbol from plugin): In function `au8DistributedLinkKey':
(.text+0x0): multiple definition of `sTLMasterKey'
../../ExtendedColorLight/Build/App_ExtendedColorLight.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [../../ExtendedColorLight/Build/ExtendedColorLight_JN5168_DR1175.elf] Error 1


This logic has moved from BDB to ZigbeeCommon and the define is no longer pulled through to compile correctly.


2) Default/Preconfigured Link Key - BDB_vSetKeys() has been removed from BDB_vInit().


In the release notes this has apparently been replaced with ZPS_vSetKeys(), however as a result there are no longer any initial calls to ZPS_vAplSecSetInitialSecurityState() to set the default/preconfigured link keys.


3) ZPS Configurator - Perhaps initial calls to ZPS_vAplSecSetInitialSecurityState() are no longer necessary now, and this is handled entirely in the ZPS Configurator and resulting generated code?


However, it seems to be impossible to configure a default link key that exists in the resulting generated code, it looks like it's trying here:


PRIVATE ZPS_tsAplApsKeyDescriptorEntry s_keyPairTableStorage[4] = {
{ 0, 0xFFFF, { } },
{ 0, 0xFFFF, { } },
{ 0, 0xFFFF, { } },
{ 0, 0xFFFF, { } },
ZPS_tsAplApsKeyDescriptorEntry *psAplDefaultDistributedAPSLinkKey = &s_keyPairTableStorage[2];
ZPS_tsAplApsKeyDescriptorEntry *psAplDefaultGlobalAPSLinkKey = &s_keyPairTableStorage[3];


...even still, psAplDefaultDistributedAPSLinkKey and psAplDefaultGlobalAPSLinkKey aren't then used anywhere in the SDK to set these keys in the stack.


3) The JN-UG-3113 refers to the setting of ZPS_ZDO_ZLL_LINK_KEY but this constant no longer exists in Zigbee 3.




Some advice on the above would be appreciated.