This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2650: Clock object not behaving properly.

Part Number: CC2650
Other Parts Discussed in Thread: CC1350

Tool/software: TI-RTOS

Hi,

In My application i am using the CC2650 example code for Sensor Tag.In my application i have the need of periodic reset of the sensor tag after 12 hour reboot.I am using the 

Util_constructClock(&ResetClock, Reset_clockHandler,RESET_PERIODIC_EVT_PERIOD, 0, true, 0);  function to create a clock with 12 hour reboot.and on the clock time out i am calling the system reboot function.But instead of 12 hours it is rebooting only in 4 minutes.I am not able to get into the root cause of the issue.

Here is the part of the code snippet ::

#define RESET_PERIODIC_ONE_MINUTE 60000
#define RESET_PERIODIC_TEN_MINUTE 600000
#define RESET_PERIODIC_FIFTEEN_MINUTE 900000
#define RESET_PERIODIC_ONE_HOUR 3600000
#define RESET_PERIODIC_TWELEVE_HOUR 43200000
// How often to perform periodic event (in msec)
#define RESET_PERIODIC_EVT_PERIOD RESET_PERIODIC_TWELEVE_HOUR

/*********************************************************************
* @fn Reset_clockHandler
*
* @brief Handler function for clock timeouts.
*
* @param arg - event type
*
* @return None.
*/
static void Reset_clockHandler(UArg arg)
{
SysCtrlSystemReset();
}

/*******************************************************************************
* Locals
*/
/*******************************************************************************
*
* @fn Main
*
* @brief Application Main
*
* input parameters
*
* @param None.
*
* output parameters
*
* @param None.
*
* @return None.
*/
int main()
{
uint32_t Random_Number;
/* Register Application callback to trap asserts raised in the Stack */
RegisterAssertCback(AssertHandler);

PIN_init(BoardGpioInitTable);

#ifdef CC1350_LAUNCHXL
// Enable 2.4GHz Radio
radCtrlHandle = PIN_open(&radCtrlState, radCtrlCfg);

#ifdef POWER_SAVING
Power_registerNotify(&rFSwitchPowerNotifyObj,
PowerCC26XX_ENTERING_STANDBY | PowerCC26XX_AWAKE_STANDBY,
(Power_NotifyFxn) rFSwitchNotifyCb, NULL);
#endif //POWER_SAVING
#endif //CC1350_LAUNCHXL

#ifndef POWER_SAVING
/* Set constraints for Standby and Idle mode */
Power_setConstraint(PowerCC26XX_SB_DISALLOW);
Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
#endif // POWER_SAVING

/* Initialize ICall module */
ICall_init();

/* Start tasks of external images - Priority 5 */
ICall_createRemoteTasks();

/* Kick off profile - Priority 3 */
GAPRole_createTask();

/* Kick off application - Priority 1 */
SensorTag_createTask();
SensorTagTmp_createTask();
SensorTagHum_createTask();
SensorTagBar_createTask();
/* Kick off application WatchDog */

// watchdog_initlize();

/* Intializes random number generator */
time_t foo = time(NULL);
srand(foo);
Random_Number=rand() %10000;
Random_Number +=RESET_PERIODIC_EVT_PERIOD;
// kick off clock object
// Create one-shot clocks for internal periodic events.
Util_constructClock(&ResetClock, Reset_clockHandler,RESET_PERIODIC_EVT_PERIOD, 0, true, 0);
// Util_startClock(&ResetClock);
BIOS_start(); /* enable interrupts and start SYS/BIOS */

return 0;
}

As per the calculation i am setting it as one shot timer and time out be = 1000*60*60*12 =43200000  . so it should be 12 hours.But this is behaving strange and getting the reboot in 4 minutes only.Any help would be greatly appreciated.

Regards,

Deepak