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.

[参考译文] LAUNCHXL-CC1352P:问题:路由器在加入网络时崩溃。

Guru**** 2455560 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1484720/launchxl-cc1352p-issue-router-crashes-when-join-into-the-network

器件型号:LAUNCHXL-CC1352P

工具与软件:

环境中有多个协调人、他们都已关闭许可工作。 如果路由器未能检测到加入网络的可能性、它将崩溃。

没错。 此问题是由函数'bdb_filterNwkDisc'引起的。 它可以像这样进行固定。

void bdb_filterNwkDisc(void)
{
  networkDesc_t* pNwkDesc;
  uint8_t i = 0;
  uint8_t ResultCount = 0, ResultTotal = 0;

  pBDBListNwk  = nwk_getNwkDescList();
  nwk_desc_list_release();

  pNwkDesc = pBDBListNwk;
  while (pNwkDesc)
  {
    ResultCount++;
    pNwkDesc = pNwkDesc->nextDesc;
  }

  ResultTotal = ResultCount;

  if(pBDBListNwk)
  {
    pNwkDesc = pBDBListNwk;

    if(pNwkDesc)
    {
      void *nextDesc = pNwkDesc->nextDesc;
      // "nextDesc" replace "pNwkDesc->nextDesc" because "pNwkDesc->nextDesc" is not corret after freed, fixed by LuoYiming 2025-03-10
      for ( i = 0; i < ResultTotal; i++, pNwkDesc = nextDesc ) 
      {
        nextDesc = pNwkDesc->nextDesc; // get the "nextDesc" before "pNwkDesc" is freed, fixed by LuoYiming 2025-03-10
        if ( nwk_ExtPANIDValid( ZDO_UseExtendedPANID ) == true )
        {
          // If the extended Pan ID is commissioned to a non zero value
          // Only join the Pan that has match EPID
          if ( osal_ExtAddrEqual( ZDO_UseExtendedPANID, pNwkDesc->extendedPANID) == false )
          {
            //Remove from the list
            bdb_nwkDescFree(pNwkDesc);
            ResultCount--;
            continue;
          }
        }
        else if ( zgConfigPANID != 0xFFFF )
        {
          // PAN Id is preconfigured. check if it matches
          if ( pNwkDesc->panId != zgConfigPANID )
          {
            //Remove from the list
            bdb_nwkDescFree(pNwkDesc);
            ResultCount--;
            continue;
          }
        }

        if ( pNwkDesc->chosenRouter != _NIB.nwkCoordAddress || _NIB.nwkCoordAddress == INVALID_NODE_ADDR )
        {
          // check that network is allowing joining
          if ( ZSTACK_ROUTER_BUILD )
          {
            if ( !pNwkDesc->routerCapacity )
            {
              //Remove from the list
              bdb_nwkDescFree(pNwkDesc);
              ResultCount--;
              continue;
            }
          }
          else if ( ZSTACK_END_DEVICE_BUILD )
          {
            if ( !pNwkDesc->deviceCapacity )
            {
              //Remove from the list
              bdb_nwkDescFree(pNwkDesc);
              ResultCount--;
              continue;
            }
          }
        }

        // check version of zigbee protocol
        if ( pNwkDesc->version != _NIB.nwkProtocolVersion )
          continue;

        // check version of stack profile, only matching profiles are supported
        if ( pNwkDesc->stackProfile != zgStackProfile  )
        {
            //Remove from the list
            bdb_nwkDescFree(pNwkDesc);
            ResultCount--;
            continue;
        }
      }
    }
  }

  //Notify the application about the remaining valid networks to join
  if(pfnFilterNwkDesc)
  {
    pfnFilterNwkDesc(pBDBListNwk, ResultCount);
  }
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Aries、

    感谢您发布问题解决方案。  

    谢谢!
    Alex F