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.

RTC TIME RESET ON WATCHDOG RESET

Other Parts Discussed in Thread: CC2650

Hi. I am using CC2650. I am using doing a real timestamp to the data packet. 

Time stamping i am able to do successfully. i am reading real time from connected app before setting to rtc, i am using Seconds_set() and Seconds_get() functions to set and get the timestamp... 

But when there is a reset from the watchdog(if in case), then the timestamp is restarting from 0.. (If not connected to app...)..

My question is Does RTC value that was set using Seconds_set() function also resets , if there is a watchdog reset (RESET_PIN of CC2650)... 

If YES, How can I retain the RTC Value that was updated once... 

If NO, then how to resolve this issue.. ?

Below is the code of time_util.c

void TimeStampData(uint8_t *data )
{

/*
uint32_t ui32CurrentSeconds;
ui32CurrentSeconds=HWREG(AON_RTC_BASE + 0x8);
data[0]=ui32CurrentSeconds >>24;
data[1]=ui32CurrentSeconds >>16;
data[2]=ui32CurrentSeconds >>8;
data[3]=ui32CurrentSeconds & 0xFF;
*/

ui32CurrentSeconds=Seconds_get();
data[0]=ui32CurrentSeconds >>24;
data[1]=ui32CurrentSeconds >>16;
data[2]=ui32CurrentSeconds >>8;
data[3]=ui32CurrentSeconds & 0xFF;

}

void RtcSetTimeSeconds(uint32_t ui32CurrentSeconds )
{

/*
uint32_t u32Status;
HWREG(AON_RTC_BASE + 0x8)=ui32CurrentSeconds;
u32Status= HWREG(AON_RTC_BASE + 0x2C);
*/
Seconds_set(ui32CurrentSeconds);

}

  • Hi Vishwanath,

    The RTC value will reset as part of a watchdog reset (which per default typically is a full system reset).

    If you need to retain the RTC value in between resets you will have to save this in some non-volatile area (or possibly in a specific variable in RAM marked as "no init"). You will get a error in time but this is the best approach I can think if to do this.