Skip to main content
Emm1592
Associate II
April 14, 2019
Solved

Set date and time RTC in main()

  • April 14, 2019
  • 1 reply
  • 1126 views

Hello,

I want to know if it is possible to set date and time of the RTC in the main() function.

I'm working with the LSI and I know that is very inaccurate. My idea is to -"re-initialize" (set manually the date and time) the RTC every 1 week for example.

I obtained those values, date and time, via serial from another device (with updated time).

I'm using the Nucleo Board STM32L476RG

Thank you very much!

This topic has been closed for replies.
Best answer by Clive1 (HNL)

Yes, implement a menu to allow configuration, or parse a GPS stream, or query from a cellular network.

You can write code to do pretty much anything you want.

The HAL has specific functions to get/set the time/date.

1 reply

Clive1 (HNL)
Clive1 (HNL)Best answer
Explorer
April 14, 2019

Yes, implement a menu to allow configuration, or parse a GPS stream, or query from a cellular network.

You can write code to do pretty much anything you want.

The HAL has specific functions to get/set the time/date.