Hello,
I have a test application with a single task containing a loop that calls RF_runCmd() to repeatedly execute a radio receive command with a time-out of one second. The loop runs for between 250 and 260 seconds, and then RF_runCmd() hangs for about 10-15 minutes before it returns again before it starts running again for another 250 to 260 seconds. The exact timing is variable, but it is 100% repeatable and always close to the same amount time. It doesn't matter if I change the receive time-out to 1/4 second; it just loops for more iterations, but still stops after the same total time. It doesn't matter if I pause execution with debugger, it will still stop at after the expected number of loops that corresponds to the total time running.
What could be causing this and how should I troubleshoot further? Here is the code:
Task_Struct rfSimpleTask; /* not static so you can see in ROV */
#define RF_SIMPLE_TASK_STACK_SIZE 1024
#define RF_SIMPLE_TASK_PRIORITY 2
static uint8_t rfSimpleTaskStack[RF_SIMPLE_TASK_STACK_SIZE];
static int num_loops = 0;
RF_Handle rfSimpleHandle;
RF_Object rfSimpleObject;
static void rfSimple_TaskFxn(UArg arg0, UArg arg1)
{
RF_Params rfParams;
RF_Params_init(&rfParams);
RF_EventMask em;
rfSimpleHandle = RF_open(&rfSimpleObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
/* Set the frequency */
RF_runCmd(rfSimpleHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
while (1) {
RF_cmdPropRx.pQueue = NULL; /* (Changed to NULL to troubleshoot the problem) -- Set the Data Entity queue for received data */
RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1; /* Discard ignored packets from Rx queue */
RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1; /* Discard packets with CRC error from Rx queue */
RF_cmdPropRx.maxPktLen = 124; /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
RF_cmdPropRx.pktConf.bRepeatOk = 1; // don't stop at first packet
RF_cmdPropRx.pktConf.bRepeatNok = 1; // don't stop at first crc error
RF_cmdPropRx.startTrigger.triggerType = TRIG_ABSTIME;
RF_cmdPropRx.startTrigger.pastTrig = 1;
RF_cmdPropRx.startTime = 0;
RF_cmdPropRx.endTrigger.triggerType = TRIG_ABSTIME;
RF_cmdPropRx.endTime = RF_getCurrentTime() +(1000*(4000000/1000)); // 1 second timeout
em = RF_runCmd(rfSimpleHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, NULL, 0);
num_loops++;
}
}
void rfSimple_start() {
Task_Params rfSimpleTaskParams;
Task_Params_init(&rfSimpleTaskParams);
rfSimpleTaskParams.stackSize = RF_SIMPLE_TASK_STACK_SIZE;
rfSimpleTaskParams.priority = RF_SIMPLE_TASK_PRIORITY;
rfSimpleTaskParams.stack = &rfSimpleTaskStack;
num_loops = 0;
Task_construct(&rfSimpleTask, rfSimple_TaskFxn, &rfSimpleTaskParams, NULL);
}
int main(void) {
/* Call board init functions. */
Board_initGeneral();
rfSimple_start();
/* Start BIOS */
BIOS_start();
return (0);
}