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: Cannot open again after RF shutdown

Part Number: CC1310

hi all

 I find that when I'm using the CC1310 radio frequency delivery function, sometimes the radio frequency function  cannot be turned on,The program will stop at the following code:

   {   rfHandle = RF_open(&rfObject, RF_pProp_hsm, (RF_RadioSetup*)RF_pCmdRadioSetup_hsm, &rfParams);}

and even when radio works properly,if i use the following code to close radio,then i cannot open it anymore .

   {   rfHandle = RF_open(&rfObject, RF_pProp_hsm, (RF_RadioSetup*)RF_pCmdRadioSetup_hsm, &rfParams);
      RF_close(rfHandle);}

 

  • What is the meaning of the “RF_pCmdFs_preDef->fractFreq = 0x0000”parameter?
  • fractFreq is described in table 23-24 in .

    The easiest is to use SmartRF Studio to calculate it.

  • Hi,

    your question and code example are ambiguous. Can you please confirm that you are doing the following:

    rfHandle = RF_open(...); /* Open the driver the first time */
    // ...
    RF_close(rfHandle); /* Close the RF driver instance */
    // ...
    rfHandle = RF_open(...); /* Open the driver the second time */

    For every RF_open(), you must have a matching RF_close() before you can re-open it again.

  • Hi Richard,

    Thank you for your answer,I mean,I did the following code:

    rfHandle = RF_open(...); /* Open the driver the first time */
    // ...
    RF_close(rfHandle); /* Close the RF driver instance */
    // ...
    rfHandle = RF_open(...); /* Open the driver the second time */
    Initially, because my program was running for some time, the RF module could not be open,

    So I tried using the code above to debug it, and then, if I'm using RF_close after RF_open,i cannot open it again by using RF_open
  • Hi,

    I have never seen this behavior. Are you maybe step-debugging with interrupts disabled? If not, can you please create a minimal and self-containing example which shows this error including the information about which SDK version you are using?

    Thanks

  • Hi Richard,

     I used the example of Resource Explorer, Follow the path shown below

     I use the rfPacketRx and rfPacketTx  to send and receive data,if i  added the 121 and 122 lines in rfPacketTx.c as follows:

         RF_close(rfHandle);       //
         rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);

    Then can't work properly.

    Thanks again for your answer.

  • Hi,

    thank you. Now I can understand the problem. You are basically doing this:

        curtime = RF_getCurrentTime();
        while(1)
        {
            // ...
            RF_close();
        
            // ... 
            RF_open();
            
            curtime += PACKET_INTERVAL;
            RF_cmdPropTx.startTime = curtime;
    
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
        }

    This cannot work. The rfPacketTx example uses absolute start triggers (TRIG_ABSTIME). The base time stamp is obtained with RF_getCurrentTime() before the while loop and then constantly increased. When you close and re-open the driver in between, these timestamps are not valid anymore. In your case, the RF driver seems to interpret the timestamp as a time very far in the future and wait for a very long time.

    Why do you want to close the RF driver instance? If you want to force the RF core to go into standby, you can use RF_yield(). Please read more about the driver power management in this document. You may also use TRIG_NOW as a start trigger instead. The rfPacketTx example is not really a good example to show spontaneous transmission.

  • Hi Richard,

    Thank you very much for your professional answer,it has helped me a lot.

    I see what you mean,but I think I should have done the following:


    RF_open(); // RF_close(); // ... RF_open(); while(1) { curtime = RF_getCurrentTime(); curtime += PACKET_INTERVAL; RF_cmdPropTx.startTime = curtime; RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0); }

    Is there any mistake in this code that I don't know? Thanks again.

  • Hi,

    this looks ok to me as long as you do not re-use time stamps after RF_close().

    RF_open();
    // Here you can now use time stamps obtained by RF_getCurrentTime()
    // and calculate new time stamps for future command execution.
    RF_close();
    
    RF_open();
    // You cannot use the time stamps from above anymore. 
    // You need to call RF_getCurrentTime() again.