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/CC1310: The CMD_FS command fails in CC1310 High Speed Model

Part Number: CC1310

Tool/software: Code Composer Studio

Hi all,

We use CC1310 in High Speed Model,and sometimes the CMD_FS command fails, and we do this:

RF_Params_init(&rfParams);
rfParams.pErrCb = errorCallback;


void errorCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
    PIN_setOutputValue(ledPinHandle, Board_LED3,!PIN_getOutputValue(Board_LED3));
    FS_error++;
    while ((int32_t)ch == RF_ERROR_CMDFS_SYNTH_PROG)
    {
 //       RF_close(rfHandle);
 //       rfHandle = RF_open(&rfObject, RF_pProp_hsm, (RF_RadioSetup*)RF_pCmdRadioSetup_hsm, &rfParams);
        RF_postCmd(rfHandle, (RF_Op*)RF_pCmdFs_preDef, RF_PriorityNormal, NULL, 0);
        if(RF_State ==1)
        {
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdRxHS, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
        }
        else if(RF_State == 0)
        {
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdTxHS, RF_PriorityNormal, NULL, 0);
        }
        // Handle error
        // If CMD_FS is executed standalone, re-start CMD_FS in this function if there is time. If not, handle as in previous example
        // When CMD_FS is chained with RX/TX commands, the RX/TX is executed in parallel with this callback by the radio and will subsequently fail. Error can be handled as in previous example.
    }
}

