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/EK-TM4C1294XL: How to set reference time for TI RTOS ?

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi All, 

Would you please let me know how to set initial time value for RTOS ?

I have used following example code of Second_set(), but it seems not correct.

 

  #include <ti/sysbios/hal/Seconds.h>
  #include <time.h>

  time_t t;
  struct tm *ltm;
  char *curTime;

  Seconds_set(STARTTIME);

  t = time(NULL);
  ltm = localtime(&t);
  curTime = asctime(ltm);
  System_printf("Time(GMT): %s\n", curTime);

I have used STARTTIME as 1480877209 which is unix epoch time of  2016-12-04T18:46:49Z (I got this value at wiki page )

but the result is Sun Oct 29 12:18:33 1950.

I have heard that TI RTOS time base is Jan, 1, 1900. so I have added 2208988800 (which is elapsed second of  Jan 1, 1970)  it cannot be covered by uint32 type. (overflow happened)

Would you let me know what value is correct reference value for RTOS ?

Best Regards,

Hae Ryong