Files with past dates on BeagleBoard
David R. Lane (77) 766 posts |
There are many files, presumably ones I have saved, that are dated early morning on 2nd January 1970, before my BB was born! This is, presumably, because the BeagleBoard has no real time clock. Question: Does it affect the functionality of BB? Presumably, it will affect copying newer versions of files witht the same filenames, but what else? |
Jeffrey Lee (213) 6048 posts |
It’ll affect anything that relies on the timestamp of files. So:
There are a few of solutions to the problem:
|
Jess Hampshire (158) 865 posts |
Would it be sensible to have the system check if the RTC is set to a time before the date of the ROM’s release, and at the very least set it to that? Wouldn’t the utility you suggest be better saving to HDD, then it wouldn’t be machine specific? it could just be a part of the standard !boot. |
Jeffrey Lee (213) 6048 posts |
That would solve problems caused by the clock jumping several years at a time, but it wouldn’t solve problems caused by the clock travelling back in time. It would also make it trickier to tell which files had/hadn’t been saved while the RTC was wrong.
Yes, that could be a good way of doing it. |
Jan Rinze (235) 368 posts |
Jeffrey, you mentioned that if you’re using a C3 or C4 beagleboard you should be able to fit an RTC battery. Both of my beagleboards are C3 and have the battery fitted. RISC OS however does not seem to take advantage of that. Is the RTC code not implemented yet? |
Jeffrey Lee (213) 6048 posts |
The code’s been there for months, and as far as I can tell it’s still working. It looks like you mentioned this problem back in October – did you ever try debugging the issue? I can upload a ROM image with the debugging code enabled if that’s any help. Also, are the RTC batteries installed correctly? In particular, has R66 been removed? (See the instructions on page 116 of the latest reference manual). Have you checked that the battery works fine under Linux? (remembering that Linux tries to be smart and will likely save the time to disc on shutdown – so leave the BB turned off for ten minutes or so before turning it back on, so it’s obvious whether the RTC kept running or not). |
Jess Hampshire (158) 865 posts |
If this were to happen, would the following be sensible? Add the facility to save the last successful time sync, and on failure to retrieve the current time from a server, use whichever is later of this, the last shutdown time and the RTC. |
Jeffrey Lee (213) 6048 posts |
That would work, but it wouldn’t be an ideal solution. Ideally the first thing the boot sequence should do is to check if the RTC is valid and reload the last shutdown time if it isn’t. That way all the later stages of the boot sequence are guaranteed to have a sensible time (even if the time later gets corrected by NetTime) This is partly why I was thinking of looking at it once the OMAP3 ROM has some proper support for NVRAM - that way the RTC checks could be built into the ROM image, allowing the RTC to be initialised with the last shutdown time when the CMOS/NVRAM code initialises. |
Jan Rinze (235) 368 posts |
recompiled a ROM from a fresh CVS checkout and I now can confirm that time is kept in the RTC and RISC OS will ‘see’ the proper time at boot. Must be something i missed in a previous CVS copy here. Will try and see if the RTC is still correct after being without power for more than 10 mins :-) |