ZigBee Issue With FRDM-KW41Z

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ZigBee Issue With FRDM-KW41Z

Jump to solution
1,577 Views
alejandrovelez
Contributor III

Hello,

I just get two FRDM-KW41Z and tried the first examples, a Zc generic and a Zr generic

pastedImage_3.png

pastedImage_2.png

I run Zc to create nwk and permit join to let the Zc get in the nwk and works good, as packet sniffer and debug log shows:

pastedImage_9.png

Zc Log:

Button DN=2
APP-EVT: Event 2, NodeState=1 Button DN=3
APP-EVT: Event 2, NodeState=1 APP-BDB: NwkSteering Success

APP-EVT: Request Nwk Steering 00 BDB: APP_vGenCallback [0 2]
BDB: APP_vGenCallback [0 9]
APP-ZDO: New Node a2bb Has Joined BDB: APP_vGenCallback [0 1]
APP-ZDO: Data Indication Status 00 from a2bb Src Ep 0 Dst Ep 0 Profile 0000 Cluster 0013 BDB: APP_vGenCallback [0 14]
APP-ZDO: Discovery Confirm

BDB: APP_vGenCallback [0 29]
APP-ZDO: Unhandled Event 29 BDB: APP_vGenCallback [0 2]
BDB: APP_vGenCallback [0 3]
BDB: APP_vGenCallback [0 26]
APP-ZDO: Trust Center Status 00

Zr Log:

Button DN=2
ZPR: App event 2, NodeState=0 BDB: Disc on Ch 11 from 0x00000800
BDB Network Steering status 0 BDB: APP_vGenCallback [0 10]
BDB: vNsTryNwkJoin - index 0 of 1 Nwks
BDB: Try To join 0d2d24d4d0737f8b on Ch 11
APP-ZDO: Discovery Complete 00 BDB: APP_vGenCallback [0 5]
5a:69:67:42:65:65:41:6c:6c:69:61:6e:63:65:30:39:APP-ZDO: Joined Network Addr a2bb Rejoin 0 BDB: BDB_vNsTimerCb 1

vNsStartTclk

BDB: APP_vGenCallback [0 2]
BDB: APP_vGenCallback [0 3]
BDB: APP_vGenCallback [0 1]
BDB: r21 Trust Center

APP-ZDO: Data Indication Status 00 from 0000 Src Ep Dst 0 Ep 0 Profile 0000 Cluster 8002 BDB: APP_vGenCallback [0 26]
ZPS_EVENT_TC_STATUS Success

01:e8:a7:bc:20:a1:11:e1:13:63:1e:f5:8d:08:24:39:

Nwk Join Success

APP: NwkSteering Success

APP-ZDO: Trust Center Status 00 BDB: APP_vGenCallback [0 2]

But if I re-program the Zr with simple changes or no changes at all, it cann't rejoin to network unless I factory reset the Zc.

After re-program the Zr can't rejoin the nwk even the Zc debug log says its connected. The Zr debug log says that has failed to rejoin and the packet sniffer shows the transport key but seems like Zr don't get it:

pastedImage_4.png

Zc Log:

$ Button DN=3
APP-EVT: Event 2, NodeState=1 APP-BDB: NwkSteering Success

APP-EVT: Request Nwk Steering 00 BDB: APP_vGenCallback [0 2]
BDB: APP_vGenCallback [0 9]
APP-ZDO: New Node e511 Has Joined BDB: APP_vGenCallback [0 9]
APP-ZDO: New Node e511 Has Joined BDB: APP_vGenCallback [0 9]
APP-ZDO: New Node 3f4f Has Joined BDB: APP_vGenCallback [0 9]
APP-ZDO: New Node 3f4f Has Joined

Zr Log:

Button DN=2
ZPR: App event 2, NodeState=0 BDB: Disc on Ch 11 from 0x00000800
BDB Network Steering status 0 BDB: APP_vGenCallback [0 10]
BDB: vNsTryNwkJoin - index 0 of 1 Nwks
BDB: Try To join 0d2d24d4d0737f8b on Ch 11
APP-ZDO: Discovery Complete 00 BDB: APP_vGenCallback [0 8]
FailedToJoin sNwkJoinFailedEvent.u8Status=173 !!!
BDB: vNsTryNwkJoin - index 0 of 1 Nwks
BDB: Try To join 0d2d24d4d0737f8b on Ch 11
APP-ZDO: Failed To Join ad Rejoin 0 BDB: APP_vGenCallback [0 8]
FailedToJoin sNwkJoinFailedEvent.u8Status=173 !!!
BDB: vNsTryNwkJoin - index 0 of 1 Nwks
 BDB: No suitable network! Continue Discovery

