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.

[参考译文] CC1310:TI15.4:在传感器断开连接和收集器复位后复制了短地址

Guru**** 2484615 points
Other Parts Discussed in Thread: CC1310

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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1191915/cc1310-ti15-4-duplicated-short-address-after-sensor-disassociated-and-collector-reset

器件型号:CC1310

我的客户在使用 CC1310 TI15.4堆栈时报告了一个可能的问题:当网络中有多个传感器且一个传感器断开关联时、收集器复位、新连接的传感器的短地址将与其余传感器重复。

 使用 simplelink_cc13x0_sdk_4_20_02_07重现此问题的步骤:

1.建立一个包含一个收集器和两个传感器的网络, 短地址0x1和0x2将被分配给传感器。

2.按下 LaunchPad 上的按钮、解除传感器0x1的关联。

3.重置收集器。

4.尝试再次关联刚刚离开的传感器,将为传感器分配一个短地址0x2,并且收集器侧将出现安全错误。

我读取 cllc.c 中的代码、发现变量  Cllc_numOfDevices 在电源周期之间不一致。 此变量用于确定 assocIndCb 中新器件的短地址:

    if(devInfo.shortAddress == CSF_INVALID_SHORT_ADDR)
    {
        /* New device, make a new short address */
        assocRsp.status = ApiMac_assocStatus_panAccessDenied;
        devInfo.shortAddress = Cllc_numOfDevices + CLLC_ASSOC_DEVICE_STARTING_NUMBER;

        ......
    }

 一个器 件加入后,在 maintainAssocTable()内,Cllc_numOfDevices 会递增,但在下电上电后,Cllc_numOfDevices 会设置为0,这会导致在复位后加入器件时短地址重复。

您能否确认问题并建议修复? 谢谢。

此致、

水阳

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

    您好、Shuyang、  

    很抱歉、我还没有时间研究这个问题。 我明天会做这个、然后再回来。  

    此致、

    SID

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

    您好、Shuyang、  

    这似乎是以前报告过的、并且有一张票。 我将检查此问题的解决方法。  

    此致。

    SID

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

    您好、Shuyang、  

    请检查您的项目中是否定义了 NV_RESTORE。 我看到短寻址索引存储在 NV 中、并在使用此定义的复位时恢复。  

    此致、

    SID

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

    您好 Siddanth_N:

       我们定义 了 NV_RESTORE、我 猜此问题的根本原因是 Cllc_numOfDevices 未保存到 NV。  收集器会在重置之前删除 NVM 中的第一个传感器。 因此、当收集器复位时 、Cllc_numOfDevices = 1 (nV 中的器件数量)、新的短地址将为02 (Cllc_numOfDevices + 1)。这是重复的。

       BR。

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

    您好、Shayolin、  

    正如您所指出的,devShortAddr 的管理方式发生了变化。 需要进行3次更改、所有更改都位于 cllc.c 中、如下所示:

    1.更换

      

    uint16_t Cllc_devShortAddr = 0x0001;
    

    使用

     

    uint16_t Cllc_devShortAddr = CLLC_ASSOC_DEVICE_STARTING_NUMBER;

    2.在 Cllc_restoreNetwork 中的 maintainAssetTable 调用之后,需要添加两个 if 块。  我在此处添加了整个 cllc_restoreNetwork:

    /*!
     Restore network
    
     Public function defined in cllc.h
     */
    void Cllc_restoreNetwork(Llc_netInfo_t *pNetworkInfo, uint8_t numDevices,
    		Llc_deviceListItem_t *pDevList)
    {
        uint8_t i = 0;
    
        /* set state */
        updateState(Cllc_states_initRestoringCoordinator);
    
        coordInfoBlock.panID = pNetworkInfo->devInfo.panID;
    
        /* Populate network info according to type of network */
        if(pNetworkInfo->fh == true)
        {
            ApiMac_mlmeSetReqArray(ApiMac_attribute_extendedAddress,
        			(uint8_t*)(pNetworkInfo->devInfo.extAddress));
        }
        else
        {
            coordInfoBlock.channel = pNetworkInfo->channel;
        }
    
        ApiMac_mlmeSetReqUint16(ApiMac_attribute_shortAddress,
                                 pNetworkInfo->devInfo.shortAddress);
    
        sendStartReq(pNetworkInfo->fh);
    
        if (pDevList)
        {
            /* repopulate association table */
            for(i = 0; i < numDevices; i++, pDevList++)
            {
                /* Add to association table */
                maintainAssocTable(&pDevList->devInfo, &pDevList->capInfo, 1, 0,
                                   (false));
                /* Get the address for assigning to new devices */
                if( pDevList->devInfo.shortAddress >= Cllc_devShortAddr)
                {
                    Cllc_devShortAddr = pDevList->devInfo.shortAddress + 1;
                }
            }
        }
        else
        {
            Llc_deviceListItem_t item;
            /* repopulate association table */
            for(i = 0; i < numDevices; i++)
            {
                Csf_getDeviceItem(i, &item);
    #ifdef FEATURE_MAC_SECURITY
                /* Add device to security device table */
                Cllc_addSecDevice(item.devInfo.panID,
                                  item.devInfo.shortAddress,
                                  &item.devInfo.extAddress,
                                  item.rxFrameCounter);
    #endif /* FEATURE_MAC_SECURITY */
                /* Add to association table */
                maintainAssocTable(&item.devInfo, &item.capInfo, 1, 0,
                                   (false));
                /* Get the address for assigning to new devices */
                if( item.devInfo.shortAddress >= Cllc_devShortAddr)
                {
                    Cllc_devShortAddr = item.devInfo.shortAddress + 1;
                }
    #ifdef FEATURE_SECURE_COMMISSIONING
                {
                    /* Mark the devices that need to be re-commissioned */
                    Cllc_associated_devices_t *pExistingDevice;
                    pExistingDevice = findDevice(item.devInfo.shortAddress);
                    if((pExistingDevice != NULL)&&(!CONFIG_FH_ENABLE))
                    {
                        pExistingDevice->reCM_status = SM_CM_REQUIRED;
                        /* Do not update key refresh info here. It should be done when CM is done */
                    }
                }
    #endif
    
            }
        }
    }

    3.在 assocIndCb 中,在"新建设备,创建短地址"之后有一个更改。

    更换

            /* New device, make a new short address */
            assocRsp.status = ApiMac_assocStatus_panAccessDenied;
            devInfo.shortAddress = Cllc_numOfDevices + CLLC_ASSOC_DEVICE_STARTING_NUMBER;

    使用  

            /* New device, make a new short address */
            assocRsp.status = ApiMac_assocStatus_panAccessDenied;
            devInfo.shortAddress = Cllc_devShortAddr;
            Cllc_devShortAddr++;

    我测试了这些更改、似乎已经解决了这个问题。  

    请测试修复。  

    此致、

    SID