Other Parts Discussed in Thread: SYSCONFIG, CC1310
Hi,
I am developing RF project on my own custom board based on CC1312R, I referenced rfPacketTx example from Resource Explorer, I copied some values to my old project, but I get an error as below. How can I pass it ? When I press where it is called, it is branching to RFCC26X2.h file. I have also included it but I got errors again.
#include <stdlib.h> #include <unistd.h> #include <ti/sysbios/knl/Task.h> #include <ti/drivers/rf/RF.h> #include <ti/drivers/PIN.h> #include <ti/drivers/pin/PINCC26XX.h> #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h) //#include "ti_drivers_config.h" #include <ti_radio_config.h>
#include <ti/drivers/rf/RFCC26X2.h> //#define POWER_MEASUREMENT #define PAYLOAD_LENGTH 30 #ifdef POWER_MEASUREMENT #define PACKET_INTERVAL 5 /* For power measurement set packet interval to 5s */ #else #define PACKET_INTERVAL 500000 /* Set packet interval to 500000us or 500ms */ #endif static RF_Object rfObject; static RF_Handle rfHandle; static PIN_Handle ledPinHandle; static PIN_State ledPinState; static uint8_t packet[PAYLOAD_LENGTH]; static uint16_t seqNumber; PIN_Config pinTable[] = { // CONFIG_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, PIN_TERMINATE }; void txTaskFunction(UArg arg0, UArg arg1) { RF_Params rfParams; RF_Params_init(&rfParams); /* Open LED pins */ ledPinHandle = PIN_open(&ledPinState, pinTable); if (ledPinHandle == NULL) { while(1); } RF_cmdPropTx.pktLen = PAYLOAD_LENGTH; RF_cmdPropTx.pPkt = packet; RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW; /* Request access to the radio */ #if defined(DeviceFamily_CC26X0R2) rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioSetup, &rfParams); #else rfHandle = 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); 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] = rand(); } /* Send packet */ RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0); switch(terminationReason) { case RF_EventLastCmdDone: // A stand-alone radio operation command or the last radio // operation command in a chain finished. break; case RF_EventCmdCancelled: // Command cancelled before it was started; it can be caused // by RF_cancelCmd() or RF_flushCmd(). break; case RF_EventCmdAborted: // Abrupt command termination caused by RF_cancelCmd() or // RF_flushCmd(). break; case RF_EventCmdStopped: // Graceful command termination caused by RF_cancelCmd() or // RF_flushCmd(). break; default: // Uncaught error event while(1); } uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdPropTx)->status; switch(cmdStatus) { case PROP_DONE_OK: // Packet transmitted successfully break; case PROP_DONE_STOPPED: // received CMD_STOP while transmitting packet and finished // transmitting packet break; case PROP_DONE_ABORT: // Received CMD_ABORT while transmitting packet break; case PROP_ERROR_PAR: // Observed illegal parameter break; case PROP_ERROR_NO_SETUP: // Command sent without setting up the radio in a supported // mode using CMD_PROP_RADIO_SETUP or CMD_RADIO_SETUP break; case PROP_ERROR_NO_FS: // Command sent without the synthesizer being programmed break; case PROP_ERROR_TXUNF: // TX underflow observed during operation break; default: // Uncaught error event - these could come from the // pool of states defined in rf_mailbox.h while(1); } #ifndef POWER_MEASUREMENT // PIN_setOutputValue(ledPinHandle, CONFIG_PIN_GLED,!PIN_getOutputValue(CONFIG_PIN_GLED)); #endif /* Power down the radio */ RF_yield(rfHandle); #ifdef POWER_MEASUREMENT /* Sleep for PACKET_INTERVAL s */ sleep(PACKET_INTERVAL); #else /* Sleep for PACKET_INTERVAL us */ usleep(PACKET_INTERVAL); #endif } }