# RTC0 invalid - rtc0: read\_time: rtc\_time isn't valid - PCF2129 on LX2160A COM

**URL:** https://community.solid-run.com/t/rtc0-invalid-rtc0-read-time-rtc-time-isnt-valid-pcf2129-on-lx2160a-com/352
**Category:** NXP LX2160
**Created:** [June 14, 2022, 11:02pm UTC](https://community.solid-run.com/t/rtc0-invalid-rtc0-read-time-rtc-time-isnt-valid-pcf2129-on-lx2160a-com/352 "2022-06-14T23:02:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cizinsky](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@cizinsky](https://community.solid-run.com/u/cizinsky)
#### Post date: [June 14, 2022, 11:02pm UTC](https://community.solid-run.com/t/rtc0-invalid-rtc0-read-time-rtc-time-isnt-valid-pcf2129-on-lx2160a-com/352/1 "2022-06-14T23:02:00Z")

</div>

I am trying to use a bit newer kernel than the 5.10.x and vanilla/mainline is highly preferred. After some initial struggle, it’s running pretty all right, there are just a few problems left.

One is that RTC driver has stopped working properly. There should be PCF2129AT on i2c-2, address 0x51. I used CONFIG\_RTC\_DRV\_PCF2127=y in Linux kernel (tried 5.15.33, 5.15.46, 5.18.3). I get the same result:

rtc-pcf2127-i2c 2-0051: pcf2127\_rtc\_read\_time: raw data is cr3=5a, sec=14, min=14, hr=14, mday=14, wday=14, mon=14, year=14  
rtc-pcf2127-i2c 2-0051: pcf2127\_rtc\_read\_time: tm is secs=14, mins=14, hours=14, mday=14, mon=13, year=114, wday=4  
rtc rtc0: read\_time: rtc\_time isn’t valid

Other i2c devices like MUX, SFP I2C access or amc6821 seems to work properly.  
Is there a dependency for the RTC0 or anything I am missing?  
(There is also a RTC1 present on the board, but it’s not useful for battery backed-up real time storage, only for alarms, this also seems to work properly.)

---

<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: [June 15, 2022, 4:15am UTC](https://community.solid-run.com/t/rtc0-invalid-rtc0-read-time-rtc-time-isnt-valid-pcf2129-on-lx2160a-com/352/2 "2022-06-15T04:15:32Z")

</div>

Have you tried setting the time to be correct with the hwclock command? The state of the RTC can be inconsistent until it is set the first time.

---

<div class="post-metadata">

### Author: ![cizinsky](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@cizinsky](https://community.solid-run.com/u/cizinsky)
#### Post date: [June 15, 2022, 5:20am UTC](https://community.solid-run.com/t/rtc0-invalid-rtc0-read-time-rtc-time-isnt-valid-pcf2129-on-lx2160a-com/352/3 "2022-06-15T05:20:31Z")

</div>

Of course. I waited to have sync over ntp and used hwclock --systohc. It didn’t seem to produce any error, but any try to use hwclock to read couses errors mentioned above.
