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.

zigbee clear network NV info for CC2630

Other Parts Discussed in Thread: CC2650, CC2531, Z-STACK

hi all,

i need to remove the network state in NV flash .

now ,i try to level the network and retry into new network .(as follow code)

but that can't  join another network ,

that should i only leave ,not remove all network state in NV flash. 

A.

i only see it at zstackCore project  (ZDOInitDevice @ ZDApp.c) .

but it need HAL_KEY and HalKeyRead define , 

i find it in c:\ti\simplelink\zstack_home_1_02_02a_44539\Components\hal\target\CC2650\hal_key.c 

in  HalKeyRead function ,that use 

if(!(GPIOPinRead(BTN_PORT_R, HAL_BTN_R) & HAL_BTN_R)) to read GPIO status ,but it should be CC2531/8 not CC2650

B.i see the (Z-Stack TI-RTOS API Revision 42527 ) no think about it. 

it is Zstackapi_sysConfigWriteReq () to do it ?how to do it?(remove network state)

e2e.ti.com/.../1557567

static void SensorTagApp_resetNVErase(void)
{
zstack_zdoMgmtLeaveReq_t leaveReq;
zstack_sysNwkInfoReadRsp_t *nwkInfo;
nwkInfo = zclport_getDeviceInfo(zswEntity);
memcpy(leaveReq.deviceAddress, nwkInfo->ieeeAddr,
EXTADDR_LEN);
leaveReq.nwkAddr = nwkInfo->nwkAddr;
leaveReq.options.rejoin = false;
leaveReq.options.removeChildren = true;
Zstackapi_ZdoMgmtLeaveReq( zswEntity, &leaveReq);

zstack_sysResetReq_t restReq;
restReq.type = zstack_ResetTypes_DEVICE;
restReq.newNwkState = true;
(void)Zstackapi_sysResetReq(zswEntity, &restReq);

zstack_devStartReq_t startReq = {0};
// Start the ZStack Thread
startReq.startDelay = 0;
(void)Zstackapi_DevStartReq(zswEntity, &startReq);

}

ps:

Ti zigbee SDK :

zstack_home_1_02_02a_44539

define symbol:

ZSTACK_MANUAL_START
ZCL_READ
ZCL_WRITE
ZCL_BASIC
ZCL_ON_OFF
ZCL_IDENTIFY
xZCL_EZMODE
xZCL_GROUPS
xZCL_SCENES
ZCL_STANDALONE
ZG_SECURE_ENABLED
ewarm
USE_ICALL
HEAPMGR_SIZE=4096
ICALL_HOOK_ABORT_FUNC=halAssertHandler
xdc_runtime_Log_DISABLE_ALL
xdc_runtime_Assert_DISABLE_ALL
MODULE_CC26XX_5X5
POWER_SAVING

Zcode :

MODULE_CC26XX_5X5
xZDO_API_ADVANCED
ZDO_API_BASIC
CC26XX
FLASH_ROM_BUILD
USE_ICALL
TC_LINKKEY_JOIN
HAL_ASSERT_SPIN
xHALNODEBUG
xDEBUG
xDEBUG_SW_TRACE
xDBG_ENABLE
OAD_KEEP_NV_PAGES
NV_RESTORE
NV_INIT
FEATURE_MAC_SECURITY
FEATURE_GREEN_POWER
FEATURE_ENHANCED_BEACON
xHOLD_AUTO_START
ewarm
NEAR_FUNC=
DATA=

  • Try to start a delay event about 3 seconds later to call Zstackapi_sysResetReq after you call Zstackapi_ZdoMgmtLeaveReq. There is no need to call Zstackapi_DevStartReq right after Zstackapi_sysResetReq.
  • hi ,
    thank you,
    i try some case about this. have some issue with it .
    can you get me a Suggest about it.
    (ED :end device ; CO 1/2 :coord 1 and 2)

    1.
    A.to do ED bind with CO1 .
    B. to do level and sysResetReq, wait it complete
    C.then close CO1
    C. open CO2 and ED ,that is ok.

    2.
    A.to do ED bind with CO1 .
    B. close the CO1,and the ED go to orphan
    C.open CO2 , then ED do level and sysResetReq
    (that not success join new network.)
    D.reset ED ,it will OK.

    in my case 2, it is issue ?
  • If you don't do reset, I think the NV data won't be clear up in ZStackCore.