But that can not make the CMD_FS command work properly;so how to solve this problem?

  • Hello,

    When you re-post CMD_FS, does it still return the same error? Have you checked the status of RF command executed before CMD_FS for errors?
    Does this happen at specific frequency or at random frequencies? Can you please post the RF settings that you are using (mainly overrides, Radio setup and FS commands).

    Regards,
  • Hi SVS,

    When we re-post CMD_FS,it results in a deadlock.It's been repeating re-post,and the value of the 'RF_CmdHandle ch' is always -257(RF_ERROR_CMDFS_SYNTH_PROG). The RF setting code :

        RF_Params_init(&rfParams);
        rfParams.pErrCb = errorCallback;
    
        /*------------------**************** RX ************************------------*/
        if( RFQueue_defineQueue(&RX_dataQueue,
                                    rxDataEntryBuffer,
                                    sizeof(rxDataEntryBuffer),
                                    RX_NUM_DATA_ENTRIES,
                                    RX_MAX_LENGTH + RX_NUM_APPENDED_BYTES))
        {
            /* Failed to allocate space for all data entries */
            while(true);
        }
    
        RF_pCmdRxHS->pQueue = &RX_dataQueue;
        RF_pCmdRxHS->maxPktLen = RX_MAX_LENGTH;
        RF_pCmdRxHS->pktConf.bRepeatOk = 0;
        RF_pCmdRxHS->pktConf.bRepeatNok = 0;
        RF_pCmdRxHS->rxConf.bAutoFlushCrcErr = 0;
    
    
    
    
        /*------------------**************** common ************************--------------------*/
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, RF_pProp_hsm, (RF_RadioSetup*)RF_pCmdRadioSetup_hsm, &rfParams);
    
    
        /* Set the frequency */
        RF_pCmdFs_preDef->frequency = RX_FREQ;            //config->frequencyTable[config->frequency].frequency;
        RF_pCmdFs_preDef->fractFreq = RX_CENTER_FRACTFREQ;          //config->frequencyTable[config->frequency].fractFreq;
        RF_postCmd(rfHandle, (RF_Op*)RF_pCmdFs_preDef, RF_PriorityNormal, NULL, 0);//
    
    

  • Hi all,

    We find that it happens both at 868 and 915MHz,and this will happen after at least 2 hours;Any suggestions about this?

  • Please see the CC1310 Errata note (http://www.ti.com/lit/swrz062) and the Error Handling section here:

    BR

    Siri

  • We use the TI RTOS 2.21.00.06 ,and we registered errorCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e). But we cannot re-post CMD_FS properly in errorCallback, the code is in the reply above, and we refer to the Error Handling section. We want to know what caused this mistake(RF_ERROR_CMDFS_SYNTH_PROG), our program is receive the sync signal(Rx inHSM) and to send data(TX in HSM) at 25ms every interval.The hardware used is CC1310 LaunchPad.
  • We refer to this note, and do the same Error Handling.But it doesn't seem to work,once the CMD_FS error happen, we cannot re-post CMD_FS.
  • I do not think you should do the TX and RX in the callback. Try to just set a flag in the callback that tells your application that the synnth programming failed and then re-try in the application.

    Siri
  • Hi Siri,

    Thanks for your reply, we have try your advice,but the same question. If we do not re-post the CMD_FS cmd in the callback,the program will go straight to the deadlock. If we only re-post the CMD_FS cmd in the callback,it always return 'RF_ERROR_CMDFS_SYNTH_PROG'.So what should i do in the callback?

    void errorCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    //    FS_error++;
        while ((int32_t)ch == RF_ERROR_CMDFS_SYNTH_PROG)
        {
    
      //      RF_close(rfHandle);
      //      CPUdelay(20000);
     //       rfHandle = RF_open(&rfObject, RF_pProp_hsm, (RF_RadioSetup*)RF_pCmdRadioSetup_hsm, &rfParams);
     //       CPUdelay(20000);
    
            RF_postCmd(rfHandle, (RF_Op*)RF_pCmdFs_preDef, RF_PriorityNormal, NULL, 0);
     //       CPUdelay(20000);
     /*       if(RF_State ==1)
            {
                RF_runCmd(rfHandle, (RF_Op*)&RF_cmdRxHS, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
            }
            else if(RF_State == 0)
            {
                RF_runCmd(rfHandle, (RF_Op*)&RF_cmdTxHS, RF_PriorityNormal, NULL, 0);
            }*/
            // Handle error
            // If CMD_FS is executed standalone, re-start CMD_FS in this function if there is time. If not, handle as in previous example
            // When CMD_FS is chained with RX/TX commands, the RX/TX is executed in parallel with this callback by the radio and will subsequently fail. Error can be handled as in previous example.
        }
    }
    

  • Hello,

    it seems like the synthesizer is not able able to lock once it goes out of lock. If you close and restart RF operation as you have in the commented code before CMD_FS, does the CMD_FS execute successfully?

    Regards,
  • Hi SVS,

    We've tried it already and it didn't work. We only find that  the RESET can make the synthesizer resume work.Another problem is that if we do the re-post CMD_FS only once again in the callback,the program also locks. We've seen this problem in debug mode,we got the following points:

    1.when the CMD_FS error occured, the value of the ‘RF_CmdHandle ch’ is always -257(RF_ERROR_CMDFS_SYNTH_PROG)

    2. when the CMD_FS error occured, the program will enter callback immediately,but we see the value of  'RF_pCmdFs_preDef->state’ is always 1024(DONE_OK)

    3. we use 'while (((volatile RF_Op*)&RF_pCmdFs_preDef)->status == ERROR_SYNTH_PROG)' determine this state,it seems that this state has not been rewritten, even though CMD_FS error has happened,the code:

    void errorCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    //    FS_error++;
        if ((int32_t)ch == RF_ERROR_CMDFS_SYNTH_PROG)
        {
    
            do
            {
                RF_runCmd(rfHandle, (RF_Op*)RF_pCmdFs_preDef, RF_PriorityNormal, NULL, 0);
            }
            while (((volatile RF_Op*)&RF_pCmdFs_preDef)->status == ERROR_SYNTH_PROG);
        }
    }

    Which situations can lead to this error? Are there related registers to analyze?

  • Can you try to only do one CMD_FS in the callback. If that fails, you should go back to the callback anyway:

    void errorCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if ((int32_t)ch == RF_ERROR_CMDFS_SYNTH_PROG)
        {
            RF_runCmd(rfHandle, (RF_Op*)RF_pCmdFs_preDef, RF_PriorityNormal, NULL, 0);
        }
    }
    Siri
  • Hi Siri,
    We did as you suggested, the program is stuck when executing RF_runCmd().We cannot determine where the deadlock occurred,and the value of 'RF_CmdHandle ch' is also cannot be read. We can't tell if RF_runCmd has been executed,the deadlock may occurred in the runcmd or after the runcmd.
  • Unfortunately I have not been able to reproduce this issue as my code never enters the errorCallback at all. If you want to, you can send me a friend request and share your project with me (or make a simple example that reproduce the error, for example implementing a loop where you call CMD_FS continously) and I can take a close look. I would also recommend that you include the RF driver directly in your project as you then should be able to see exactly where in the RF driver you get stuck.
    BR
    Siri
  • Hi Siri,
    Thank you very much!I will make the example,and i need some time to test. I have send the friend request, i will send you the example after finish the test.
  • Hi,

    to sum this thread up:

    • You must not do any blocking RF driver call in the error callback, (RF_runCmd(), RF_pendCmd(), ...), but RF_postCmd() is ok.
    • When the error callback is executed, the RF core just came from power-down and there is (usually) an RX or TX command waiting in the RF driver queue.
    • When you do RF_postCmd() in the error callback, then the command will be appended to the RF driver's command queue. There is no possibility to inject another CMD_FS before the command pending in the queue.
    • One possibility is, to cancel all pending commands with RF_cancelCmd(handle, RF_CMDHANDLE_FLUSH_ALL) and then RF_postCmd() with CMD_FS and the command you want to run.
    • If you observe that another CMD_FS fails, then you can force a power-down using RF_yield(). But when calling this function in the error callback, you must wait before posting new commands because RF_yield() will not take effect until the error callback completes. And when you post new commands to the RF driver, it will not execute RF_yield() because there are commands pending.

  • Hi,
    Thank you very much for your advice,i have confirmed that this method(use RF_cancelCmd() before RF_postCmd()) is valid, I am doing more tests, and I will provide more results in the test completion.
  • We have completed the test,we solved the problem by  use the following code:

    void errorCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    
        RF_cancelCmd(rfHandle, RF_CMDHANDLE_FLUSH_ALL,1);
    
        while ((int32_t)ch == RF_ERROR_CMDFS_SYNTH_PROG)
        {
    
             ch = RF_postCmd(rfHandle, (RF_Op*)RF_pCmdFs_preDef, RF_PriorityNormal, NULL, 0);
    
    }