Hey guys,
I have an RTC module, it contains a pcf2127 chip. Under raspbian it will recognize the rtc and set the clock from it, then update from ntp (typically within 15 minutes of boot). I followed the following steps to use this RTC with PiCore:
Add 'tz=EST+5EDT,M3.2.0/2,M11.1.0/2' to /mnt/mmcblk0p1/cmdline.txt (to set my timezone)
Installed i2c-tools.tcz
installed rtc-4.9.22-picore-v7.tcz
Added the following at the end of /mnt/mmcblk0p1/config.txt 'dtoverlay=i2c-rtc,pcf2127'
rebooted
Verified rtc module can be seen with i2cdetect -y 1 (It shows up - UU)
tc@thermostat:~$ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 19 1a -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
tested with hwclock -r, and I get the time
tc@thermostat:~$ hwclock -r
Thu Sep 7 22:06:55 2017 0.000000 seconds
tested the time with date, it shows the actual time taking into account timezone
tc@thermostat:~$ date
Thu Sep 7 18:07:26 EDT 2017
Now here is my problem... When I reboot with the pi isolated from the internet the time gets set to unix epoc (Jan 1970). If I remove 'nortc' from cmdline.txt the system will hang on boot. It only shows the 4 raspberries on the screen... I can not ssh into the pi. I am considering writing a quick script to set the time to the hardware clock after boot however I feel like this functionality should work as is. Am I missing anything?