I have been using the AB1805_RK library for this watchdog/RTC IC and this appears to be working OK with P2 and Device OS 6.3.0. I have recently got further into a new product where I am using EthernetWiFi network detection and connection during startup. This works however the time isn't being set until the cloud connection is made and to get around this I thought I would use the time from the RTC on AB1805.
If I test first for isRTCSet() being true (the RTC on AB1805 has been set by sync with cloud time service) then I assumed a call to getRtcAsTime() would return the actual time/date being kept by the AB1805 RTC - unfortunately this isn't what it is returning. It appears to be the time when the device was last restarted (and time cloud sync'd) almost as though the AB1805 RTC was not advancing.
Any ideas as to why the AB1805 RTC is not keeping time? The board the P2 is on has a LiPo backup battery so the power should stay on to the IC. Other time details like time zone and DST are stored in the RAM in the AB1805 and this is working fine through a restart.
I would enable logging and see the low-level messages from the library. If time is not incrementing after being set from the cloud, it could be an oscillator issue on the AB1805.
Possibly, I am sure that this was working on a previous board spin. Just wanted to check it wasn't a setting. I am wondering if VBAT needs to be connected to 3V3 otherwise the clock doesn't update? Datasheet is a bit vague.
I have experimented with VBAT tied to 3V3 (with the LiPo backup battery) and to GND. In both cases the getRtcAsTime() is returning the last time set (restart time) and not the current time.
Question - if the AB1805 RTC is not working (I have found it to be a hard IC to use - the data sheet is vague) and there is now the option to use the watchdog on the P2 - do you think I should implement a more reliable RTC like DS3231?
It sounds like your 32kHz crystal isn't starting. The AB1805 has integral resistor and capacitors on the crystal oscillator pins. Have you tried removing C18 and C19? I don't think you need or want them.
Solved - designer assumed a 'normal' arrangement with capacitors to ground on either end of the crystal rather than the internal arrangement with the AB1805. Solved.
The start up issue with NRST has also gone away with the removal of the capacitors. Solved.
Device is now able to recover AB1805 RTC time with time zone, DST adjustments immediately at restart!