Other Parts Discussed in Thread: CC1310, CC1350
Unable to create a new CC1310 32K project with TIRTOS without errors, I decided to use the CC1310-128k example code and change the processor. It does not seem to want to run the RF commands
My code hangs in here after a call to RFOpen
// Keep track of mode
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = pCurrClient->clientConfig.pRfMode->rfMode;
if (HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) != pCurrClient->clientConfig.pRfMode->rfMode)
{
// Unsupported mode
while(1);
}
My calls
static RF_Object rfObject;
static RF_Handle rfHandle;
void RxTask_init(PIN_Handle ledPinHandle) {
pinHandle = ledPinHandle;
Task_Params_init(&rxTaskParams);
rxTaskParams.stackSize = RX_TASK_STACK_SIZE;
rxTaskParams.priority = RX_TASK_PRIORITY;
rxTaskParams.stack = &rxTaskStack;
rxTaskParams.arg0 = (UInt)1000000;
Task_construct(&rxTask, rxTaskFunction, &rxTaskParams, NULL);
}
static void rxTaskFunction(UArg arg0, UArg arg1)
{
RF_Params rfParams;
RF_Params_init(&rfParams);
if( RFQueue_defineQueue(&dataQueue,
rxDataEntryBuffer,
sizeof(rxDataEntryBuffer),
NUM_DATA_ENTRIES,
MAX_LENGTH + NUM_APPENDED_BYTES))
{
/* Failed to allocate space for all data entries */
while(1);
}
/* Modify CMD_PROP_RX command for application needs */
RF_cmdPropRxSniff.pQueue = &dataQueue; /* Set the Data Entity queue for received data */
RF_cmdPropRxSniff.rxConf.bAutoFlushIgnored = 1; /* Discard ignored packets from Rx queue */
RF_cmdPropRxSniff.rxConf.bAutoFlushCrcErr = 1; /* Discard packets with CRC error from Rx queue */
// RF_cmdPropRxSniff.pOutput = (uint8_t*)&rxStatistics; /* Set rx statistics output struct */
RF_cmdPropRxSniff.maxPktLen = MAX_LENGTH; /* Set the max length, used for filtering */
//RF_cmdPropRxSniff.rxConf.bAutoFlushCrcErr = 0x1; /* Auto-flush packets with invalid CRC */
RF_cmdPropRxSniff.pktConf.bRepeatNok = 0x1; /* Go back to sync search after receiving a packet with CRC error */
RF_cmdPropRxSniff.rssiThr = (int8_t)WOR_RSSI_THRESHOLD;
RF_cmdPropRxSniff.corrPeriod = (uint16_t)WOR_CORRELATION_PERIOD;
RF_cmdPropRxSniff.csEndTime = (uint32_t)WOR_CS_END_TIME;
RF_cmdPropRxSniff.endTrigger.triggerType = TRIG_REL_START;
RF_cmdPropRxSniff.endTime = WOR_RX_END_TIME;
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
/* Set the frequency */
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
while(1)
{
// Get the current radio time
rxTime = RF_getCurrentTime();
//PIN_setOutputValue(pinHandle, Board_LED4,!PIN_getOutputValue(Board_LED4));
// Set next wakeup time in the future
rxTime += WOR_WAKE_UP_INTERVAL;
RF_cmdPropRxSniff.startTime = rxTime;
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, NULL, (RF_EventCmdAborted |
RF_EventCmdStopped |
RF_EventCmdCancelled |
RF_EventCmdDone ));
PIN_setOutputValue(pinHandle, Board_LED2,!PIN_getOutputValue(Board_LED2));
if (RF_cmdPropRxSniff.status == PROP_DONE_OK)
{
/* Get current unhandled data entry */
currentDataEntry = RFQueue_getDataEntry();
/* Handle the packet data, located at ¤tDataEntry->data:
* - Length is the first byte with the current configuration
* - Data starts from the second byte */
packetLength = *(uint8_t*)(¤tDataEntry->data);
packetDataPointer = (uint8_t*)(¤tDataEntry->data + 1);
/* Copy the payload + the status byte to the packet variable */
memcpy(packet, packetDataPointer, (packetLength + 1));
RFQueue_nextEntry();
}
}
}