This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530: Z-Stack nwkUpdateId

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK, SIMPLELINK-CC13X2-26X2-SDK

Hi,

I'm reading the source code for "Z-Stack 3.0.2".
I have a question about how the nwkUpdateId make a round.

nwkUpdateId is incremented.
nwkUpdateId be back from 0xFF to 0.
The following comparison method, I don't think nwkUpdatId will be updated.
Is this okay?
If it's wrong, how should it be fixed?

For example
   uint8 nwkUpdateId;
   (Current)  _NIB.nwkUpdateId = 0xFF
   (Next)     Req.nwkUpdateId = 0xFF+1 = 0

ZDNwkMgr.c

  static void ZDNwkMgr_ProcessMgmtNwkUpdateReq( zdoIncomingMsg_t *inMsg )
  {
    else if ( Req.scanDuration == 0xFE )
    {
xx    if (( Req.nwkUpdateId > _NIB.nwkUpdateId ) && ( Req.channelMask != 0))
      {
        // Set update ID in the Beacon
      }
    }
    else if ( Req.scanDuration == 0xFF )
    {
xx    if (( Req.nwkUpdateId > _NIB.nwkUpdateId ) && ( Req.channelMask != 0))
      {
        // Set update ID in the Beacon
      }
    }

  • Hi,

    I agree that the Zigbee PRO 2017 Specification states that the nwkUpdateId should account for wraparound but that this is not considered by ZDNwkMgr_ProcessMgmtNwkUpdateReq.  My recommendation is to modify the if statements as such:

    if ( Req.nwkUpdateId > _NIB.nwkUpdateId || (Req.nwkUpdateId == 0 && _NIB.nwkUpdateId == 0xFF) )

    I've notified the Software Development Team so that this can be resolved for the SIMPLELINK-CC13X2-26X2-SDK.

    Regards,
    Ryan

  • @Ryan Brown1, what issue would be seen if we don't add this fix in Z-Stack?

  • Hi Yikai,

    If the received Network Update Request contained a nwkUpdateId which had overflowed to zero then the Z-Stack device would not proceed to update the network ID and change channels.  Without malicious intent this would require hundreds of channel updates over the lifetime of a Zigbee network.

    Regards,
    Ryan