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.

Association Response is not been sent

Other Parts Discussed in Thread: CC2530, TIMAC, CC2650, Z-STACK

I wrote script with MT commands to enable basic configuration to set CC2530 as coordinator.

I am trying to associate end device (other CC2530 with Normal-RFD image) to CC2530 with MT-enabled image. For this purpose I've wrote a Z-Tool script mt-bringup.zip with corresponding MT commands for starting coordinator and real-time response to Association Request. However, I get next output in Z-Tool window:

<RX>04:43:45.48 COM15 ZMAC_ASSOCIATE_IND (0x4281)
DeviceExtendedAddress: .E...K.. (0x9B, 0x45, 0x0C, 0x06, 0x00, 0x4B, 0x12, 0x00)
Capabilities: 0x88
KeySource: ........ (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
SecurityLevel: 0x00 (NO_SECURITY) (0x0)
KeyIdMode: 0x00 (NOT_USED) (0x0)
KeyIndex: 0x00

<TX>04:43:45.48 COM15 ZMAC_ASSOCIATE_RSP (0x4250)
ExtAddr: ..K.@.U. (0x00, 0x12, 0x4B, 0x00, 0x40, 0x9B, 0x55, 0x87)
AssocShortAddress: 0x0001
AssocStatus: 0x00 (SUCCESSFUL_ASSOCIATION) (0x0)
KeySource: ........ (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
SecurityLevel: 0x00 (NO_SECURITY) (0x0)
KeyIdMode: 0x00 (NOT_USED) (0x0)
KeyIndex: 0x00

<RX>04:43:45.49 COM15 ZMAC_ASSOCIATE_RSP_RESPONSE (0x6250)
Status: SUCCESS (0x0)

*** WARNING ***
Unsupported or unformatted message received. Raw data:
0C 42 91 03 00 12 4B 00 06 0C 45 9B CC 11 00

<RX>04:43:53.35 COM15 ZMAC_COMM_STATUS_IND (0x428D)
Status: ZMAC_TRANSACTION_EXPIRED (0xF0)
SrcAddrMode: 0x02 (ADDRESS_16_BIT) (0x2)
SrcAddr: ........ (0xAA, 0xBB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
DstAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
DstAddr: ..K.@.U. (0x00, 0x12, 0x4B, 0x00, 0x40, 0x9B, 0x55, 0x87)
DevicePanID: 0x11CC
Reason: 0x00
KeySource: ........ (0xFF, 0xCC, 0x11, 0x00, 0x00, 0x03, 0x05, 0x00)
SecurityLevel: 0x00 (NO_SECURITY) (0x0)
KeyIdMode: 193 (0xC1)
KeyIndex: 0x03

Warning "Unsupported or unformatted message received" corresponds to Data request from end device.

In RF media it look the next way:


For comparison, in case of setup with samples Normal-FFD and Normal-RFD problem doesn't exist and association is successful:

How to interpret ZMAC_TRANSACTION_EXPIRED in this case and how to fix this issue?

  • What ZNP image do you download to your CC2530?
  • It is actually TIMAC image from "C:\Texas Instruments\TIMAC 1.5.2.43299\Projects\mac\MAC-coP\CC253x\images\MACcoP-cc2530.hex"
  • Hi,

    pahanela said:
    *** WARNING ***
    Unsupported or unformatted message received. Raw data:
    0C 42 91 03 00 12 4B 00 06 0C 45 9B CC 11 00

    This command is not listed anywhere in the documentation (ZNP or Ti-MAC CoP).

    By looking inside the code, I found the all the codes.

    0x42 corresponds to a MAC command.

    0x91 corresponds to POLL_IND

    This is what the coordinator would receive from a device to request data. (I presume that the Data Request message that follows the association request is the POLL_IND)

    What I am surprised about is that the Z-tool doesn't seem to recognize that command.

    I am not sure about this, but I think that you might be replying with the association response too soon. Can you try sending your response after you received the POLL_IND message (in the log above, the association response is sent before the POLL_IND)

    My guess is that there some sort of state machine that checks in which state you are in and when you send the response too soon, it might change state and cause the error.

    , can you confirm that I am on the right track?

    Michel

  • Unfortunately, Z-Tool doesn't pass through this POLL_IND to the script layer, so I am not able to trigger sending Association Response explicitly on this event. I tried to play with delay of sending Association Response in reference to MAC_ASSOCIATE_IND, tried different options from immediate to 500 ms (before POLL_IND and after), but result is the same. In the end I get ZMAC_COMM_STATUS_IND with ZMAC_TRANSACTION_EXPIRED status. Shouldn't it be buffered by stack and sent to the polling device upon receiving Data Request?

    I can write some desktop application for real-time work with raw serial data, however, I don't think that it will change something. Seems like problem is happening at some of the lower layers.
  • Hey, so I am using the ZNP on the CC2650 with a custom script. I think the data request he is seeing is the a poll / ping to make so the ED knows that the coordinator is still there. I know that once my end device is connected you see data requests being sent (though as far as I know it doesn't get passed up through the script). 

    This is the sequence of requests that hit my script. 


    <RX>01:31:56.55 COM15 ZDO_END_DEVICE_ANNCE_IND (0x45C1)
    SrcAddr: 0x61AE
    NwkAddr: 0x61AE
    IEEEAddr: 0x00124B000802BD80
    Capabilities: 0x80
    TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND
    ZDO_END_DEVICE_ANNCE_IND
    BindActions = 0
    BindNums = 0
    CoordIEEE = 5149013082203265
    ZDO Bind REQUEST SEND TO COM15

    <TX>01:31:56.55 COM15 ZDO_BIND_REQ (0x2521)
    DstAddr: 0x61AE
    SrcAddress: 0x00124B000802BD80
    SrcEndpoint: 0x0C
    ClusterID: 0xFDB0
    BindAddrMode: 0x03 (ADDRESS_64_BIT) (0x3)
    BindAddr: .d...K.. (0x81, 0x64, 0xB5, 0x07, 0x00, 0x4B, 0x12, 0x00)
    BindEndpoint: 0x07

    <RX>01:31:56.71 COM15 ZDO_BIND_REQ_SRSP (0x6521)
    Status: afStatus_SUCCESS (0x0)
    TI.ZPI2.ZDO_BIND_REQ_SRSP
    ZDO_END_DEVICE_ANNCE_IND

    <RX>01:32:01.83 COM15 ZDO_BIND_RSP (0x45A1)
    SrcAddr: 0x61AE
    Status: ZDP_SUCCESS (0x0)
    TI.ZPI2.ZDO_BIND_RSP
    ZDO_END_DEVICE_ANNCE_IND


    Here is the corresponding sniffer info:

    Let me know if you want me to post my script, I just don't know how useful it will be as it seems like he is using MAC layer commands instead of ZDO and it's kinda messy as it was a proof of concept more than a finished product. 

  • Hi Kent,
    Thanks for looking into this.
    We do not need the whole script, but could we at least have to the init and join portion of the script?
    I'm sure there will be extra stuff that won't be related to TI-MAC but it might give us some hints as to what we are missing here.
    Thanks again,
    Michel
  • //set up clusters for light
    inClusterList[0] = 0;
    inClusterList[1] = 3;
    inClusterList[2] = 4;
    inClusterList[3] = 5;
    inClusterList[4] = 64937; // Changed from 6
    inClusterList[5] = 1026; // Changed from 6
    inClusterList[6] = 64944; // For CFG
    inClusterList[7] = 64945; // For Func

    outClusterList[0] = 0;

    // Subscribe to the incoming message handler.
    ZEngine.add_OnMessageZPI2(this.msgHandler);

    if (ZNP_RUN) {

    // Force a device out of the boot loader wait routine (no bad effect when SBL is not present).
    var TEMP_COM = "COM";
    for (var i = 0; i < 30; i++) {
    try {
    sysReset(TEMP_COM + i.toString());
    ZC_Com = TEMP_COM + i.toString();
    break;
    } catch (e) {
    continue;
    }
    }
    sysReset(ZC_Com);

    // Set the Startup_Option to Clear Configuration and reset to effect the action.
    cfgArr[0] = NV_STARTUP_OPTION_VAL;
    writeCfg(ZC_Com, NV_STARTUP_OPTION, NV_STARTUP_LEN, cfgArr);
    sysReset(ZC_Com);

    // Setup the device type, panId & channel mask and reset to effect the settings.

    cfgArr[0] = 0x00; // Set Logical Device Type to ZC.

    //writeCfg(ZC_Com, 0x87, 0x01, cfgArr);
    //cfgArr[0] = 0x01; // Set Logical Device Type to ZR.


    writeCfg(ZC_Com, 0x87, 0x01, cfgArr);
    cfgArr[0] = 0x22;
    cfgArr[1] = 0x06; // Set Pan Id to 0x0622 // Change this to anything you need to test

    //writeCfg(ZC_Com, 0x83, 0x02, cfgArr);

    writeCfg(ZC_Com, 0x83, 0x02, cfgArr);
    cfgArr[0] = 0x00; // Last two numbers in the sequence
    cfgArr[1] = 0x00;
    cfgArr[2] = 0x02;
    cfgArr[3] = 0x00; //First two numbers in the sequence
    //-DDEFAULT_CHANLIST=0x00020000 // 17 - 0x11


    writeCfg(ZC_Com, 0x84, 0x04, cfgArr);
    cfgArr[0] = 0xAA;
    cfgArr[1] = 0xBB;
    //writeCfg(ZC_Com,0x62, 16, cfgArr); //program the NWK Key 1st two bytes are AA and BB
    // Start the devices on the network.
    //startReq(ZC_Com);

    cfgArr[0] = true;
    writeCfg(ZC_Com, 0x8F, 0x01, cfgArr); // Set ZCD_NV_ZDO_DIRECT_CB to true. ZCD_NV_ZDO_DIRECT_CB address = 0x8F
    afReg(ZC_Com); // define end point
    startReq(ZC_Com);

    ZdoIEEE(ZC_Com, 0, 0, 0);

    while (1) {

    ReadLog();
    ZEngine.Pause(3000);
    //wait for incoming messages

    }


    }

    ZEngine.Complete(true);
    }


    Here is the message handler:

    // Handler for incoming messages.

    /// MESSAGE HANDLER MODIFIED BY JOSHUA

    // ADDED HANDLER FOR END DEVICE ANNOUNCEMENT TO AUTO BIND

    //
    function msgHandler(comm: String, id: MESSAGE_ID, msg: Object) {

    logMsg("" + msg);
    logMsg("" + MESSAGE_ID.ZDO_END_DEVICE_ANNCE_IND);


    switch (id) {
    case MESSAGE_ID.ZDO_END_DEVICE_ANNCE_IND:
    {
    //Request IEEE from Coordinator CUZ I NEED DAT ***

    //ZdoIEEE(comm,0,0,0);

    var zdoendind: ZDO_END_DEVICE_ANNCE_IND = msg;

    if( (zdoendind.Capabilities & 2) != 2){
    //Check the binding table. Pray to God this is the only thing youre auto binding
    logMsg("BindActions = " + BindActions);
    logMsg("BindNums = " + BindNums);
    logMsg("CoordIEEE = " + CoordIEEE);
    //if (BindActions <= BindNums && CoordIEEE != 0){
    //Send the bind request accordingly
    var bindreq: ZDO_BIND_REQ = new ZDO_BIND_REQ();
    //For Now we are binding the CFG EP automatically
    bindreq.DstAddr = zdoendind.NwkAddr;
    bindreq.SrcAddress = zdoendind.IEEEAddr;
    bindreq.SrcEndpoint = CFGEP;
    bindreq.ClusterID = CFGCID;
    bindreq.BindAddrMode = 0x03;
    //reverse byte array to little endian
    if (CoordByteArr != 0) {
    var littleendarr = new Array(8);
    var i;
    var j;
    for (i = 0, j = 7; i < 8; i++, j--) {

    littleendarr[i] = CoordByteArr[i];


    }
    bindreq.BindAddr = littleendarr.slice();
    } else {

    bindreq.BindAddr = StatCoordAddrArr;

    }

    bindreq.BindEndpoint = COORDEP;


    logMsg("ZDO Bind REQUEST SEND TO " + comm);
    ZEngine.Send(comm, bindreq);
    ZEngine.Pause(200);
    lastBindReqSent = bindreq;
    BindActions++;

    //}
    }
    SaveLog(id,msg);
    break;

    }

    case MESSAGE_ID.ZDO_IEEE_ADDR_RSP:
    {
    var zdoieee: ZDO_IEEE_ADDR_RSP = msg;

    if (zdoieee.Status == 0) {

    CoordIEEE = zdoieee.IEEEAddr;

    if (CoordIEEE != 0) {
    //If successful read. Parse Ulong into bytes
    var coordarr = parseFloat(CoordIEEE);
    for (var k = 0; k < 8; k++) {
    CoordByteArr[k] = coordarr & (255);
    coordarr = coordarr / 256;

    }

    }
    }
    //
    SaveLog(id,msg);
    gotIEEERsp = true;

    break;
    }

    //Update the number of Binding Entries when 1 gets added
    case MESSAGE_ID.ZDO_BIND_RSP:
    {
    var zdobindrsp: ZDO_BIND_RSP = msg;

    if (zdobindrsp.Status == 0) {
    BindNums++;
    }
    else{
    ZEngine.Send(comm, lastBindReqSent);
    }
    SaveLog(id,msg);
    break;

    }
    //Update the number of Binding Entries when 1 gets removed
    case MESSAGE_ID.ZDO_UNBIND_RSP:
    {
    var zdounbindrsp: ZDO_UNBIND_RSP = msg;

    if (zdounbindrsp.Status == 0) {
    BindNums--;
    BindActions--;
    }
    SaveLog(id,msg);
    break;

    }


    case MESSAGE_ID.SYS_RESET_RESPONSE:
    {
    gotRstRsp = true;
    SaveLog(id,msg);
    break;
    }
    case MESSAGE_ID.UTIL_GET_DEVICE_INFO_RESPONSE:
    {
    var devRsp: UTIL_GET_DEVICE_INFO_RESPONSE = msg;
    if (devRsp.Status == SUCCESS && devRsp.NumAssocDevices != 0) {
    gotDevRsp = true;
    devaddr = devRsp.AssocDevicesList[0];
    }
    SaveLog(id,msg);
    break;
    }
    case MESSAGE_ID.ZDO_ACTIVE_EP_RSP:
    {
    var epRsp: ZDO_ACTIVE_EP_RSP = msg;
    if (epRsp.Status == SUCCESS && epRsp.ActiveEPCount != 0) {
    gotEpRsp = true;
    dstEndPoint = epRsp.ActiveEPList[0];
    }


    break;
    }

    case MESSAGE_ID.ZDO_SIMPLE_DESC_RSP:
    /*change*/
    {
    var smpdRsp: ZDO_SIMPLE_DESC_RSP = msg;
    if (smpdRsp.Status == SUCCESS && smpdRsp.ProfileID == HOMEAUT && smpdRsp.DeviceID == LIGHT) {
    gotSdescRsp = true;
    isLight = true;
    }


    break;
    }

    case MESSAGE_ID.ZB_WRITE_CONFIGURATION_RSP:
    {
    var cfgRsp: ZB_WRITE_CONFIGURATION_RSP = msg;

    if (cfgRsp.Status == SUCCESS) {
    gotCfgRsp = true;
    }
    break;
    }

    case MESSAGE_ID.AF_REGISTER_SRSP:
    {
    var regRsp: AF_REGISTER_SRSP = msg;

    if (regRsp.Status == SUCCESS) {
    gotRegRsp = true;
    }
    break;
    }

    case MESSAGE_ID.ZB_START_REQUEST_RSP:
    {
    gotStartRsp = true;
    break;
    }

    case MESSAGE_ID.ZDO_STATE_CHANGE_IND:
    {
    var zdoStateInd: ZDO_STATE_CHANGE_IND = msg;

    // { DEV_END_DEVICE, DEV_ROUTER, DEV_ZB_COORD } : { 6, 7, 9 }
    if ((zdoStateInd.State == 6) || (zdoStateInd.State == 7) || (zdoStateInd.State == 9)) {
    gotStateRsp = true;
    }
    break;
    }

    case MESSAGE_ID.AF_DATA_REQUEST_EXT_SRSP:
    {
    var afRegExtRsp: AF_DATA_REQUEST_EXT_SRSP = msg;

    if (afRegExtRsp.Status == SUCCESS) {
    gotAfReqExtRsp = true;
    }
    break;
    }

    case MESSAGE_ID.AF_DATA_STORE_SRSP:
    {
    var afStoreRsp: AF_DATA_STORE_SRSP = msg;

    if (afStoreRsp.Status == SUCCESS) {
    gotAfStoreRsp = true;
    }
    break;
    }

    case MESSAGE_ID.AF_INCOMING_MSG_EXT:
    {
    var afIncExt: AF_INCOMING_MSG_EXT = msg;
    afDataRetrieve(comm, msg);
    gotAfIncExt = true;
    break;
    }

    case MESSAGE_ID.AF_INCOMING_MSG:
    {
    var inMsgDat: AF_INCOMING_MSG = msg;
    imGroup = inMsgDat.GroupID;
    imCluster = inMsgDat.ClusterID;
    imSrcAddr = inMsgDat.SrcAddr;
    imSrcEndp = inMsgDat.SrcEndpoint;
    imDstEndp = inMsgDat.DstEndpoint;
    imLen = inMsgDat.Len;
    for (var idx = 0; idx < imLen; idx++) {
    imData[idx] = inMsgDat.Data[idx];
    }
    SaveLog(id,msg);
    pInMsg(comm);

    break;
    }
    case MESSAGE_ID.MT_ZDO_MSG_CB_INCOMING: {

    SaveLog(id,msg);

    break;

    }
    case MESSAGE_ID.AF_DATA_RETRIEVE_SRSP:
    {
    var afRetrieveRsp: AF_DATA_RETRIEVE_SRSP = msg;

    if (afRetrieveRsp.Status == SUCCESS) {
    var index = retrieveIdx;

    for (var idx = 0; idx < afRetrieveRsp.Length; idx++, index++) {
    retrieveBuf[index] = afRetrieveRsp.Data[idx];
    }

    gotAfRetrieveRsp = true;
    }
    break;
    }

    default:
    break;
    }

    }

    ************** ADDITIONAL FUNCTION **********


    // Send a process incoming message.
    function pInMsg(comm: String) {
    if (imData[0] == 1) {
    if (imData[2] == 2) {
    lightStatus = (~lightStatus) & 0x01; //toggle light
    } else if (imData[2] == 1) {
    lightStatus = 0x01; // light ON
    } else if (imData[2] == 0) {
    lightStatus = 0x00; //light OFF
    }
    }
    if ((imData[0] & 0x01) == 0 && imData[2] == 0) //read attribute
    {
    if (imData[0] == 0 && imData[2] == 0) {
    setDataReq(3);
    afDataReq(comm, imSrcAddr, imSrcEndp); //send read attribute response
    }
    } else if ((imData[0] & 0x10) == 0) //Default response active
    {
    setDataReq(1);
    afDataReq(comm, imSrcAddr, imSrcEndp); // send default response
    }


    }

    Hopefully that helps. Let me know if there are any other functions you see here that you want me to post.

  • Hi Kent,
    This is a different story. You are doing ZigBee and binding, which requires NWK and ZDO layers. However, I am doing plain IEEE 802.15.4 and my current problem is association. Probably in your case association is handled by lower layers without passing it through to the application.

    By the way, I've reached successful association with different MAC image compiled from project "C:\Texas Instruments\TIMAC 1.5.2.43299\Projects\mac\Sample\cc2530\IAR Project\msa_cc2530.eww". But now I have a challenge with getting UART work as it doesn't contain MT subsystem, what is off-topic.

    TIMAC coP is preferable for my case as it allows to decouple application and stack layers and encapsulate internals behind convenient API. So I keep this topic open, in case somebody is willing to help and has idea how to solve problem.
  • Hi,

    I asked Kent for help since he had successfully connected with the ZNP (TI-MAC but with the Z-stack on top).

    I was hoping that it could shed some light as to why it wasn't working on our side.

    Have you tried connecting the Mac CoP device with a RFD device (in the sample application, select RFD in the configuration)?

    I'm hoping that can look at this case since I have run out of ideas and he knows a lot more than me about wireless connectivity.

    Michel

  • Hi Michel,

    I understand. Regarding your request, this is exactly what I am trying to do and where getting failure. Please, check my initial post.
  • ,
    Any ideas how to proceed here?