Hi!
I'm developing an application with Linux and NETDCU10.
I've detected that after software reboot (or supply disconnection) then time is lost.
Is the RTC losing the time or I have to read it from the RTC while rebooting? How?
Thanks.
Hi!
I'm developing an application with Linux and NETDCU10.
I've detected that after software reboot (or supply disconnection) then time is lost.
Is the RTC losing the time or I have to read it from the RTC while rebooting? How?
Thanks.
Hello,
on hardware side you have to enable the backup battery for RTC (DIP1/4=ON)!
Solves this the problem?
No, it doesn't.
When I type:
# hwclock --show
It always shows:
Thu Jan 1 00:59:59 1970 0.000000 seconds
It seems like the RTC were stopped
hwclock command fails when I try to set the time:
# hwclock --hctosys
hwclock: settimeofday() failed: Invalid argument
How can I know that the RTS is really working?
Thanks.
Quote from "jcollazo"hwclock command fails when I try to set the time:
# hwclock --hctosys
hwclock: settimeofday() failed: Invalid argument
I am having the same problem, is there any solution yet?
Patrick
I believe it's the other way round. After having set the time/date with the date command, you have to transfer it to the hwclock too, with --systohc. Then during reboot, the system time should automatically be read from the hwclock, you need not have to call hwclock --hctosys yourself.
So just remember to store the new time also to the hwclock after a change. What I don't know is how this can be achieved when using the automatic time adjustment via ntp. Maybe just copy the system time to the hardware clock in regular intervals.
Regards,
H. Keller
Thanks a lot! That works for me fine:
After setting the correct system-time and writing it to hwclock, you only need to load the time on system-boot (hwclock --hctosys).
Regards,
Patrick
Quote from "hwmbabe"After setting the correct system-time and writing it to hwclock, you only need to load the time on system-boot (hwclock --hctosys).
Doesn't the kernel load the system time from the RTC automatically on start-up? Well, ok, this may have changed since I made the linux kernel for NetDCU3 some years ago. But I think it's no big problem to add such a line to the start-up scripts.
Regards,
H. Keller