APP: BDB No Networks

APP-ZDO: Failed To Join ad Rejoin 0

Hope you can help me to solve this issue, thanks

1 Solution
1,275 Views
jc_pacheco
NXP Employee
NXP Employee

Hi Alejandro,

I think the issue you mention is caused by the fact that the NWK_Leave command was not received by the ZC (Trust Center) and as a result it sends the Transport Key command encrypted with the APS Link Key established during the previous join process. The associating device no longer has this key since it was reprogrammed and it will be unable to decrypt the Transport Key command. When a ZC receives a NWK_Leave command from a device it will erase the unique APS Link Key for that device, but it doesn't happen in this case.

This is a feature that may be controlled through the BDB_SET_DEFAULT_TC_POLICY macro (bdb_options.h).

Setting BDB_SET_DEFAULT_TC_POLICY to TRUE will cause a Trust Center to send the Transport Key command encrypted with the Default Trust Center Link Key in case of an unsecured join (association) even if an unique link key already exists for that device.

Hope this helps.

-JC

View solution in original post

4 Replies
1,276 Views
jc_pacheco
NXP Employee
NXP Employee

Hi Alejandro,

I think the issue you mention is caused by the fact that the NWK_Leave command was not received by the ZC (Trust Center) and as a result it sends the Transport Key command encrypted with the APS Link Key established during the previous join process. The associating device no longer has this key since it was reprogrammed and it will be unable to decrypt the Transport Key command. When a ZC receives a NWK_Leave command from a device it will erase the unique APS Link Key for that device, but it doesn't happen in this case.

This is a feature that may be controlled through the BDB_SET_DEFAULT_TC_POLICY macro (bdb_options.h).

Setting BDB_SET_DEFAULT_TC_POLICY to TRUE will cause a Trust Center to send the Transport Key command encrypted with the Default Trust Center Link Key in case of an unsecured join (association) even if an unique link key already exists for that device.

Hope this helps.

-JC

1,275 Views
alejandrovelez
Contributor III

Hello Juan Carlos,

Can you help me again with another issue from another example?

This is de dimmable switch, it works fine until a leave the nwk holding the switch button, then i try to rejoin again and get this:

pastedImage_1.png

looks like it rejoins but  the end device never connects again to network until i reprogram it.

Thanks

0 Kudos
1,275 Views
jc_pacheco
NXP Employee
NXP Employee

Hi Alejandro,

I can reproduce the issue and I'll report it to the software team for resolution in maintenance release.

Meanwhile, please modify the APP_vFactoryResetRecords() function as follows:

PUBLIC void APP_vFactoryResetRecords( void)
{
    /* clear out the stack */
    ZPS_vDefaultStack();
    (void)ZPS_eAplAibSetApsUseExtendedPanId(ZPS_APS_AIB_INIT_USE_EXTENDED_PANID);

    ZPS_vSaveAllZpsRecords();
    ZPS_vSetKeys();

    /* clear out the application */
    DBG_vPrintf(TRACE_SWITCH_NODE, "vFactoryResetRecords: eNodeState = E_STARTUP\r\n");
    sDeviceDesc.eNodeState = E_STARTUP;

    FLib_MemSet(&sDeviceInfo, 0 , sizeof(tsDeviceInfo));

#ifdef CLD_OTA
    vOTAResetPersist();
#endif

    /* save everything */
    PDM_eSaveRecordData(PDM_ID_APP_ZLO_SWITCH,
                            &sDeviceDesc,
                            sizeof(tsDeviceDesc));
    //ZPS_vSaveAllZpsRecords();
#ifdef CPU_MKW41Z512VHT4
    NvCompletePendingOperations();
#endif
}

-JC

1,275 Views
alejandrovelez
Contributor III

Thanks Juan Carlos,

Your answer really helped me out

0 Kudos