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.

CC2538: How to Set LinkKey in ZNP Host Framework Application?

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK, TIDC-ZNP-HOST-SW3, Z-STACK-ARCHIVE, CC2592

Hello E2E Community,

I am trying to Set the Link Key for the ZNP device uising the uint8_t zdoSetLinkKey(SetLinkKeyFormat_t *req) function in znp host framework application.

Params :

    ShortAddr           : 0x0000                                                                           (short addr of the znp device) 
    IEEEaddr[8]        : 0x00124B00193C4192                                                  (ieee addr of the znp device) 
    LinkKeyData[16] : 5A:69:67:42:65:65:41:6C:6C:69:61:6E:63:65:30:39      (default zigbee link key "ZigBeeAlliance09")

I am getting the following response for the ZNP device (CC2538) 

[2020-01-08T17:33:33.3+05:30][INFO]-    SOC OUT --> LEN :1A, SOF :FE, CMD0 :25, CMD1 :23, Payload :00:00:00:12:4B:00:19:3C:41:92:5A:69:67:42:65:65:41:6C:6C:69:61:6E:63:65:30:39, FCS :8D
[2020-01-08T17:33:33.307+05:30][ERROR]- rpcProcess: UNEXPECTED SREQ!: 05(null):60(null)
[2020-01-08T17:33:33.307+05:30][INFO]-  SOC IN  <-- LEN :03, SOF :FE, CMD0 :60, CMD1 :00, Payload :02:25:23, FCS :67
[2020-01-08T17:33:33.435+05:30][INFO]-  SOC IN  <-- LEN :03, SOF :FE, CMD0 :4F, CMD1 :80, Payload :03, FCS :C6
[2020-01-08T17:33:35+05:30][INFO]-      zdoSetLinkKey : SetLinkKey[8] failed
[2020-01-08T17:33:35+05:30][ERROR]-     rpcSendFrame: SRSP Error

I have also tested the same command using default ZNP Host Framework application, Logs are as follows, (the application will crashed after processing this command)

Enter CMD
ZDO_SET_LINK_KEY

Command: ZDO_SET_LINK_KEY
Enter ShortAddr: (2B)
0x0000
Enter IEEEaddr: (8B)
0x00124B00193C4192
Enter LinkKeyData: (16B)
0x5A6967426565416C6C69616E63653039
rpcSendFrame: Blocking on RPC sem
rpcSendFrame: Sending RPC
rpcTransportWrite : len = 31
writing 8 bytes (offset = 0, remain = 31)
writing 8 bytes (offset = 8, remain = 23)
writing 8 bytes (offset = 16, remain = 15)
writing 7 bytes (offset = 24, remain = 7)
SOC OUT --> 31 Bytes: SOF:FE, Len:1A, CMD0:25, CMD1:23, Payload:00:00:41:3C:19:00:4B:12:00:00:30:65:63:6E:61:69:6C:6C:41:65:65:42:67:69:5A:00, FCS:26
rpcSendFrame: waiting for SRSP [05]
rpcTransportRead: read 1 bytes
rpcTransportRead: read 1 bytes
rpcTransportRead: read 6 bytes
SOC IN  <-- 8 Bytes: SOF:FE, Len:03, CMD0:60, CMD1:00, Payload:02:25:23, FCS:67
Segmentation fault
root@XXXXXXXXXXXX:/home/XXXXX/znp-host-framework-master/examples/cmdLine/build/gnu# ./cmdLine.bin /dev/serial0

Will you please help me to know,

Am I doing any this wrong?

How do I set the Link key for a ZNP device to add the other devices in network using the link key?

 

Regards,

Shiv Patil.