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.

RTOS/CC1310: SyncLoss problem on sensor example

Part Number: CC1310


Tool/software: TI-RTOS

Hi,

I am currently running a program based on the sensor example given by TI, with a collector based on the one also given by TI.

We are running in beacon mode, and I noticed a strange behavior (which I can easily follow in debug).

Say I have a sensor successfully associated to a collector in beacon mode. To simulate a sync loss, I reset the collector. Therefore, the sensor looses its synchronization to the collector, and the syncLossCb is hit in jdllc.c. Here I recall the code (given by TI) of the callback :

static void syncLossCb(ApiMac_mlmeSyncLossInd_t *pData)
{
    if(pData->reason == ApiMac_status_beaconLoss)
    {
        /* Initialize counter for re-join delay calculation */
        interimDelayTicks = Clock_getTicks();

        if((parentFound == false) && (numSyncLoss == 0)
            && (devInfoBlock.currentJdllcState == Jdllc_states_joining))
        {
            if(devInfoBlock.currentDevState != Jdllc_deviceStates_scanPassive)
            {
                switchState(Jdllc_deviceStates_scanPassive);
            }
        }
        else
        {
            /* Update stats */
            device_msgStats.syncLossIndications++;

            if(numSyncLoss == 0)
            {
                numSyncLoss++;
                parentFound = false;
                /* retry sync request */
                switchState(Jdllc_deviceStates_syncReq);
            }
            else
            {
                if(!CONFIG_RX_ON_IDLE)
                {
                    /* Stop polling */
                    Ssf_setPollClock(0);
                }

                /* set up orphan scan */
                switchState(Jdllc_deviceStates_scanOrphan);
                updateState(Jdllc_states_orphan);
            }
        }
    }
    if(macCallbacksCopy.pSyncLossIndCb != NULL)
    {
        macCallbacksCopy.pSyncLossIndCb(pData);
    }
}

Notice the numSyncLoss variable, which is 0 the first time we loose the sync. So switchState(Jdllc_deviceStates_syncReq); is executed and an ApiMac_mlmeSyncReq() is issued to the mac layer. The sync is acquired back, all is well.

However, as there is no callback triggered when the sync is acquired, the numSyncLoss variable is not set back to 0.

So, say for exemple that 2 weeks later you loose the sync for some reason, then, you go back to the syncLossCb, but as numSyncLoss is now 1, the state is now changed to orphan instead of syncReq, and a ScanInd is issued and in my case, no scanCnf is received. The sensor is then unreachable.

Is there a way to detect that a sync was acquired back and then put this numSyncLoss back to 0 ? or is it safe, in Beacon mode, to stay in syncReq and not to go in orphan mode ?

Thanks for your help.

Alex

  • Hi,

    I have tested this and I see no issue even after numSyncLoss = 1. The sensor sends an orphan notification and then the scanCnfCb is triggered letting the sensor know whether the orphan scan was successful or if there was no response. Something to take into consideration is the value of CONFIG_ORPHAN_BACKOFF_INTERVAL, this is set up to a default value of 5 minutes to save power which means that it will take 5 minutes for the sensor to trigger another scan to attempt to rejoin the network.
    If you wish your sensor to be able to rejoin faster then you should decrease the value of CONFIG_ORPHAN_BACKOFF_INTERVAL, for the test I did I used a value of 10000 which should be 10 seconds.
  • Thank you for this answer.

    I had modified the code inside the scanCnf callback that broke the orphan procedure. It's working better now, thanks a lot !