Linux下首次加载RTC时钟M41T81驱动报错

Linux下首次加载RTC时钟M41T81驱动报错

系统给出的报错信息如下:
rtc-m41t80 0-0068: Oscillator failure, data is invalid.
rtc-m41t80 0-0068: rtc core: registered m41t81 as rtc0
rtc-m41t80 0-0068: Oscillator failure, data is invalid.
系统启动后运行hwclock -r报错信息如下:
hwclock -r

hwclock:
ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument

解决方案:
运行以下命令
date --set=“2019-04-12 12:00:00”
hwclock --systohc -D --noadjfile --utc
hwclock --set --date “2019-04-12 12:00:00”

最后重新启动,RTC不再报错,时钟可以正常设置和读取。

你可能感兴趣的:(嵌入式Linux驱动开发)