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?