Part Number: CC2640R2F
Tool/software: Code Composer Studio
I'm using SimpleCentral to develope a scanner which only listen and print the scan result, but after running the program for about two hours, the program fail to print data, i debugged for more data and found the program stopped at a while(...) sentence, as below:
static void RF_corePowerDown(void)
{
/* Local variables to calculate active time in current window. */
uint32_t deltaTimeInUs = 0;
/* Disable all CPE and HW interrupts as we are about to power down the core.
Clearing is not important as content will be lost anyway. */
RFCCpeIntDisable(~0);
RFCHwIntDisable(~0);
/* Exchange the hwi service routine. */
HwiP_setFunc(&RF_hwiCpe0Obj, RF_hwiCpe0Power, (uintptr_t)NULL);
/* Set VCOLDO reference */
RFCAdi3VcoLdoVoltageMode(false);
/* Take wake up timestamp and the current timestamp */
uint32_t rtcTimestampB = (uint32_t) AONRTCCurrent64BitValueGet();
/* Find the radio core active delta time since the last power up. */
deltaTimeInUs = UDIFF(RF_rtcTimestampA, rtcTimestampB);
deltaTimeInUs >>= RF_RTC_CONV_TO_US_SHIFT;
/* Accumulate the delta time with the previous active time windows. Avoid overflow by using saturation. */
RF_core.activeTimeUs = ADD(RF_core.activeTimeUs, deltaTimeInUs);
/* Decide whether to send the CMD_SYNC_STOP_RAT command. If this is first power down (.init) or active time (activeTimeInUs)
is longer than the time that can cause maximum allowed error between RAT and RTC clocks. Yielding will automatically fulfill
the latter. */
if (!(RF_core.init) ||
(RF_core.activeTimeUs > (RF_errTolValInUs << RF_DEFAULT_COMB_XTAL_DRIFT_BITS_SHIFT)))
{
/* Stop and synchronize the RAT if it is running */
if (RF_ratIsRunning())
{
/* Setup RAT_SYNC command to follow powerdown. */
RF_ratSyncCmd.stop.commandNo = CMD_SYNC_STOP_RAT;
RF_ratSyncCmd.stop.status = IDLE;
RF_ratSyncCmd.stop.condition.rule = COND_NEVER;
RF_ratSyncCmd.stop.startTrigger.triggerType = TRIG_NOW;
RF_ratSyncCmd.stop.pNextOp = NULL;
/* Send RAT Stop command and synchronously wait until it run. */
RF_dbellSubmitCmdAsync((uint32_t)&RF_ratSyncCmd.stop);
while (!(RF_ratSyncCmd.stop.status & RF_CMD_TERMINATED));
}
/* The RF core is now initialized and RAT is synchronized. */
RF_core.init = true;
RF_core.activeTimeUs = 0;
}
/* Turn off Synth */
RFCSynthPowerDown();
/* Turn off the RF core by gating its clock. This is a quick way to have it shut off. */
RFCClockDisable();
}
RFCC26XX_singleMode
The sentence is while (!(RF_ratSyncCmd.stop.status & RF_CMD_TERMINATED)); in RFCC26XX_singleMode.c
I want to know:
1.In what situation will the program call the function above, i cant find the upper layer who call the function
2.why the while sentence turned into dead cycle, is it hardware error or software error?
is there any direction i can solve the problem?
Looking forward to anyting helpful.



