Tool/software: TI-RTOS
Hello,
In my system, one CC1310 is initiating transmission periodically every 3 minutes and it waits for 3 seconds in Rx task for receiving the data from another receiver who is always in Rx. I am using Listen before talk in Tx as my system will have many cc1310 Transmitter talking with one receiver. The problem I observed in prolonged testing is transmitter works fine for 3-4 days and it stops sending the data. Here is my code for Tx task in transmitter :
#define CS_RETRIES_WHEN_BUSY 10 /* Number of times the CS command should run in the case where the channel is BUSY */ #define RSSI_THRESHOLD_DBM -100 /* The channel is reported BUSY is the RSSI is above this threshold */ #define IDLE_TIME_US 500000 /* idle time between retries is 500 ms */ #define PACKET_INTERVAL_US 200000 static void txTaskFunction(UArg arg0, UArg arg1) { RF_Params rfParams; RF_Params_init(&rfParams); rfParams.nInactivityTimeout = 100; RF_cmdPropTx.pktLen = PAYLOAD_LENGTH; RF_cmdPropTx.pPkt = event; //RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW; //RF_cmdPropTx.startTrigger.pastTrig = 1; RF_cmdNop.startTrigger.triggerType = TRIG_NOW; RF_cmdNop.startTrigger.pastTrig = 1; RF_cmdNop.pNextOp = (rfc_radioOp_t*)&RF_cmdPropCs; RF_cmdPropCs.pNextOp = (rfc_radioOp_t*)&RF_cmdCountBranch; RF_cmdCountBranch.pNextOp = (rfc_radioOp_t*)&RF_cmdPropTx; RF_cmdCountBranch.pNextOpIfOk = (rfc_radioOp_t*)&RF_cmdPropCs; /* Customize the API commands with application specific defines */ RF_cmdPropCs.rssiThr = RSSI_THRESHOLD_DBM; RF_cmdPropCs.csEndTime = IDLE_TIME_US;//((rand() % 500000) + 150) * 4; // random waiting time to avoid sensors trying on same pattern //(IDLE_TIME_US + 150) * 4; /* Add some margin */ RF_cmdCountBranch.counter = CS_RETRIES_WHEN_BUSY; /* 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); /* Get current time */ time = RF_getCurrentTime(); while(1) { Semaphore_pend(Tx, BIOS_WAIT_FOREVER); printf("In the tx task\r\n"); ccm_encrypt_data(event); switch(retries) { case 0: RF_cmdPropRadioDivSetup.txPower = TX_POWER_10; // set power 10 dbm break; case 2: RF_cmdPropRadioDivSetup.txPower = TX_POWER_11; // set power 11 dbm break; case 3: RF_cmdPropRadioDivSetup.txPower = TX_POWER_12; //set power 12 dbm break; case 4: RF_cmdPropRadioDivSetup.txPower = TX_POWER_12_5; //set power 12.5 dbm break; case 5: RF_cmdPropRadioDivSetup.txPower = TX_POWER_14; // set power 14 dbm break; default: RF_cmdPropRadioDivSetup.txPower = TX_POWER_14; // set power 14 dbm break; } time += (PACKET_INTERVAL_US * 4); RF_cmdNop.startTime = time; /* Send packet */ RF_runCmd(rfHandle, (RF_Op*)&RF_cmdNop, RF_PriorityNormal, NULL, 0); //RF_runCmd(rfHandle, (RF_Op*)&RF_cmdNop, RF_PriorityNormal, txcallback, IRQ_TX_DONE); RF_cmdNop.status = IDLE; RF_cmdPropCs.status = IDLE; RF_cmdCountBranch.status = IDLE; RF_cmdPropTx.status = IDLE; RF_cmdCountBranch.counter = CS_RETRIES_WHEN_BUSY; //PIN_setOutputValue(pinHandle, Board_LED0,!PIN_getOutputValue(Board_LED0));*/ Semaphore_post(Tx); //keep 2 seconds window on for receiving RF_yield(rfHandle);
}
}
Kindly let me know if more information is required. Is there any issue with the parameters I set in Tx task ?
Regards,
Omkar