XIAO Expansion board RTC battery didn't work

I had a problem where the RTC wasn’t maintaining time when the board was not powered on. I determined that the backup battery was not supplying power to the RTC. It turned out to be a dirty ground contact on the PCB for the battery. I was able to clean it using tissue, tweezers and alcohol.

Just thought I’d mention it because I suspect this is a common problem.

Do you have a code example of using the built in RTC clock on the XAIO?

I’m not having luck using the built in RTC.

Thanks!

Sorry, I’m using the RTC on the expansion board with the code from the WiKi and that works fine.

I haven’t tried the SAMD21 internal RTC. Not sure what example you are trying, but it’s probably an issue with the way the clocks are configured.