Monday, November 7, 2016

rtc voltage low

add ioctl to get/clear battery low status:

https://groups.google.com/forum/m/#!topic/rtc-linux/

clear by just writing a new time? Seems unlikely:

https://forums.xilinx.com/t5/Embedded-Linux/RTC-retrieved-date-time-is-not-valid/td-p/266324

The source code:

http://lxr.free-electrons.com/source/drivers/rtc/rtc-pcf8563.c

Seems to suggest that the driver has a built-in clear of the low voltage bit, but how to access it?

Looks like my problem but nobody solved it:

https://forum.mqmaker.com/t/missing-rtc-coin-battery/171/20

The data sheet for the chip:

http://pdf.datasheetcatalog.com/datasheet/philips/PCF8563-02.pdf

Update: The RTC voltage low messages, while disturbing, turned out to be a completely false lead as to why the RTC clock was not returning the saved time. The actual answer was that I was not actually saving the time to the clock chip as I thought I was doing, because the "hwclock -w" command that I was using to write the system time needed a "-f /dev/rtc1" parameter. Without that parameter, the command was defaulting to save to /def/rtc0 which was the CPU's built-in, non-battery-backed hwclock.