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.

CCS/LAUNCHXL-CC1352R1: Non-concurrent Zigbee and Subghz

Part Number: LAUNCHXL-CC1352R1

Tool/software: Code Composer Studio

Hi TI Support Team,

I am trying to create a program that will let me run zigbee and subghz activities on a non-concurrent basis.

I was looking for the function that will let me pause the Zigbee (or abort any zigbee activities) and I found this code from the pauseCallback of the DMM example zigbee and ble.

Zstackapi_pauseResumeDeviceReq

zstack_pauseResumeDeviceReq_t zstack_pauseResumeDeviceReq;
    zstack_pauseResumeDeviceReq.pause = true;
    return Zstackapi_pauseResumeDeviceReq(appServiceTaskId,
                                   &zstack_pauseResumeDeviceReq);


But then everytime I manually trigger these line of codes, it causes the system to hang.
I tried to track on where did it go wrong inside the
Zstackapi_pauseResumeDeviceReq()

and I found out that this line of code (see below code at line 40) is not changing its value to true that is causing the whole function to be trapped inside a while loop

static zstack_ZStatusValues sendReqDefaultRsp(uint8_t appServiceTaskId,
                                              zstack_CmdIDs cmdID, void *pReq,
                                              int msgSize)
{
    zstack_ZStatusValues status = zstack_ZStatusValues_ZMemError;
    uint8_t msgStatus;

    //Make sure allocate space enought for the msg, even
    //if the message does not have payload
    if(msgSize < sizeof(zstackmsg_genericReq_t))
    {
      msgSize = sizeof(zstackmsg_genericReq_t);
    }

    zstackmsg_genericReq_t *pMsg =
        (zstackmsg_genericReq_t *)OsalPort_msgAllocate(msgSize);

    // Make sure the allocation was successful
    if(pMsg != NULL)
    {
        // Fill in the message header
        pMsg->hdr.event = cmdID;
        pMsg->hdr.status = 0;
        pMsg->hdr.srcServiceTask = appServiceTaskId;

        // Update the messges's request field
        pMsg->pReq = pReq;

        // Send the message
        msgStatus = OsalPort_msgSend( stackServiceTaskId, (uint8_t*) pMsg );

        // Was the message sent successfully
        if(msgStatus == OsalPort_SUCCESS)
        {
            bool gotRsp = false;

            // Return status
            zstackmsg_genericReq_t *pCmdStatus = NULL;

            while(!gotRsp)
            {
                // Wait for the response message
                OsalPort_blockOnEvent(Task_self());

                pCmdStatus = (zstackmsg_genericReq_t*)OsalPort_msgFindDequeue(appServiceTaskId, pMsg->hdr.event);

                if(pCmdStatus)
                {
                  gotRsp = true;
                }

            }

             // setup return of
            status = (zstack_ZStatusValues)pCmdStatus->hdr.status;
        }

        // pCmdStatus is the same as pMsg
        OsalPort_msgDeallocate( (uint8_t*)pMsg);
    }

    // function status
    return(status);
}


Is there any use case example for the command

Zstackapi_pauseResumeDeviceReq

I am hoping that your team could help me with this matter.

Thank you,
Jonathan

  • Hi,

    Have you confirmed that the device hangs in that loop?

    This is waiting for the zstacktask to return a value indicating the status of this command. You can see how the zstacktask handles this command in function processPauseResumeDeviceReq (<project>/software_stacks/zstack/stack_task/zstacktask.c). It should essentially pause the Zigbee stack so that the radio is available.

    Please search the Zigbee application (<project>/application/zed_switch/zcl_samplesw.c) for the macro DMM_OAD, which when enabled, utilizes Zstackapi_pauseResumeDeviceReq.

    Regards,
    Toby

  • Hi Toby,

    I have seen the usage of pause command of zigbee, Zstackapi_pauseResumeDeviceReq(), at the DMM_OAD examples but I still don't understand why when I call this command manually, it blocks and never proceed the code below it.

    Does this command wait for unpause or resume  command for it to unblock and proceed to its below codes?

  • Looking at the code, I don't see a reason why the function sendReqDefaultRsp would hang in the loop. It is waiting for a response from the zstacktask (see function ZStackTaskProcessEvent).

    Can you try debugging in function processPauseResumeDeviceReq ?