I am trying to use a Pi 4 with I2C DS3231 hardware clock, on alpine 3.11.5 aarch64. I have activated the i2c bus, and followed the wiki to add the start_pre code.

But at boot time, I have an error.

I looked at the hwclock script, it tries to set kernel's TZ, but I have :

hwclock: settimeofday: Invalid argument

The commandline is hwclock --systz --utc.

Then the command that really sets time from DS3231 works fine.

But since the script adds return values, it displays Failed to set the system clock.

Also, I tried to disable swclock that save/restore the time based on shutdown/reboots, but it stills survive the reboots (I am working in data mode, and I lbu ci -d each time).

What have I missed ?

| improve this question | | | | |
  • What OS? I suggest that following obsolete tutorials (anything 3 years old has to be handled with caution) is a bad idea. – Milliways Apr 8 at 8:36
  • Alpine linux 3.11.5 aarch64 (latest at time of writing). I know what is an "old tutorial", and their wiki for hardware clock seams to work out of the box. But the error I have seams to be an error the tool hwclock raises, but I don't know why. The same command launched by hand after boot works fine. Also, I don't know how to disable swclock and persist this disabled state accross reboots – Dede Apr 9 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.