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.

CC1310: Reading ADC in Sensor and Collector Example

Part Number: CC1310

Hi guys,

I added some codes to read ADC value to sensor and collector example. I succeeded reading and sending ADC value from the sensor to collector. However, the sensor reads and sends only one time and stays freezing.

I checked the code and found out that it was stuck at a function ApiMac_processIncoming(); in sensor.c file.

void ApiMac_processIncoming(void)
{
    ICall_EntityID src;
    ICall_EntityID dest;
    macCbackEvent_t *pMsg;

    /* Wait for response message */
    if(ICall_wait(ICALL_TIMEOUT_FOREVER) == ICALL_ERRNO_SUCCESS)
    {
        /* Retrieve the response message */
        if(ICall_fetchMsg(&src, &dest, (void **)&pMsg) == ICALL_ERRNO_SUCCESS)
        {
            if(dest == ApiMac_appEntity)
            {
                if(src == macEntityID)
                {
                    /* Process the message from the MAC stack */
                    processIncomingICallMsg(pMsg);
                }
                else if(pMacCallbacks->pUnprocessedCb)
                {
                    /* Initiate the unprocessed message callback */
                    pMacCallbacks->pUnprocessedCb((uint16_t)src, 0, (void *)pMsg);
                }
            }
            if(pMsg != NULL)
            {
                ICall_freeMsg(pMsg);
            }
        }
    }
}

After reading ADC value, the program is freezing at line if(ICall_wait(ICALL_TIMEOUT_FOREVER) == ICALL_ERRNO_SUCCESS)

I have tried many ways to fix but still no solution.

Any suggest?

  • Does the issue persists if you remove the code that is reading the ADC?
    It is tough to determine what could be causing this, but I can give you some pointers to try to debug this problem.
    You could add your ADC code in the function "readSensors" and populate the tempSensor data with the ADC data instead of using the data from "Ssf_readTempSensor" and see if this also causes this issue to happen.