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.

CC2650 RF Core hangs on RF_runCmd

Other Parts Discussed in Thread: CC2650, CC2650STK

I am trying to access RF core directly in CC2650. (Hardware in used is CC2650 lauchpad) When I was implementing 802.15.4 packet TX sender that references to TI example code files rfPacketTx.c, the program hanged on the function RF_runCmd and never return, though sent packet was observed by smartRF studio 7.

The setup is as follows:

RF_Mode RF_prop =
{
.rfMode = RF_MODE_IEEE_15_4,
.cpePatchFxn = 0,
.mcePatchFxn = 0,
.rfePatchFxn = 0,
};

rfc_CMD_RADIO_SETUP_t RF_802_15_4_RadioSetup=
{
.commandNo = CMD_RADIO_SETUP,
.status = 0x0000,
.mode = 0x01,
.config.frontEndMode = 0x0,
.config.biasMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower.IB = 0x21,
.txPower.GC = 1,
.txPower.tempCoeff = 0x31,
.pRegOverride = NULL,
.condition.rule = 1,
};

rfc_CMD_FS_t RF_cmdFs =
{
.commandNo = CMD_FS,
.status = 0x0000,
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.frequency = 0x096a,
.fractFreq = 0x0000,
.synthConf.bTxMode = 0x1,
.synthConf.refFreq = 0x0,
.__dummy0 = 0x00,
.midPrecal = 0x00,
.ktPrecal = 0x00,
.tdcPrecal = 0x0000,
};

rfc_CMD_IEEE_TX_t RF_cmdIEEETx=
{
.commandNo = 0x2c01,
.status = 0x0000,
.pNextOp = 0,
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.txOpt = 0x00,
.payloadLen = 0x0c,
.timeStamp - 0x00000000
};

Task's settings:

#define TASKSTACKSIZE  2048

#define TX_TASK_PRIORITY 1

In the task function:


Void taskFxn(UArg arg0, UArg arg1)
{

RF_Params rfParams;
RF_Params_init(&rfParams);

RF_cmdIEEETx.payloadLen = PAYLOAD_LENGTH;
RF_cmdIEEETx.pPayload = packet;
RF_cmdIEEETx.startTrigger.triggerType = TRIG_NOW;

/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_802_15_4_RadioSetup, &rfParams);

/* Set the frequency */
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

time = RF_getCurrentTime();
while (1) {

/* Create packet with incrementing sequence number and random payload */
packet[0] = (uint8_t)(seqNumber >> 8);
packet[1] = (uint8_t)(seqNumber++);
uint8_t i;
for (i = 2; i < PAYLOAD_LENGTH; i++)
{
packet[i] = i;
}
/* Send packet */
		RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIEEETx, RF_PriorityNormal, NULL, 0);
		if (!(result & RF_EventLastCmdDone))
		{
		while(1){

		        Task_sleep((UInt)arg0/2);
		}
        Task_sleep((UInt)arg0);
    }

}

It sent one packet and the program is hanging on function RF_runCmd without return.

