How and where to set default link keys?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How and where to set default link keys?

1,861 Views
w_ashcroft
Contributor I

Hello,

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.

Assume this is now ZPS_ZDO_DISTRIBUTED_LINK_KEY.

Some advice on the above would be appreciated.

Labels (1)
0 Kudos
Reply
3 Replies

1,402 Views
jacco_bezemer
Contributor III

Hi Warren,

Did you ever fix this. I'm getting the exact same error.

And unlike Estephania i can't build v1008.

Kind regards,

Jacco

0 Kudos
Reply

1,402 Views
jacco_bezemer
Contributor III

I got it working following the tip made by Matthias Brand in Howto join live Zigbee 3.0 Light network.

Not the intended way i think, but hey it works. That is, joining the Philips Hue network.

But then...i ran into other problems. See https://community.nxp.com/thread/497252  

0 Kudos
Reply

1,402 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

 

 

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

 

I downloaded the latest version of the SDK and the JN-AN-1218 and removed the comment in the definition and without any further modification and I was able 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.

 

 Maybe checking the implementation on the PUBLIC void APP_vFactoryResetRecords(void), there the ZPS_vSetKeys it’s called

 

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?

Have you checked this part o f the code ?

 

/*
 * If overriding the ZLL Master Key in the appilation,
 * define BDB_APPLICATION_DEFINED_TL_MASTER_KEY in bdb_options.h
 * otherwize the key defined in BDB\Source\touchlink\bdb_tl_common.c will be used.
 */
#ifdef BDB_APPLICATION_DEFINED_TL_MASTER_KEY
PUBLIC tsReg128 sTLMasterKey = {0x11223344, 0x55667788, 0x99aabbcc, 0xddeeff00 };
#endif

 

 

Regards, 

Estephania 

0 Kudos
Reply