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.

CC3220MOD: How can set system clock from Code. Not from Local webpage.

Part Number: CC3220MOD

Hi Team TI,

I would like to set system clock from code. In OOB code it is given from local webpage. 

Is it any solution to set system clock from code?

Refer attached local webpage file. 

Also I have used "CLOCK_REALTIME" of time.h but it not set system clock which in shown on local webpage.

Thanks and Regards,

Mubin Q.

  • There should be some kind of conversion between the device's clocks values and the system time. 

    You can refer to the ClockSync library (in <sdk>/source/ti/net/utils/).

    There are 2 clock sources that can be used for the retrieval of system clock (based on the device slow clock).

    The PRCM (through MAP_PRCMSlowClkCtrFastGet()) can be used directly by an application running on the MCU. If you want to get the value converted to BSD's "struct tm" - you can use the ClockSync_get().

    The NWP maintains its own implementation of the system clock which can be set/get with sl_DeviceSet(SL_DEVICE_GENERAL, SL_DEVICE_GENERAL_DATE_TIME...) / sl_DeviceGet(..)

    ClockSync_update() can be used to update both clock from an SNTP server.

    Br,

    Kobi