Hello,
I am not getting current time / date using RTC in CC26xx. Which Api call get the current time / date of RTC and How to set RTC time / date?
Any one used RTC in CC26xx pls gives me solution.
Thanks
Regards,
Rajneesh
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.
Hello,
I am not getting current time / date using RTC in CC26xx. Which Api call get the current time / date of RTC and How to set RTC time / date?
Any one used RTC in CC26xx pls gives me solution.
Thanks
Regards,
Rajneesh
Hello JXS,
Thank you.
I have read this thread e2e.ti.com/.../467792 but not helpful. I wants to get current date and time from RTC. Or to set current date and time from network time.
I haven't found any Api function call in aon_rtc.c.
Regards,
Rajneesh
You should not access the RTC directly in TI RTOS. TI RTOS has implemented a time function similar to UNIX time api's.
In the TI RTOS config file (appBLE.cfg), add in the module you want to compile add the bottom of the file:
var Seconds = xdc.useModule('ti.sysbios.hal.Seconds');
Then you can simply set and read out Unix Epoch time and use the C standard time functions (overriden by TI RTOS ) directly:
#include <time.h> #include <ti/sysbios/hal/Seconds.h> uint32_t sec; time_t t; static void someFunction(void) { uint32_t timeNow = 1426692075; Seconds_set(timeNow); while( (sec = Seconds_get()) != timeNow + 5) {} // <- This actually waits for 5 seconds! t = time(NULL); }
More info is found in chapter 5.4 of the TI RTOS kernel User Guide: www.ti.com/lit/spruex3
Regards,
Svend
Hello Svend,
Thank You.
It's really helpful for me, Can you know me how to determine 1426692075.
I have read I RTOS kernel User Guide.
There are Seconds_set(1412800000); /* Wed, 08 Oct 2014 20:26:40 GMT */
I don't understand how to determine 1412800000 for date and time set.
Thanks in advance.
Regards,
Rajneesh