Am I missing some configurations? How to solve the problem, please?

  • Any body working on this issue, please? or was my question unclear?
  • You can refer to the discussions in e2e.ti.com/.../481973
  • Hi
    I have the same problem. And the discussion above doesn't help.
    I want to run the rfPacketTx with IEEE 802.15.4 instead Proprietary 2.4GHz with the given RF.h functions.
    I defined a IEEE 802.15.4 TX packet into SmartRF Studio. Then I used the StmartRF Studio cfg file to use the parameters because there isn't a CC26XX export function! (It should be included since Sep. 2016. I'm still waiting)
    I included the parameters into the smartrf_settings. I also changed the rfPacketTx.c with the new parameters... and it doesn't work.

    The sofware hangs into the RF_runCmd().

    Can anyone help me?

    Here the smartRF_settings:

    //-----------------------------------------------------------------
    RF_Mode RF_prop =
    //-----------------------------------------------------------------
    {
    .rfMode = RF_MODE_IEEE_15_4,
    .cpePatchFxn = 0,
    .mcePatchFxn = 0,
    .rfePatchFxn = 0,
    };

    //-----------------------------------------------------------------------------------------------
    // Following Parameters are extract from SmartRF Studio cfg for a
    // CC2650STK Sensor Tag and a TX packet
    //

    //----------------------------------------------------------------------
    uint32_t pOverrides[] =
    //----------------------------------------------------------------------
    {
    // <OverrideBuffer name="override_synth_ieee_15_4.xml">
    HW_REG_OVERRIDE(0x4038,0x0035),
    (uint32_t) 0x000784A3,
    (uint32_t) 0xA47E0583,
    (uint32_t) 0xEAE00603,
    (uint32_t) 0x00010623,
    HW32_ARRAY_OVERRIDE(0x405C,1),
    (uint32_t) 0x1801F800,
    HW32_ARRAY_OVERRIDE(0x402C,1),
    (uint32_t) 0x00608402,
    (uint32_t) 0x02010403,
    HW32_ARRAY_OVERRIDE(0x4034,1),
    (uint32_t) 0x177F0408,
    (uint32_t) 0x38000463,
    // </OverrideBuffer>
    // <OverrideBuffer name="override_phy_ieee_15_4.xml">
    (uint32_t) 0x05000243,
    (uint32_t) 0x002082C3,
    // </OverrideBuffer>
    // <OverrideBuffer name="override_frontend_id.xml">
    (uint32_t) 0x000288A3,
    (uint32_t) 0x000F8883,
    HW_REG_OVERRIDE(0x50DC,0x002B)
    // </OverrideBuffer>
    };

    //-----------------------------------------------------------------
    rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup =
    //-----------------------------------------------------------------
    {
    .commandNo = 0x0802,
    .status = 0x0,
    .pNextOp = 0x0,
    .startTime = 0,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0,
    .mode = 0x1,
    .__dummy0 = 0,
    .config = 0,
    .txPower = 0x9330,
    .pRegOverride = pOverrides

    };

    //-----------------------------------------------------------------
    rfc_CMD_FS_t RF_cmdFs =
    //-----------------------------------------------------------------
    {
    .commandNo = 0x0803,
    .status = 0x0000,
    .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .startTime = 0x00000000,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0x0,
    .frequency = 2440,
    .fractFreq = 0x0000,
    .synthConf.bTxMode = 1,
    .synthConf.refFreq = 0x0,
    .__dummy0 = 0,
    .__dummy1 = 0,
    .__dummy2 = 0,
    .__dummy3 = 0
    };

    //-----------------------------------------------------------------
    rfc_CMD_IEEE_TX_t RF_cmdIeeeTx =
    //-----------------------------------------------------------------
    {
    .commandNo = 0x2C01,
    .status = 0x0000,
    .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .startTime = 0x00000000,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0x0,
    .txOpt = 0,
    .payloadLen = 0x8,
    .pPayload = (uint8_t *)"This is",
    .timeStamp = 0
    };


    Here the code:
    //-----------------------------------------------------------------------------------
    static void txTaskFunction(UArg arg0, UArg arg1)
    //-----------------------------------------------------------------------------------
    {
    uint32_t time;
    RF_Params rfParams;
    RF_Params_init(&rfParams);

    /* Request access to the radio */
    rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);

    /* Set the frequency */
    RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

    /* Get current time */
    time = RF_getCurrentTime();
    while(1)
    {
    /* Set absolute TX time to utilize automatic power management */
    time += PACKET_INTERVAL;
    RF_cmdIeeeTx.startTime = time;

    /* Send packet */
    RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);
    if (!(result & RF_EventLastCmdDone))
    {
    /* Error */
    while(1);
    }

    PIN_setOutputValue(pinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));

    }
    }