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

CC2640R2F的simplelink_cc2640r2_sdk_3_20_00_21的drivers中例程rfPacketTx和pinshutdown结合后,无法发送数据

请教一下,谢谢,本意是button1控制shutdown,button0控制唤醒并发包,但是测试下来,并没有发包,请问是有什么问题吗?

这是任务里面一些操作,参考了rfPacketTx

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

#ifdef POWER_MEASUREMENT
#if defined(Board_CC1350_LAUNCHXL)/* Route out PA active pin to Board_DIO30_SWPWR */PINCC26XX_setMux(ledPinHandle, Board_DIO30_SWPWR, PINCC26XX_MUX_RFC_GPO1);
#endif
#endifRF_cmdPropTx.pktLen = PAYLOAD_LENGTH;RF_cmdPropTx.pPkt = packet;RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;/* Request access to the radio 请求访问radio*/
#if defined(DeviceFamily_CC26X0R2)rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioSetup, &rfParams);
#elserfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
#endif// DeviceFamily_CC26X0R2/* Set the frequency */RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);/* Wait for a button press */
//Semaphore_pend(txSemaphoreHandle, BIOS_WAIT_FOREVER);uint8_t m;for(m=0;m<10;m++){packet[0] = (uint8_t)(seqNumber >> 8);packet[1] = (uint8_t)(seqNumber++);uint8_t i;for (i = 2; i < PAYLOAD_LENGTH; i++){packet[i] = rand();}/* Send packet */RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,RF_PriorityNormal, NULL, 0);switch(terminationReason){case RF_EventLastCmdDone:break;case RF_EventCmdCancelled:break;case RF_EventCmdAborted:break;case RF_EventCmdStopped:break;default:while(1);}uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdPropTx)->status;switch(cmdStatus){case PROP_DONE_OK:// Packet transmitted successfullybreak;case PROP_DONE_STOPPED:// received CMD_STOP while transmitting packet and finished// transmitting packetbreak;case PROP_DONE_ABORT:// Received CMD_ABORT while transmitting packetbreak;case PROP_ERROR_PAR:// Observed illegal parameterbreak;case PROP_ERROR_NO_SETUP:// Command sent without setting up the radio in a supported// mode using CMD_PROP_RADIO_SETUP or CMD_RADIO_SETUPbreak;case PROP_ERROR_NO_FS:// Command sent without the synthesizer being programmedbreak;case PROP_ERROR_TXUNF:// TX underflow observed during operationbreak;default:// Uncaught error event - these could come from the// pool of states defined in rf_mailbox.hwhile(1);}

#ifndef POWER_MEASUREMENTPIN_setOutputValue(hPins, Board_PIN_LED1,1);
#endif}/* Turn on LED0 to indicate active */PIN_setOutputValue(hPins, Board_PIN_LED0, 1);uint32_t sleepUs = 500000;Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED0, 0);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED0, 1);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED0, 0);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED0, 1);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED0, 0);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED0, 1);/* Pend on semaphore before going to shutdown */Semaphore_pend(Semaphore_handle(&shutdownSem), BIOS_WAIT_FOREVER);/* Turn off LED0 */PIN_setOutputValue(hPins, Board_PIN_LED0, 0);PIN_setOutputValue(hPins, Board_PIN_LED1, 0);/* Configure DIO for wake up from shutdown */PINCC26XX_setWakeup(ButtonTableWakeUp);/* Go to shutdown */Power_shutdown(0, 0);/* Should never get here, since shutdown will reset. */while (1);

}

Viki Shi:

断点调试追踪代码,看是否能跑到RF发送那块

赞(0)
未经允许不得转载:TI中文支持网 » CC2640R2F的simplelink_cc2640r2_sdk_3_20_00_21的drivers中例程rfPacketTx和pinshutdown结合后,无法发送数据
分享到: 更多 (0)