I've implemented an external RTC (MCP79400) on to a system that is using an i.MX6 Solo X chip. The system is also using Linux L4.14.98 (Yocto Sumo).
I successfully implemented the driver (ds1307) to talk to the device via i2c. I've disabled the imx6 rtc (SNVS) to not drain the battery.
The issue that i'm seeing is that the external rtc is not saving the time between power cycles. It resets if completely powered off for more than 10 seconds.
I've confirmed when the main board power is off that the battery is powering the external RTC with a voltmeter.
I've confirmed that the chip is holding time when continuously powered by performing the following:
- Boot system with ds1307 talking to the external rtc
- External rtc is set (confirmed with hwclock command).
- Reboot system and detach ds1307 from talking to external rtc
- Changed device tree blob in uboot to one without the external rtc attached
- Using i2cget on device, I see the values of the addresses are incrementing every second.
- The registers OSCRUN and ST are 1 which confirm the oscillator is running.
To reiterate, I was only able to confirm this because the power was continuous between reboot. The time registers on the external rtc are reset to 0 when power is off for more than 10 seconds.
Is there another flag i need to set for it to save the time when main board power is off?
What am I missing? Is the ds1307 driver resetting it for the model of the device?
I've attached the external RTC datasheet.
Thanks in advance.