See the remarkable output below. Many observations and some questions:
The internal RTC seems to be useless with the internal OSC.
The internal RTC gets updated; once every ? seconds. From which source?
What is the source for the date command? Specific which ARM Counter or with SoC Timer?
This test is with an Internet connection; hence the system clock gets updated with the NTP Client. Interesting to know what happens with no Internet connection.
pi@orangepizero:~$ cat ./rtc_test.sh
while true
do
./devmem2 0x01f00014 | tail -n 1 |rev|cut -f1 -d' '|rev | ./convert
echo `date +"%H:%M:%S"`
echo ==============
sleep 120
done
/*
* convert.c
*/
#include <stdio.h>
#include <stdlib.h>
#define TIME_GET_SEC_VALUE(x) ((x) & 0x0000003f)
#define TIME_GET_MIN_VALUE(x) (((x) & 0x00003f00) >> 8 )
#define TIME_GET_HOUR_VALUE(x) (((x) & 0x001f0000) >> 16)
int main(void) {
unsigned num;
fscanf(stdin, "%x", &num);
printf("%.2d:%.2d:%.2d\n", TIME_GET_HOUR_VALUE(num), TIME_GET_MIN_VALUE(num), TIME_GET_SEC_VALUE(num));
return EXIT_SUCCESS;
}