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.

How to get GMT time on EK-TM4C1294XL

Hi,

I am stuck at a point. Following is the situation.

When board is booted than I have to get the GMT time regardless of network connectivity.

In case of Network connectivity I can ping any server and can get the time but how to achieve this in case of No Network connectivity.

I tired with time(), gmtime() but whenever board resets, it starts with some junk value at every time. which is not correct local or GMT time.

Is there a way to do this?

Thanks,

Bhavesh

  • Hello Bhavesh,

    You can use the network time and then program hibernate module in Calendar mode with the same setting. this way when the n/w is not connected the Hibernate module will give you the time. When the n/w becomes available, you can check back that the time match withing acceptable range,

    Regards
    Amit
  • Hi Amit,

    Yes. Hibernate module works with time set. Below are the queries which are needed to handle all scenarios.

    1) Board is loaded first time and there is no network, at that time how to get the current time.

    2) Lets say I have saved calender settings in Hibernate module. And that Board is rebooted via reset button. Will it have that settings saved? Also if power failure happens and when again board is restarted, will it have Calenders setting available and will give correct Current time ?

    And last if RTOS is implemented with Battery backup, will OS handles these parts? (This is still in RnD for us and will take atleast 2-3 months to start Development). 

    Thanks,

    Bhavesh

  • Hello Bhavesh,

    In the absence of a n/w, you would have to set it up as 0 time, till n/w connection is established. If the Hibernate has been enabled with a Hibernate RTC enabled then a reset will not affect.
    I cannot speak about RTOS is going to handle it as I have not used RTOS to manage Hibernate. But the functionality is not dependent on bare-metal or RTOS.

    Regards
    Amit