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.

tracking time and date in CC2650 Launchpad for some months

Guru 18625 points
Other Parts Discussed in Thread: CC2650, SYSBIOS, CC1310

Good morning,

I would like to keep my CC2650 Launchpad operating as a sensor logger for, I don't know, one month :) I mean, upon booting and maybe configuring it, I will not connect to it for one month.

Since each measure (or set of measures) has to include a real time stamp of when they were taken, I was wondering which is the correct way to do this. I mean:

  1. I guess there is some "time module" which is init at around year 1970. Am I right? :) How do I update this time module with a new seed number?
  2. I do not really mind if the clock is not very precise. However, how much do you expect it to shift after 1 month?
  3. How will having this feature affect the current consumption of the CC2650?
  4. By now I'm checking timeApp, however this is at client level. Is there any complete TimeService example around the SDK? :)

Please let me know your opinions!

Have a really nice day of june :)

  • Oh, BTW, what I tried till now is to add some headers and here and there the following code extracted from TI-RTOS User guide:

    #include <time.h>
    
    #include <ti/sysbios/hal/Seconds.h>
    
    UInt32 t;
    
    time_t t1;
    
    struct tm *ltm;
    
    char *curTime;
    
    /* set to today’s date in seconds since Jan 1, 1970 */
    
    Seconds_set(1412800000); /* Wed, 08 Oct 2014 20:26:40 GMT */
    
    /* retrieve current time relative to Jan 1, 1970 */
    
    t = Seconds_get();
    
    /*
    
    * Use overridden time() function to get the current time.
    
    * Use standard C RTS library functions with return from time().
    
    * Assumes Seconds_set() has been called as above
    
    */
    
    t1 = time(NULL);
    
    ltm = localtime(&t1);
    
    curTime = asctime(ltm);
    
    System_printf("Time(GMT): %s\n", curTime);

    But the linker phase complains with:

    undefined                     first referenced

     symbol                           in file    

    ---------                     ----------------

    ti_sysbios_hal_Seconds_set__E <whole-program>

    error #10234-D: unresolved symbols remain

    error #10010: errors encountered during linking; "ProjectZeroApp_CC2650LAUNCHXL.out" not built

    So, I'm clearly doing something wrong. My background is in MSP430 so maybe I'm omitting something! As far as I understand, if I add the 2 "includes", I do not need to add anything to ".cfg" file, am I right? BTW, I do not see and ".cfg" file in the ProjectZeroApp BLE example, why? :)

    Ok, please teach me with your knowledge ;)

  • Hello,

    Did you modify the RTOS config file to add the Seconds module? You will find details on how to do this in the same RTOS documentation.

    Best wishes
  • Hi

    many thanks for your suggestion. I summarize you my situation. I'm just testing things by now :)

    I'm working with ProjectZeroApp for BLE. I have added a RTSC file to Project zero, resulting in "ProjectZeroApp_CC2650LAUNCHXL.cfg" and I have added to this file the following lines:

    var Seconds = xdc.useModule('ti.sysbios.hal.Seconds');
    Seconds.SecondsProxy = xdc.useModule('ti.sysbios.hal.SecondsClock');

    Then I have added to ProjectZero.c the following lines:

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

    So I can play with code like the one in TI-RTOS Kernel :

    UInt32 t;
    time_t t1;
    struct tm *ltm;
    char *curTime;
    
    /* set to today’s date in seconds since Jan 1, 1970 */
    Seconds_set(1412800000); /* Wed, 08 Oct 2014 20:26:40 GMT */

    But I keep getting the "unresolved symbols remain" error. So, maybe I'm doing something strange or stupid?

    Please let me know and have a nice day!

  • It's working now, I had a typo somewhere :)
  • Hi every one,
    I have the same problem. Can anyone help me?
  • I have tried to help you in your another similar post.

  • Hi,

    Once I feed UNIX time to above code. I was able to get current date and time. How can I keep counting time using RTC in CC1310 when I feed unix time one time? Can anyone help me to solve this problem. Thank you.