Is there a way to keep clock running on power down?

Is there a way to connect CMOS battery to keep clock running on power cut?

You should read the SRM, sections 6.1.5 and 6.1.6. It would be a good idea to read the relevant section of the TPS65217 datasheet, as well, before connecting a battery.

The system seems to expect a single-cell rechargable lithium battery (about 3.6V), with a thermistor thermally attached.

I think that if the input power to the board is removed, the whole system will be powered from the battery. If the system is shut down properly (via the button or command line shutdown), the system will power down with only the RTC being powered. This is the situation I think you seek.


Thank you. I will follow the sections and post back.

You might want to have a look at this thread!topic/beagleboard/vnu8sC9fgYo I don’t think it is possible to keep the built in RTC running off of battery. It you are able to use an external RTC, I wrote a tutorial lemoneer RTC on using a DS1307/DS3231 over I2C.

I looked at this a while back, since Linux is easier to use with an RTC, but it looks as if it’s not practical.
The best approach seems to be to add an external battery-backed RTC (which cost me half as much
as the entire BeagleBone…) And I ended up not using it much, since I need the serial port for debugging
and the (partial) cape blocks access to the serial pins.


     Thank you for your excellent tutorial on adding an external RTC. I do not see, however, any method to update this from NTP. there is a script /usr/bin/ntpdate-sync, but this uses the default hardware clock /dev/rtc which is a symlink to /dev/rtc0. Would it be reasonable to change this symlink to /dev/rtc1, thus automatically synchronizing the hardware if ntp is available?



You are correct sir; after the initial setup, I do not update the external RTC from NTP. The ChronoDot I used is supposed to drift less than a minute per year. I set the system time from the ChronoDot at boot and then rely on NTP to keep the system time correct and make adjustments. At boot it is conceivable that the time on the ChronoDot could be off by a minute or more, but for my purposes, this is ok. I just needed the system time to be relatively correct so my WPA wifi connection would not fail to establish. Modifying the script as you suggested will probably work. The other way I can see to do it would be to keep NTP updating the BBB system clock and have a script run at shutdown that syncs the external RTC to the system clock with hwclock -f ``/dev/rtc1 –w This would make sure your system time didn’t drift if you had internet access and keep the RTC up to date, but if you don’t, then if the system clock drifts, this will be synced to the external RTC.