cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55XXX Zigbee and Network Key Settings

Jonny
Associate III

Hello guys, 

I'm currently working on a STM32WB55VGY and I have some problem setting up the Zigbee network.

Using the example I found in the repository I was able to create a simple Zigbee network using the preconfiguredLinkKey.

Now I would like to go further and trying using the network key to protect the communication but I found some problem setting the network with the network key.

From the source code, I read that

 " /**< Configures the Network Key with key type set to ZB_SEC_KEYTYPE_STANDARD_NWK.* Only applicable if startupControl is ZbStartTypePreconfigured. */"

So I configured

zigbee_app_info.startupControl = ZbStartTypePreconfigured;

Then I Setup the Extended Pan ID to a Random value (From the Source code " *If startupControl is ZbStartTypePreconfigured a non-zero extendedPanId must be provided.")

ZbNwkSet(zigbee_app_info.zb, ZB_NWK_NIB_ID_ExtendedPanId, &PanId , 8);

And then I start up the ZigBee with the command

status = ZbStartupWait(zigbee_app_info.zb, &config);

But from the Callback, i received the answer

ZB_NWK_STATUS_INVALID_REQUEST

Any of you have ever tried to set up a Zigbee network using a network key?

thanks

Jonny

1 REPLY 1
Remi QUINTIN
ST Employee

Network Key settings

By default, Network Key is randomly generated by the Zigbee Coordinator at network formation.

Forcing network key value is achievable but is not a common practice.

Changing network key is only relevant if Zigbee network security was harmed.

To force network key value before Zigbee network formation, you need to :

·       Set custom network key after having called ZbStartupConfigGetProDefaults(&config);

o  memcpy (config.security.networkKey, sec_key_network_custom, ZB_SEC_KEYSIZE);  

·       Update startupControl from ZbStartTypeForm to ZbStartTypePreconfigured

·       You should also set following parameters :

o  ZC short address => config.shortAddress = 0x0000;

o  Extended Pan Id => config.extendedPanId

o  Pan Id => config.panId

o  Network Manager Address => config.networkManagerAddress

o  Network Key Sequence Number => config.security.networkKeySeqNum

 More information can be found in AN-5500 section 4.5.2.