External RTC Ixora not readable

Hi,

I inserted the battery in the battery slot on the Ixora carrier board. My goaI was to load the external RTC by setting rtc1 as the default rtc with the example on the Toradex website, which did not work. I found out that I cannot read the external RTC at all.

dmesg prints the following output.

ubuntu@tegra-ubuntu:~$ dmesg | grep rtc
[    3.622391] as3722-rtc as3722-rtc.1: rtc core: registered as3722 as rtc0
[    3.622399] as3722-rtc as3722-rtc.1: RTC interrupt 449
[    3.626706] rtc-ds1307 0-0068: rtc core: registered m41t00 as rtc1
[    3.627165] tegra_rtc tegra_rtc: rtc core: registered tegra_rtc as rtc2
[    3.627196] tegra_rtc tegra_rtc: Tegra internal Real Time Clock
[    6.273718] as3722-rtc as3722-rtc.1: setting system clock to 2017-11-09 13:15:33 UTC (1510233333)

As you can see the external RTC is loaded as rtc1, but I cannot access it. while the others can be accessed. Not to mention loading it on boot. Does anyone know what may cause this behaviour?

ubuntu@tegra-ubuntu:~$ sudo hwclock --rtc=/dev/rtc0
Thu 09 Nov 2017 02:50:10 PM CET  -0.030254 seconds
ubuntu@tegra-ubuntu:~$ sudo hwclock --rtc=/dev/rtc1
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc1 to read the time failed: Invalid argument
ubuntu@tegra-ubuntu:~$ sudo hwclock --rtc=/dev/rtc2
Thu 01 Jan 1970 01:34:49 AM CET  -0.357581 seconds

I managed to get it to work. Apparently the external RTC was corrupted. First a write from the system clock to the hardware clock was necessary. This is achieved by:

sudo hwclock --rtc=/dev/rtc1 -w

Yes, just as e.g. indicated here or here already.