I'm using a SAMA5D27C-D5M SiP with the internal 12MHz RC oscillator as Main Clock. However, this is causing a high drift in my external RTC (around 1 second per 3 minutes). This was observed by comparing the RTC time (hwclock command) and the System time (date command). I found a register that can be used to calibrate the RC oscillator (PMC Oscillator Calibration Register). There is some documentation in the Clock Generator chapter but it's not clear to me how this calibration works. How can I use this calibration? Could this solve the RTC drift problem?
Thanks in advance!