PCF8523 RTC chip not initialize by kernel

Hello,

On our product, the VBAT pin of the PCF8523 chip is under limit voltage when delivering the goods to the end user (rechargeable system). On first boot, the kernel returns an invalid parameter value and cannot update the date in the chip.

After a hwclock write command to RTC, it can be updated without error by the kernel on next boot.

Is it possible to properly initialize this RTC chip by the kernel?

Enya

It has agreed by kernel maintainers that if an RTC is either low on battery, or not yet initialized it returns an error to userspace rather than invalid information. This is generally cleared by setting the correct time of the RTC which then starts it again and it functions normally as long as it has battery power. In most modern systems systemd takes care of getting time from the ntp and then setting the RTC, however you can configure the kernel to also do this.