TI中文支持网
TI专业的中文技术问题搜集分享网站

RF_runCmd 这个接口为什么会卡住

调用EasyLink_init这个接口的时候,走到RF_runCmd这步就卡住不动了,是什么回事了??

Yue TANG:

用的什么板子,芯片的版本是多少,TI-RTOS版本是多少? 正常是不会卡住。

RF_runCmd的代码如下,会调用RF_pendCmd,是会等待命令执行特定事件发生才会返回

RF_EventMask RF_runCmd(RF_Handle h, RF_Op* pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent){ if (pCb == NULL) { pCb = syncCb; }

RF_CmdHandle ch = RF_postCmd(h, pOp, ePri, pCb, bmEvent);

if (ch<0) { return RF_EventCmdError; } return RF_pendCmd(h, ch, (RF_EventLastCmdDone | RF_EventCmdAborted | RF_EventCmdStopped | RF_EventCmdCancelled));}

k999:

回复 Yue TANG:

是我是用了一个未初始化的Semaphore_Handle,只要我不重启或者断电,即使是重新下载程序调试的话就一直会在这个接口上卡住。

Yue TANG:

回复 k999:

不明白你的意思,你用默认的没修改的程序测试下试试先。 

dian ji:

回复 Yue TANG:

这个一般是硬件问题,你换个模块试试

daniel1:

回复 Yue TANG:

也遇到类似的问题 重新上电和第一次仿真都没有问题,但是不断电第二次仿真就卡在这里,就算软重启也没有用,只能重启或者复位reset脚,芯片是版本A

user1938356:

回复 daniel1:

我也遇到了一样的 问题,cc2650 packetTx,程序上电或者仿真运行到

RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);时能发送一个数据包,

但是执行到

RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);时就死在这不下去了,不知道什么情况

我贴一下我的代码:

/***** Function definitions *****/void TxTask_init(PIN_Handle inPinHandle){ pinHandle = inPinHandle;

Task_Params_init(&txTaskParams); txTaskParams.stackSize = TX_TASK_STACK_SIZE; txTaskParams.priority = TX_TASK_PRIORITY; txTaskParams.stack = &txTaskStack; txTaskParams.arg0 = (UInt)1000000;

Task_construct(&txTask, txTaskFunction, &txTaskParams, NULL);}

static void txTaskFunction(UArg arg0, UArg arg1){ uint32_t time; RF_Params rfParams; RF_Params_init(&rfParams);

/* RF_cmdPropTx_FSK.pktLen = PAYLOAD_LENGTH; RF_cmdPropTx_FSK.pPkt = packet; RF_cmdPropTx_FSK.startTrigger.triggerType = TRIG_ABSTIME; RF_cmdPropTx_FSK.startTrigger.pastTrig = 1; RF_cmdPropTx_FSK.startTime = 0;*/ RF_cmdIeeeTx.payloadLen = PAYLOAD_LENGTH; RF_cmdIeeeTx.pPayload = packet; RF_cmdIeeeTx.startTrigger.triggerType = 0; RF_cmdIeeeTx.startTrigger.pastTrig = 0; RF_cmdIeeeTx.startTime = 0; /* Request access to the radio */ //rfHandle = RF_open(&rfObject, &RF_prop_FSK, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup_FSK, &rfParams); rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);

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

/* Get current time */ 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] = 0xAA;//rand(); }

/* Set absolute TX time to utilize automatic power management */ time += PACKET_INTERVAL; //RF_cmdPropTx_FSK.startTime = time; RF_cmdPropTx_FSK.startTime = time;

/* Send packet */ //RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx_FSK, RF_PriorityNormal, NULL, 0); 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)); }}

其中smartrf_settings是用smartRF studio7生成的,发送的数据格式也是按照我配置的内容没错,就是程序到那就过不去了,不能实现循环发送

赞(0)
未经允许不得转载:TI中文支持网 » RF_runCmd 这个接口为什么会卡住
分享到: 更多 (0)