# RTC time issue

**URL:** <https://community.solid-run.com/t/rtc-time-issue/860>\
**Category:** NXP i.MX8M Plus\
**Created:** [July 8, 2024, 6:31am UTC](https://community.solid-run.com/t/rtc-time-issue/860 "2024-07-08T06:31:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kartheek](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kartheek](https://community.solid-run.com/u/Kartheek)\
**Post date:** [July 8, 2024, 6:31am UTC](https://community.solid-run.com/t/rtc-time-issue/860/1 "2024-07-08T06:31:26Z")

</div>

Hi Team,

We have RTC in custom boards. And updating time using NTP mechanism. After that we turned off custom boards for 2 days. On 3rd day while seeing time on our 3 custom boards with out connecting to network, observed the following.

BDNO.1—\>1min 15 sec fast when compared with UTC  
BDNO.2—\> 1min 50 sec slow when compared with UTC  
BDNO.3—\> hwclock: ioctl(RTC\_RD\_TIME) to /dev/rtc0 to read the time failed: Invalid argument

Please provide any suggestions to avoid those time differences.

Thanks,  
Kartheek

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [July 9, 2024, 4:00am UTC](https://community.solid-run.com/t/rtc-time-issue/860/2 "2024-07-09T04:00:53Z")

</div>

What RTC are you using? Depending on the RTC, and crystal they can have various settings that must be tuned specific to the implementation. From a configuration side under Linux how are you specifically setting the date / time via NTP? Most NTP mechanisms when a clock skew is too big it will slowly start adjusting the system time to be correct rather than making a big jump, after that the RTC will need to be updated before power-down.

If there is an invalid time/date that means that the date was never properly set on the RTC, or the battery backup failed and the registers were reset. First check the power of your battery, and make sure if your RTC has the functionality the charge circuit is configured properly.

---

<div class="post-metadata">

**Author:** ![Kartheek](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kartheek](https://community.solid-run.com/u/Kartheek)\
**Post date:** [July 15, 2024, 5:29am UTC](https://community.solid-run.com/t/rtc-time-issue/860/3 "2024-07-15T05:29:21Z")

</div>

Part numbers used on board.  
RTC: AM1805AQ  
Crystal: STDMUA8-32.768K.  
Coin cell battery voltage: 2.76V

For fresh board we are setting RTC like below:

1. To set RTC time: “hwclock -w”
2. To set to NTP mechanism: “timedatectl set-ntp 1” (Connected to network)
3. To read RTC: “hwclock -r”

Below is the circuit image for RTC.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/solid_run/original/1X/f9a4732b3fef4ace4d905fdcd78809a72842c739.png)
